Bitcoin Core  24.99.0
P2P Digital Currency
optionsdialog.h
Go to the documentation of this file.
1 // Copyright (c) 2011-2021 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 #ifndef BITCOIN_QT_OPTIONSDIALOG_H
6 #define BITCOIN_QT_OPTIONSDIALOG_H
7 
8 #include <QDialog>
9 #include <QValidator>
10 
11 class ClientModel;
12 class OptionsModel;
13 class QValidatedLineEdit;
14 
15 QT_BEGIN_NAMESPACE
16 class QDataWidgetMapper;
17 QT_END_NAMESPACE
18 
19 namespace Ui {
20 class OptionsDialog;
21 }
22 
25 class ProxyAddressValidator : public QValidator
26 {
27  Q_OBJECT
28 
29 public:
30  explicit ProxyAddressValidator(QObject *parent);
31 
32  State validate(QString &input, int &pos) const override;
33 };
34 
36 class OptionsDialog : public QDialog
37 {
38  Q_OBJECT
39 
40 public:
41  explicit OptionsDialog(QWidget *parent, bool enableWallet);
43 
44  enum Tab {
47  };
48 
49  void setClientModel(ClientModel* client_model);
51  void setMapper();
53 
54 private Q_SLOTS:
55  /* set OK button state (enabled / disabled) */
56  void setOkButtonState(bool fState);
59  void on_okButton_clicked();
61 
62  void on_showTrayIcon_stateChanged(int state);
63 
64  void togglePruneWarning(bool enabled);
65  void showRestartWarning(bool fPersistent = false);
66  void clearStatusLabel();
68  /* query the networks, for which the default proxy is used */
70 
71 Q_SIGNALS:
72  void proxyIpChecks(QValidatedLineEdit *pUiProxyIp, uint16_t nProxyPort);
73  void quitOnReset();
74 
75 private:
76  Ui::OptionsDialog *ui;
79  QDataWidgetMapper *mapper;
80 };
81 
82 #endif // BITCOIN_QT_OPTIONSDIALOG_H
Model for Bitcoin network client.
Definition: clientmodel.h:55
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 proxyIpChecks(QValidatedLineEdit *pUiProxyIp, uint16_t nProxyPort)
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:41
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
Line edit that can be marked as "invalid" to show input validation feedback.