5 #if defined(HAVE_CONFIG_H) 22 #include <validation.h> 26 #include <QDataWidgetMapper> 28 #include <QIntValidator> 30 #include <QMessageBox> 31 #include <QSystemTrayIcon> 61 ui->
proxyPort->setValidator(
new QIntValidator(1, 65535,
this));
92 #ifdef ENABLE_EXTERNAL_SIGNER 96 ui->
externalSignerPath->setToolTip(tr(
"Compiled without external signing support (required for external signing)"));
100 QDir translations(
":translations");
108 ui->
lang->addItem(QString(
"(") + tr(
"default") + QString(
")"), QVariant(
""));
109 for (
const QString &langStr : translations.entryList())
111 QLocale locale(langStr);
114 if(langStr.contains(
"_"))
117 ui->
lang->addItem(locale.nativeLanguageName() + QString(
" - ") + locale.nativeCountryName() + QString(
" (") + langStr + QString(
")"), QVariant(langStr));
122 ui->
lang->addItem(locale.nativeLanguageName() + QString(
" (") + langStr + QString(
")"), QVariant(langStr));
128 mapper =
new QDataWidgetMapper(
this);
129 mapper->setSubmitPolicy(QDataWidgetMapper::ManualSubmit);
130 mapper->setOrientation(Qt::Vertical);
134 mapper->setItemDelegate(delegate);
144 if (!QSystemTrayIcon::isSystemTrayAvailable()) {
153 embedded_font.setWeight(QFont::Bold);
159 system_font.setWeight(QFont::Bold);
180 this->
model = _model;
190 ui->
pruneSize->setRange(nMinDiskSpace, std::numeric_limits<int>::max());
193 if (strLabel.isEmpty())
194 strLabel = tr(
"none");
222 connect(
ui->
thirdPartyTxUrls, &QLineEdit::textChanged, [
this]{ showRestartWarning(); });
227 QWidget *tab_widget =
nullptr;
228 if (tab == OptionsDialog::Tab::TAB_NETWORK) tab_widget =
ui->
tabNetwork;
229 if (tab == OptionsDialog::Tab::TAB_MAIN) tab_widget =
ui->
tabMain;
230 if (tab_widget &&
ui->
tabWidget->currentWidget() != tab_widget) {
267 if (QSystemTrayIcon::isSystemTrayAvailable()) {
292 QString reset_dialog_text = tr(
"Client restart required to activate changes.") +
"<br><br>";
296 reset_dialog_text.append(tr(
"Current settings will be backed up at \"%1\".").arg(
m_client_model->
dataDir()) +
"<br><br>");
299 reset_dialog_text.append(tr(
"Client will be shut down. Do you want to proceed?"));
301 QMessageBox::StandardButton btnRetVal = QMessageBox::question(
this, tr(
"Confirm options reset"),
302 reset_dialog_text, QMessageBox::Yes | QMessageBox::Cancel, QMessageBox::Cancel);
304 if (btnRetVal == QMessageBox::Cancel)
316 QMessageBox config_msgbox(
this);
317 config_msgbox.setIcon(QMessageBox::Information);
319 config_msgbox.setWindowTitle(tr(
"Configuration options"));
322 config_msgbox.setText(tr(
"The configuration file is used to specify advanced user options which override GUI settings. " 323 "Additionally, any command-line options will override this configuration file."));
325 QPushButton* open_button = config_msgbox.addButton(tr(
"Continue"), QMessageBox::ActionRole);
326 config_msgbox.addButton(tr(
"Cancel"), QMessageBox::RejectRole);
327 open_button->setDefault(
true);
329 config_msgbox.exec();
331 if (config_msgbox.clickedButton() != open_button)
return;
335 QMessageBox::critical(
this, tr(
"Error"), tr(
"The configuration file could not be opened."));
352 if (state == Qt::Checked) {
371 ui->
statusLabel->setText(tr(
"Client restart required to activate changes."));
375 ui->
statusLabel->setText(tr(
"This change would require a client restart."));
403 ui->
statusLabel->setText(tr(
"The supplied proxy address is invalid."));
409 const std::optional<CNetAddr> ui_proxy_netaddr{
LookupHost(
ui->
proxyIp->text().toStdString(),
false)};
437 return QValidator::Acceptable;
439 return QValidator::Invalid;
QLabel * systemFont_label_1
QCheckBox * spendZeroConfChange
QCheckBox * proxyReachIPv6
QLabel * embeddedFont_label_9
OptionsDialog(QWidget *parent, bool enableWallet)
Bitcoin unit definitions.
Proxy address widget validator, checks for a valid proxy address.
QSpinBox * threadsScriptVerif
QPushButton * openBitcoinConfButton
Utility functions used by the Bitcoin Qt UI.
void setupUi(QDialog *OptionsDialog)
void setClientModel(ClientModel *client_model)
State validate(QString &input, int &pos) const override
void setOkButtonState(bool fState)
QCheckBox * m_enable_psbt_controls
const QString & getOverriddenByCommandLine()
static const int64_t nMinDbCache
min. -dbcache (MiB)
QFont fixedPitchFont(bool use_embedded_font)
QCheckBox * minimizeToTray
static constexpr uint64_t GB_BYTES
void on_resetButton_clicked()
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.
Line edit that can be marked as "invalid" to show input validation feedback.
State
The various states a (txhash,peer) pair can be in.
constexpr auto dialog_flags
void togglePruneWarning(bool enabled)
bool isRestartRequired() const
interfaces::Node & node() const
void on_openBitcoinConfButton_clicked()
QLabel * embeddedFont_label_1
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.
void handleCloseWindowShortcut(QWidget *w)
A combination of a network address (CNetAddr) and a (TCP) port.
QCheckBox * allowIncoming
void validationDidChange(QValidatedLineEdit *validatedLineEdit)
void setModel(OptionsModel *model)
virtual bool getProxy(Network net, Proxy &proxy_info)=0
Get proxy.
QDataWidgetMapper * mapper
ClientModel * m_client_model
void on_okButton_clicked()
void updateDefaultProxyNets()
QCheckBox * proxyReachIPv4
void setCurrentTab(OptionsDialog::Tab tab)
Model for Bitcoin network client.
QCheckBox * connectSocksTor
static constexpr uint16_t DEFAULT_GUI_PROXY_PORT
QRadioButton * embeddedFont_radioButton
QLabel * overriddenByCommandLineLabel
QLabel * systemFont_label_9
QCheckBox * subFeeFromAmount
QValidatedLineEdit * proxyIpTor
QCheckBox * minimizeOnClose
QLineEdit * thirdPartyTxUrls
QRadioButton * systemFont_radioButton
Interface from Qt to configuration data structure for Bitcoin client.
void on_showTrayIcon_stateChanged(int state)
QSpacerItem * horizontalSpacer_0_Main
QLabel * thirdPartyTxUrlsLabel
QCheckBox * bitcoinAtStartup
QCheckBox * proxyReachTor
static const int64_t nMaxDbCache
max. -dbcache (MiB)
QVBoxLayout * verticalLayout_Main
void showRestartWarning(bool fPersistent=false)
void setCheckValidator(const QValidator *v)
void setEnabled(bool enabled)
void on_cancelButton_clicked()
QValidatedLineEdit * proxyIp
QCheckBox * mapPortNatpmp
void updateProxyValidationState()
static const uint64_t MIN_DISK_SPACE_FOR_BLOCK_FILES
QCheckBox * coinControlFeatures
QLineEdit * externalSignerPath
int GetNumCores()
Return the number of cores available on the current system.
ProxyAddressValidator(QObject *parent)
static const int MAX_SCRIPTCHECK_THREADS
Maximum number of dedicated script-checking threads allowed.