Bitcoin Core  27.99.0
P2P Digital Currency
optionsdialog.cpp
Go to the documentation of this file.
1 // Copyright (c) 2011-2022 The Bitcoin Core developers
2 // Distributed under the MIT software license, see the accompanying
3 // file COPYING or http://www.opensource.org/licenses/mit-license.php.
4 
5 #if defined(HAVE_CONFIG_H)
7 #endif
8 
9 #include <qt/optionsdialog.h>
10 #include <qt/forms/ui_optionsdialog.h>
11 
12 #include <qt/bitcoinunits.h>
13 #include <qt/clientmodel.h>
14 #include <qt/guiconstants.h>
15 #include <qt/guiutil.h>
16 #include <qt/optionsmodel.h>
17 
18 #include <common/system.h>
19 #include <interfaces/node.h>
21 #include <netbase.h>
22 #include <txdb.h>
23 
24 #include <chrono>
25 
26 #include <QApplication>
27 #include <QDataWidgetMapper>
28 #include <QDir>
29 #include <QFontDialog>
30 #include <QIntValidator>
31 #include <QLocale>
32 #include <QMessageBox>
33 #include <QSystemTrayIcon>
34 #include <QTimer>
35 
36 int setFontChoice(QComboBox* cb, const OptionsModel::FontChoice& fc)
37 {
38  int i;
39  for (i = cb->count(); --i >= 0; ) {
40  QVariant item_data = cb->itemData(i);
41  if (!item_data.canConvert<OptionsModel::FontChoice>()) continue;
42  if (item_data.value<OptionsModel::FontChoice>() == fc) {
43  break;
44  }
45  }
46  if (i == -1) {
47  // New item needed
48  QFont chosen_font = OptionsModel::getFontForChoice(fc);
49  QSignalBlocker block_currentindexchanged_signal(cb); // avoid triggering QFontDialog
50  cb->insertItem(0, QFontInfo(chosen_font).family(), QVariant::fromValue(fc));
51  i = 0;
52  }
53 
54  cb->setCurrentIndex(i);
55  return i;
56 }
57 
58 void setupFontOptions(QComboBox* cb, QLabel* preview)
59 {
60  QFont embedded_font{GUIUtil::fixedPitchFont(true)};
61  QFont system_font{GUIUtil::fixedPitchFont(false)};
62  cb->addItem(QObject::tr("Embedded \"%1\"").arg(QFontInfo(embedded_font).family()), QVariant::fromValue(OptionsModel::FontChoice{OptionsModel::FontChoiceAbstract::EmbeddedFont}));
63  cb->addItem(QObject::tr("Default system font \"%1\"").arg(QFontInfo(system_font).family()), QVariant::fromValue(OptionsModel::FontChoice{OptionsModel::FontChoiceAbstract::BestSystemFont}));
64  cb->addItem(QObject::tr("Custom…"));
65 
66  const auto& on_font_choice_changed = [cb, preview](int index) {
67  static int previous_index = -1;
68  QVariant item_data = cb->itemData(index);
69  QFont f;
70  if (item_data.canConvert<OptionsModel::FontChoice>()) {
72  } else {
73  bool ok;
74  f = QFontDialog::getFont(&ok, GUIUtil::fixedPitchFont(false), cb->parentWidget());
75  if (!ok) {
76  cb->setCurrentIndex(previous_index);
77  return;
78  }
80  }
81  if (preview) {
82  preview->setFont(f);
83  }
84  previous_index = index;
85  };
86  QObject::connect(cb, QOverload<int>::of(&QComboBox::currentIndexChanged), on_font_choice_changed);
87  on_font_choice_changed(cb->currentIndex());
88 }
89 
90 OptionsDialog::OptionsDialog(QWidget* parent, bool enableWallet)
91  : QDialog(parent, GUIUtil::dialog_flags),
92  ui(new Ui::OptionsDialog)
93 {
94  ui->setupUi(this);
95 
96  /* Main elements init */
97  ui->databaseCache->setMinimum(nMinDbCache);
98  ui->databaseCache->setMaximum(nMaxDbCache);
99  ui->threadsScriptVerif->setMinimum(-GetNumCores());
100  ui->threadsScriptVerif->setMaximum(MAX_SCRIPTCHECK_THREADS);
101  ui->pruneWarning->setVisible(false);
102  ui->pruneWarning->setStyleSheet("QLabel { color: red; }");
103 
104  ui->pruneSize->setEnabled(false);
105  connect(ui->prune, &QPushButton::toggled, ui->pruneSize, &QWidget::setEnabled);
106 
107  /* Network elements init */
108 #ifndef USE_UPNP
109  ui->mapPortUpnp->setEnabled(false);
110 #endif
111 #ifndef USE_NATPMP
112  ui->mapPortNatpmp->setEnabled(false);
113 #endif
114 
115  ui->proxyIp->setEnabled(false);
116  ui->proxyPort->setEnabled(false);
117  ui->proxyPort->setValidator(new QIntValidator(1, 65535, this));
118 
119  ui->proxyIpTor->setEnabled(false);
120  ui->proxyPortTor->setEnabled(false);
121  ui->proxyPortTor->setValidator(new QIntValidator(1, 65535, this));
122 
123  connect(ui->connectSocks, &QPushButton::toggled, ui->proxyIp, &QWidget::setEnabled);
124  connect(ui->connectSocks, &QPushButton::toggled, ui->proxyPort, &QWidget::setEnabled);
125  connect(ui->connectSocks, &QPushButton::toggled, this, &OptionsDialog::updateProxyValidationState);
126 
127  connect(ui->connectSocksTor, &QPushButton::toggled, ui->proxyIpTor, &QWidget::setEnabled);
128  connect(ui->connectSocksTor, &QPushButton::toggled, ui->proxyPortTor, &QWidget::setEnabled);
129  connect(ui->connectSocksTor, &QPushButton::toggled, this, &OptionsDialog::updateProxyValidationState);
130 
131  /* Window elements init */
132 #ifdef Q_OS_MACOS
133  /* remove Window tab on Mac */
134  ui->tabWidget->removeTab(ui->tabWidget->indexOf(ui->tabWindow));
135  /* hide launch at startup option on macOS */
136  ui->bitcoinAtStartup->setVisible(false);
137  ui->verticalLayout_Main->removeWidget(ui->bitcoinAtStartup);
138  ui->verticalLayout_Main->removeItem(ui->horizontalSpacer_0_Main);
139 #endif
140 
141  /* remove Wallet tab and 3rd party-URL textbox in case of -disablewallet */
142  if (!enableWallet) {
143  ui->tabWidget->removeTab(ui->tabWidget->indexOf(ui->tabWallet));
144  ui->thirdPartyTxUrlsLabel->setVisible(false);
145  ui->thirdPartyTxUrls->setVisible(false);
146  }
147 
148 #ifdef ENABLE_EXTERNAL_SIGNER
149  ui->externalSignerPath->setToolTip(ui->externalSignerPath->toolTip().arg(PACKAGE_NAME));
150 #else
151  //: "External signing" means using devices such as hardware wallets.
152  ui->externalSignerPath->setToolTip(tr("Compiled without external signing support (required for external signing)"));
153  ui->externalSignerPath->setEnabled(false);
154 #endif
155  /* Display elements init */
156  QDir translations(":translations");
157 
158  ui->bitcoinAtStartup->setToolTip(ui->bitcoinAtStartup->toolTip().arg(PACKAGE_NAME));
159  ui->bitcoinAtStartup->setText(ui->bitcoinAtStartup->text().arg(PACKAGE_NAME));
160 
161  ui->openBitcoinConfButton->setToolTip(ui->openBitcoinConfButton->toolTip().arg(PACKAGE_NAME));
162 
163  ui->lang->setToolTip(ui->lang->toolTip().arg(PACKAGE_NAME));
164  ui->lang->addItem(QString("(") + tr("default") + QString(")"), QVariant(""));
165  for (const QString &langStr : translations.entryList())
166  {
167  QLocale locale(langStr);
168 
170  if(langStr.contains("_"))
171  {
173  ui->lang->addItem(locale.nativeLanguageName() + QString(" - ") + locale.nativeCountryName() + QString(" (") + langStr + QString(")"), QVariant(langStr));
174  }
175  else
176  {
178  ui->lang->addItem(locale.nativeLanguageName() + QString(" (") + langStr + QString(")"), QVariant(langStr));
179  }
180  }
181  ui->unit->setModel(new BitcoinUnits(this));
182 
183  /* Widget-to-option mapper */
184  mapper = new QDataWidgetMapper(this);
185  mapper->setSubmitPolicy(QDataWidgetMapper::ManualSubmit);
186  mapper->setOrientation(Qt::Vertical);
187 
189  connect(delegate, &GUIUtil::ItemDelegate::keyEscapePressed, this, &OptionsDialog::reject);
190  mapper->setItemDelegate(delegate);
191 
192  /* setup/change UI elements when proxy IPs are invalid/valid */
193  ui->proxyIp->setCheckValidator(new ProxyAddressValidator(parent));
194  ui->proxyIpTor->setCheckValidator(new ProxyAddressValidator(parent));
197  connect(ui->proxyPort, &QLineEdit::textChanged, this, &OptionsDialog::updateProxyValidationState);
198  connect(ui->proxyPortTor, &QLineEdit::textChanged, this, &OptionsDialog::updateProxyValidationState);
199 
200  if (!QSystemTrayIcon::isSystemTrayAvailable()) {
201  ui->showTrayIcon->setChecked(false);
202  ui->showTrayIcon->setEnabled(false);
203  ui->minimizeToTray->setChecked(false);
204  ui->minimizeToTray->setEnabled(false);
205  }
206 
207  setupFontOptions(ui->moneyFont, ui->moneyFont_preview);
208 
210 }
211 
213 {
214  delete ui;
215 }
216 
218 {
219  m_client_model = client_model;
220 }
221 
223 {
224  this->model = _model;
225 
226  if(_model)
227  {
228  /* check if client restart is needed and show persistent message */
229  if (_model->isRestartRequired())
230  showRestartWarning(true);
231 
232  // Prune values are in GB to be consistent with intro.cpp
233  static constexpr uint64_t nMinDiskSpace = (MIN_DISK_SPACE_FOR_BLOCK_FILES / GB_BYTES) + (MIN_DISK_SPACE_FOR_BLOCK_FILES % GB_BYTES) ? 1 : 0;
234  ui->pruneSize->setRange(nMinDiskSpace, std::numeric_limits<int>::max());
235 
236  QString strLabel = _model->getOverriddenByCommandLine();
237  if (strLabel.isEmpty())
238  strLabel = tr("none");
239  ui->overriddenByCommandLineLabel->setText(strLabel);
240 
241  mapper->setModel(_model);
242  setMapper();
243  mapper->toFirst();
244 
245  const auto& font_for_money = _model->data(_model->index(OptionsModel::FontForMoney, 0), Qt::EditRole).value<OptionsModel::FontChoice>();
246  setFontChoice(ui->moneyFont, font_for_money);
247 
249  }
250 
251  /* warn when one of the following settings changes by user action (placed here so init via mapper doesn't trigger them) */
252 
253  /* Main */
254  connect(ui->prune, &QCheckBox::clicked, this, &OptionsDialog::showRestartWarning);
255  connect(ui->prune, &QCheckBox::clicked, this, &OptionsDialog::togglePruneWarning);
256  connect(ui->pruneSize, qOverload<int>(&QSpinBox::valueChanged), this, &OptionsDialog::showRestartWarning);
257  connect(ui->databaseCache, qOverload<int>(&QSpinBox::valueChanged), this, &OptionsDialog::showRestartWarning);
258  connect(ui->externalSignerPath, &QLineEdit::textChanged, [this]{ showRestartWarning(); });
259  connect(ui->threadsScriptVerif, qOverload<int>(&QSpinBox::valueChanged), this, &OptionsDialog::showRestartWarning);
260  /* Wallet */
261  connect(ui->spendZeroConfChange, &QCheckBox::clicked, this, &OptionsDialog::showRestartWarning);
262  /* Network */
263  connect(ui->allowIncoming, &QCheckBox::clicked, this, &OptionsDialog::showRestartWarning);
264  connect(ui->enableServer, &QCheckBox::clicked, this, &OptionsDialog::showRestartWarning);
265  connect(ui->connectSocks, &QCheckBox::clicked, this, &OptionsDialog::showRestartWarning);
266  connect(ui->connectSocksTor, &QCheckBox::clicked, this, &OptionsDialog::showRestartWarning);
267  /* Display */
268  connect(ui->lang, qOverload<>(&QValueComboBox::valueChanged), [this]{ showRestartWarning(); });
269  connect(ui->thirdPartyTxUrls, &QLineEdit::textChanged, [this]{ showRestartWarning(); });
270 }
271 
273 {
274  QWidget *tab_widget = nullptr;
275  if (tab == OptionsDialog::Tab::TAB_NETWORK) tab_widget = ui->tabNetwork;
276  if (tab == OptionsDialog::Tab::TAB_MAIN) tab_widget = ui->tabMain;
277  if (tab_widget && ui->tabWidget->currentWidget() != tab_widget) {
278  ui->tabWidget->setCurrentWidget(tab_widget);
279  }
280 }
281 
283 {
284  /* Main */
285  mapper->addMapping(ui->bitcoinAtStartup, OptionsModel::StartAtStartup);
286  mapper->addMapping(ui->threadsScriptVerif, OptionsModel::ThreadsScriptVerif);
287  mapper->addMapping(ui->databaseCache, OptionsModel::DatabaseCache);
288  mapper->addMapping(ui->prune, OptionsModel::Prune);
289  mapper->addMapping(ui->pruneSize, OptionsModel::PruneSize);
290 
291  /* Wallet */
292  mapper->addMapping(ui->spendZeroConfChange, OptionsModel::SpendZeroConfChange);
293  mapper->addMapping(ui->coinControlFeatures, OptionsModel::CoinControlFeatures);
294  mapper->addMapping(ui->subFeeFromAmount, OptionsModel::SubFeeFromAmount);
295  mapper->addMapping(ui->externalSignerPath, OptionsModel::ExternalSignerPath);
296  mapper->addMapping(ui->m_enable_psbt_controls, OptionsModel::EnablePSBTControls);
297 
298  /* Network */
299  mapper->addMapping(ui->mapPortUpnp, OptionsModel::MapPortUPnP);
300  mapper->addMapping(ui->mapPortNatpmp, OptionsModel::MapPortNatpmp);
301  mapper->addMapping(ui->allowIncoming, OptionsModel::Listen);
302  mapper->addMapping(ui->enableServer, OptionsModel::Server);
303 
304  mapper->addMapping(ui->connectSocks, OptionsModel::ProxyUse);
305  mapper->addMapping(ui->proxyIp, OptionsModel::ProxyIP);
306  mapper->addMapping(ui->proxyPort, OptionsModel::ProxyPort);
307 
308  mapper->addMapping(ui->connectSocksTor, OptionsModel::ProxyUseTor);
309  mapper->addMapping(ui->proxyIpTor, OptionsModel::ProxyIPTor);
310  mapper->addMapping(ui->proxyPortTor, OptionsModel::ProxyPortTor);
311 
312  /* Window */
313 #ifndef Q_OS_MACOS
314  if (QSystemTrayIcon::isSystemTrayAvailable()) {
315  mapper->addMapping(ui->showTrayIcon, OptionsModel::ShowTrayIcon);
316  mapper->addMapping(ui->minimizeToTray, OptionsModel::MinimizeToTray);
317  }
318  mapper->addMapping(ui->minimizeOnClose, OptionsModel::MinimizeOnClose);
319 #endif
320 
321  /* Display */
322  mapper->addMapping(ui->lang, OptionsModel::Language);
323  mapper->addMapping(ui->unit, OptionsModel::DisplayUnit);
324  mapper->addMapping(ui->thirdPartyTxUrls, OptionsModel::ThirdPartyTxUrls);
325 }
326 
328 {
329  ui->okButton->setEnabled(fState);
330 }
331 
333 {
334  if (model) {
335  // confirmation dialog
336  /*: Text explaining that the settings changed will not come into effect
337  until the client is restarted. */
338  QString reset_dialog_text = tr("Client restart required to activate changes.") + "<br><br>";
339  /*: Text explaining to the user that the client's current settings
340  will be backed up at a specific location. %1 is a stand-in
341  argument for the backup location's path. */
342  reset_dialog_text.append(tr("Current settings will be backed up at \"%1\".").arg(m_client_model->dataDir()) + "<br><br>");
343  /*: Text asking the user to confirm if they would like to proceed
344  with a client shutdown. */
345  reset_dialog_text.append(tr("Client will be shut down. Do you want to proceed?"));
346  //: Window title text of pop-up window shown when the user has chosen to reset options.
347  QMessageBox::StandardButton btnRetVal = QMessageBox::question(this, tr("Confirm options reset"),
348  reset_dialog_text, QMessageBox::Yes | QMessageBox::Cancel, QMessageBox::Cancel);
349 
350  if (btnRetVal == QMessageBox::Cancel)
351  return;
352 
353  /* reset all options and close GUI */
354  model->Reset();
355  close();
356  Q_EMIT quitOnReset();
357  }
358 }
359 
361 {
362  QMessageBox config_msgbox(this);
363  config_msgbox.setIcon(QMessageBox::Information);
364  //: Window title text of pop-up box that allows opening up of configuration file.
365  config_msgbox.setWindowTitle(tr("Configuration options"));
366  /*: Explanatory text about the priority order of instructions considered by client.
367  The order from high to low being: command-line, configuration file, GUI settings. */
368  config_msgbox.setText(tr("The configuration file is used to specify advanced user options which override GUI settings. "
369  "Additionally, any command-line options will override this configuration file."));
370 
371  QPushButton* open_button = config_msgbox.addButton(tr("Continue"), QMessageBox::ActionRole);
372  config_msgbox.addButton(tr("Cancel"), QMessageBox::RejectRole);
373  open_button->setDefault(true);
374 
375  config_msgbox.exec();
376 
377  if (config_msgbox.clickedButton() != open_button) return;
378 
379  /* show an error if there was some problem opening the file */
381  QMessageBox::critical(this, tr("Error"), tr("The configuration file could not be opened."));
382 }
383 
385 {
386  model->setData(model->index(OptionsModel::FontForMoney, 0), ui->moneyFont->itemData(ui->moneyFont->currentIndex()));
387 
388  mapper->submit();
389  accept();
391 }
392 
394 {
395  reject();
396 }
397 
399 {
400  if (state == Qt::Checked) {
401  ui->minimizeToTray->setEnabled(true);
402  } else {
403  ui->minimizeToTray->setChecked(false);
404  ui->minimizeToTray->setEnabled(false);
405  }
406 }
407 
409 {
410  ui->pruneWarning->setVisible(!ui->pruneWarning->isVisible());
411 }
412 
413 void OptionsDialog::showRestartWarning(bool fPersistent)
414 {
415  ui->statusLabel->setStyleSheet("QLabel { color: red; }");
416 
417  if(fPersistent)
418  {
419  ui->statusLabel->setText(tr("Client restart required to activate changes."));
420  }
421  else
422  {
423  ui->statusLabel->setText(tr("This change would require a client restart."));
424  // clear non-persistent status label after 10 seconds
425  // Todo: should perhaps be a class attribute, if we extend the use of statusLabel
426  QTimer::singleShot(10s, this, &OptionsDialog::clearStatusLabel);
427  }
428 }
429 
431 {
432  ui->statusLabel->clear();
433  if (model && model->isRestartRequired()) {
434  showRestartWarning(true);
435  }
436 }
437 
439 {
440  QValidatedLineEdit *pUiProxyIp = ui->proxyIp;
441  QValidatedLineEdit *otherProxyWidget = (pUiProxyIp == ui->proxyIpTor) ? ui->proxyIp : ui->proxyIpTor;
442  if (pUiProxyIp->isValid() && (!ui->proxyPort->isEnabled() || ui->proxyPort->text().toInt() > 0) && (!ui->proxyPortTor->isEnabled() || ui->proxyPortTor->text().toInt() > 0))
443  {
444  setOkButtonState(otherProxyWidget->isValid()); //only enable ok button if both proxys are valid
446  }
447  else
448  {
449  setOkButtonState(false);
450  ui->statusLabel->setStyleSheet("QLabel { color: red; }");
451  ui->statusLabel->setText(tr("The supplied proxy address is invalid."));
452  }
453 }
454 
456 {
457  std::string proxyIpText{ui->proxyIp->text().toStdString()};
458  if (!IsUnixSocketPath(proxyIpText)) {
459  const std::optional<CNetAddr> ui_proxy_netaddr{LookupHost(proxyIpText, /*fAllowLookup=*/false)};
460  const CService ui_proxy{ui_proxy_netaddr.value_or(CNetAddr{}), ui->proxyPort->text().toUShort()};
461  proxyIpText = ui_proxy.ToStringAddrPort();
462  }
463 
464  Proxy proxy;
465  bool has_proxy;
466 
467  has_proxy = model->node().getProxy(NET_IPV4, proxy);
468  ui->proxyReachIPv4->setChecked(has_proxy && proxy.ToString() == proxyIpText);
469 
470  has_proxy = model->node().getProxy(NET_IPV6, proxy);
471  ui->proxyReachIPv6->setChecked(has_proxy && proxy.ToString() == proxyIpText);
472 
473  has_proxy = model->node().getProxy(NET_ONION, proxy);
474  ui->proxyReachTor->setChecked(has_proxy && proxy.ToString() == proxyIpText);
475 }
476 
478 QValidator(parent)
479 {
480 }
481 
482 QValidator::State ProxyAddressValidator::validate(QString &input, int &pos) const
483 {
484  Q_UNUSED(pos);
485  // Validate the proxy
486  CService serv(LookupNumeric(input.toStdString(), DEFAULT_GUI_PROXY_PORT));
487  Proxy addrProxy = Proxy(serv, true);
488  if (addrProxy.IsValid())
489  return QValidator::Acceptable;
490 
491  return QValidator::Invalid;
492 }
if(!SetupNetworking())
#define PACKAGE_NAME
static constexpr int MAX_SCRIPTCHECK_THREADS
Maximum number of dedicated script-checking threads allowed.
Bitcoin unit definitions.
Definition: bitcoinunits.h:33
Network address.
Definition: netaddress.h:112
A combination of a network address (CNetAddr) and a (TCP) port.
Definition: netaddress.h:531
Model for Bitcoin network client.
Definition: clientmodel.h:54
QString dataDir() const
Preferences dialog.
Definition: optionsdialog.h:37
void setModel(OptionsModel *model)
OptionsModel * model
Definition: optionsdialog.h:78
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)
ClientModel * m_client_model
Definition: optionsdialog.h:77
void on_resetButton_clicked()
Ui::OptionsDialog * ui
Definition: optionsdialog.h:76
void quitOnReset()
OptionsDialog(QWidget *parent, bool enableWallet)
QDataWidgetMapper * mapper
Definition: optionsdialog.h:79
void clearStatusLabel()
void setClientModel(ClientModel *client_model)
void on_cancelButton_clicked()
void setOkButtonState(bool fState)
Interface from Qt to configuration data structure for Bitcoin client.
Definition: optionsmodel.h:43
QVariant data(const QModelIndex &index, int role=Qt::DisplayRole) const override
std::variant< FontChoiceAbstract, QFont > FontChoice
Definition: optionsmodel.h:85
bool isRestartRequired() const
bool setData(const QModelIndex &index, const QVariant &value, int role=Qt::EditRole) override
static QFont getFontForChoice(const FontChoice &fc)
const QString & getOverriddenByCommandLine()
Definition: optionsmodel.h:110
interfaces::Node & node() const
Definition: optionsmodel.h:122
Proxy address widget validator, checks for a valid proxy address.
Definition: optionsdialog.h:26
ProxyAddressValidator(QObject *parent)
State validate(QString &input, int &pos) const override
Definition: netbase.h:59
std::string ToString() const
Definition: netbase.h:82
bool IsValid() const
Definition: netbase.h:70
Line edit that can be marked as "invalid" to show input validation feedback.
void validationDidChange(QValidatedLineEdit *validatedLineEdit)
void valueChanged()
virtual bool getProxy(Network net, Proxy &proxy_info)=0
Get proxy.
int GetNumCores()
Return the number of cores available on the current system.
Definition: system.cpp:103
static constexpr uint64_t GB_BYTES
Definition: guiconstants.h:57
Utility functions used by the Bitcoin Qt UI.
Definition: bitcoingui.h:60
bool openBitcoinConf()
Definition: guiutil.cpp:437
QFont fixedPitchFont(bool use_embedded_font)
Definition: guiutil.cpp:104
void handleCloseWindowShortcut(QWidget *w)
Definition: guiutil.cpp:423
constexpr auto dialog_flags
Definition: guiutil.h:60
@ NET_ONION
TOR (v2 or v3)
Definition: netaddress.h:43
@ NET_IPV6
IPv6.
Definition: netaddress.h:40
@ NET_IPV4
IPv4.
Definition: netaddress.h:37
std::vector< CNetAddr > LookupHost(const std::string &name, unsigned int nMaxSolutions, bool fAllowLookup, DNSLookupFn dns_lookup_function)
Resolve a host string to its corresponding network addresses.
Definition: netbase.cpp:166
bool IsUnixSocketPath(const std::string &name)
Check if a string is a valid UNIX domain socket path.
Definition: netbase.cpp:219
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.
Definition: netbase.cpp:209
void setupFontOptions(QComboBox *cb, QLabel *preview)
int setFontChoice(QComboBox *cb, const OptionsModel::FontChoice &fc)
static constexpr uint16_t DEFAULT_GUI_PROXY_PORT
Definition: optionsmodel.h:24
static const int64_t nMinDbCache
min. -dbcache (MiB)
Definition: txdb.h:31
static const int64_t nMaxDbCache
max. -dbcache (MiB)
Definition: txdb.h:29
static const uint64_t MIN_DISK_SPACE_FOR_BLOCK_FILES
Definition: validation.h:77