mirror of
https://github.com/bitcoin/bitcoin.git
synced 2025-11-12 23:18:14 +01:00
[Qt] refactor and optimize proxy settings behavior
This commit is contained in:
@@ -6,6 +6,7 @@
|
||||
#define BITCOIN_QT_OPTIONSDIALOG_H
|
||||
|
||||
#include <QDialog>
|
||||
#include <QValidator>
|
||||
|
||||
class OptionsModel;
|
||||
class QValidatedLineEdit;
|
||||
@@ -18,6 +19,18 @@ namespace Ui {
|
||||
class OptionsDialog;
|
||||
}
|
||||
|
||||
/** Proxy address widget validator, checks for a valid proxy address.
|
||||
*/
|
||||
class ProxyAddressValidator : public QValidator
|
||||
{
|
||||
Q_OBJECT
|
||||
|
||||
public:
|
||||
explicit ProxyAddressValidator(QObject *parent);
|
||||
|
||||
State validate(QString &input, int &pos) const;
|
||||
};
|
||||
|
||||
/** Preferences dialog. */
|
||||
class OptionsDialog : public QDialog
|
||||
{
|
||||
@@ -30,14 +43,7 @@ public:
|
||||
void setModel(OptionsModel *model);
|
||||
void setMapper();
|
||||
|
||||
protected:
|
||||
bool eventFilter(QObject *object, QEvent *event);
|
||||
|
||||
private Q_SLOTS:
|
||||
/* enable OK button */
|
||||
void enableOkButton();
|
||||
/* disable OK button */
|
||||
void disableOkButton();
|
||||
/* set OK button state (enabled / disabled) */
|
||||
void setOkButtonState(bool fState);
|
||||
void on_resetButton_clicked();
|
||||
@@ -46,7 +52,7 @@ private Q_SLOTS:
|
||||
|
||||
void showRestartWarning(bool fPersistent = false);
|
||||
void clearStatusLabel();
|
||||
void doProxyIpChecks(QValidatedLineEdit *pUiProxyIp, int nProxyPort);
|
||||
void updateProxyValidationState(QValidatedLineEdit *pUiProxyIp);
|
||||
/* query the networks, for which the default proxy is used */
|
||||
void updateDefaultProxyNets();
|
||||
|
||||
@@ -57,7 +63,6 @@ private:
|
||||
Ui::OptionsDialog *ui;
|
||||
OptionsModel *model;
|
||||
QDataWidgetMapper *mapper;
|
||||
bool fProxyIpsValid;
|
||||
};
|
||||
|
||||
#endif // BITCOIN_QT_OPTIONSDIALOG_H
|
||||
|
||||
Reference in New Issue
Block a user