5#if defined(HAVE_CONFIG_H)
18#include <validation.h>
22#include <QDataWidgetMapper>
24#include <QIntValidator>
28#include <QSystemTrayIcon>
57 connect(
this, &QDialog::accepted, [
this](){
59 model->
node().mapPort(settings.value(
"fUseUPnP").toBool(), settings.value(
"fUseNatpmp").toBool());
64 ui->
proxyPort->setValidator(
new QIntValidator(1, 65535,
this));
95#ifndef ENABLE_EXTERNAL_SIGNER
97 ui->
externalSignerPath->setToolTip(tr(
"Compiled without external signing support (required for external signing)"));
101 QDir translations(
":translations");
109 ui->
lang->addItem(QString(
"(") + tr(
"default") + QString(
")"), QVariant(
""));
110 for (
const QString &langStr : translations.entryList())
112 QLocale locale(langStr);
115 if(langStr.contains(
"_"))
118 ui->
lang->addItem(locale.nativeLanguageName() + QString(
" - ") + locale.nativeCountryName() + QString(
" (") + langStr + QString(
")"), QVariant(langStr));
123 ui->
lang->addItem(locale.nativeLanguageName() + QString(
" (") + langStr + QString(
")"), QVariant(langStr));
129 mapper =
new QDataWidgetMapper(
this);
130 mapper->setSubmitPolicy(QDataWidgetMapper::ManualSubmit);
131 mapper->setOrientation(Qt::Vertical);
135 mapper->setItemDelegate(delegate);
145 if (!QSystemTrayIcon::isSystemTrayAvailable()) {
154 embedded_font.setWeight(QFont::Bold);
160 system_font.setWeight(QFont::Bold);
176 this->
model = _model;
186 ui->
pruneSize->setRange(nMinDiskSpace, std::numeric_limits<int>::max());
189 if (strLabel.isEmpty())
190 strLabel = tr(
"none");
218 connect(
ui->
thirdPartyTxUrls, &QLineEdit::textChanged, [
this]{ showRestartWarning(); });
223 QWidget *tab_widget =
nullptr;
224 if (tab == OptionsDialog::Tab::TAB_NETWORK) tab_widget =
ui->
tabNetwork;
225 if (tab == OptionsDialog::Tab::TAB_MAIN) tab_widget =
ui->
tabMain;
226 if (tab_widget &&
ui->
tabWidget->currentWidget() != tab_widget) {
262 if (QSystemTrayIcon::isSystemTrayAvailable()) {
286 QMessageBox::StandardButton btnRetVal = QMessageBox::question(
this, tr(
"Confirm options reset"),
287 tr(
"Client restart required to activate changes.") +
"<br><br>" + tr(
"Client will be shut down. Do you want to proceed?"),
288 QMessageBox::Yes | QMessageBox::Cancel, QMessageBox::Cancel);
290 if(btnRetVal == QMessageBox::Cancel)
302 QMessageBox config_msgbox(
this);
303 config_msgbox.setIcon(QMessageBox::Information);
305 config_msgbox.setWindowTitle(tr(
"Configuration options"));
308 config_msgbox.setText(tr(
"The configuration file is used to specify advanced user options which override GUI settings. "
309 "Additionally, any command-line options will override this configuration file."));
311 QPushButton* open_button = config_msgbox.addButton(tr(
"Continue"), QMessageBox::ActionRole);
312 config_msgbox.addButton(tr(
"Cancel"), QMessageBox::RejectRole);
313 open_button->setDefault(
true);
315 config_msgbox.exec();
317 if (config_msgbox.clickedButton() != open_button)
return;
321 QMessageBox::critical(
this, tr(
"Error"), tr(
"The configuration file could not be opened."));
338 if (state == Qt::Checked) {
357 ui->
statusLabel->setText(tr(
"Client restart required to activate changes."));
361 ui->
statusLabel->setText(tr(
"This change would require a client restart."));
389 ui->
statusLabel->setText(tr(
"The supplied proxy address is invalid."));
396 std::string strProxy;
397 QString strDefaultProxyGUI;
427 return QValidator::Acceptable;
429 return QValidator::Invalid;
Bitcoin unit definitions.
std::string ToStringIP() const
A combination of a network address (CNetAddr) and a (TCP) port.
std::string ToStringPort() const
void setModel(OptionsModel *model)
void setCurrentTab(OptionsDialog::Tab tab)
void on_showTrayIcon_stateChanged(int state)
void on_okButton_clicked()
void on_openBitcoinConfButton_clicked()
void updateDefaultProxyNets()
void updateProxyValidationState()
void togglePruneWarning(bool enabled)
void showRestartWarning(bool fPersistent=false)
void on_resetButton_clicked()
OptionsDialog(QWidget *parent, bool enableWallet)
QDataWidgetMapper * mapper
void on_cancelButton_clicked()
void setOkButtonState(bool fState)
Interface from Qt to configuration data structure for Bitcoin client.
bool isRestartRequired() const
interfaces::Node & node() const
@ UseEmbeddedMonospacedFont
const QString & getOverriddenByCommandLine()
Proxy address widget validator, checks for a valid proxy address.
ProxyAddressValidator(QObject *parent)
State validate(QString &input, int &pos) const override
Line edit that can be marked as "invalid" to show input validation feedback.
void validationDidChange(QValidatedLineEdit *validatedLineEdit)
void setEnabled(bool enabled)
void setCheckValidator(const QValidator *v)
QRadioButton * systemFont_radioButton
QLabel * overriddenByCommandLineLabel
QSpinBox * threadsScriptVerif
QCheckBox * connectSocksTor
QCheckBox * minimizeToTray
void setupUi(QDialog *OptionsDialog)
QCheckBox * bitcoinAtStartup
QVBoxLayout * verticalLayout_Main
QLineEdit * externalSignerPath
QCheckBox * subFeeFromAmount
QPushButton * openBitcoinConfButton
QCheckBox * coinControlFeatures
QValidatedLineEdit * proxyIpTor
QCheckBox * allowIncoming
QLineEdit * thirdPartyTxUrls
QLabel * embeddedFont_label_1
QSpacerItem * horizontalSpacer_0_Main
QLabel * embeddedFont_label_9
QCheckBox * spendZeroConfChange
QCheckBox * mapPortNatpmp
QCheckBox * proxyReachIPv4
QCheckBox * proxyReachIPv6
QLabel * systemFont_label_1
QLabel * systemFont_label_9
QCheckBox * proxyReachTor
QRadioButton * embeddedFont_radioButton
QValidatedLineEdit * proxyIp
QCheckBox * minimizeOnClose
QLabel * thirdPartyTxUrlsLabel
virtual bool getProxy(Network net, proxyType &proxy_info)=0
Get proxy.
if(na.IsAddrV1Compatible())
static constexpr uint64_t GB_BYTES
Utility functions used by the Bitcoin Qt UI.
QFont fixedPitchFont(bool use_embedded_font)
void handleCloseWindowShortcut(QWidget *w)
constexpr auto dialog_flags
@ NET_ONION
TOR (v2 or v3)
CService LookupNumeric(const std::string &name, uint16_t portDefault, DNSLookupFn dns_lookup_function)
Resolve a service string with a numeric IP to its first corresponding service.
static constexpr uint16_t DEFAULT_GUI_PROXY_PORT
static const int64_t nMinDbCache
min. -dbcache (MiB)
static const int64_t nMaxDbCache
max. -dbcache (MiB)
int GetNumCores()
Return the number of cores available on the current system.
static const uint64_t MIN_DISK_SPACE_FOR_BLOCK_FILES
static const int MAX_SCRIPTCHECK_THREADS
Maximum number of dedicated script-checking threads allowed.