From d16d1b72d1b5bd7e71c0f03358f13711bccf3dc1 Mon Sep 17 00:00:00 2001 From: Jonas Schnelli Date: Mon, 16 Nov 2015 10:43:36 +0100 Subject: [Qt] refactor and optimize proxy settings behavior --- src/qt/optionsdialog.h | 23 ++++++++++++++--------- 1 file changed, 14 insertions(+), 9 deletions(-) (limited to 'src/qt/optionsdialog.h') diff --git a/src/qt/optionsdialog.h b/src/qt/optionsdialog.h index 348489c599..7d6ca60c80 100644 --- a/src/qt/optionsdialog.h +++ b/src/qt/optionsdialog.h @@ -6,6 +6,7 @@ #define BITCOIN_QT_OPTIONSDIALOG_H #include +#include 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 -- cgit v1.2.3 From 2a8e8c2e3721c8cf560f08873b90265f8ab1a83b Mon Sep 17 00:00:00 2001 From: Jonas Schnelli Date: Wed, 18 Nov 2015 14:02:14 +0100 Subject: [Qt] don't allow to store invalid proxy ports --- src/qt/optionsdialog.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src/qt/optionsdialog.h') diff --git a/src/qt/optionsdialog.h b/src/qt/optionsdialog.h index 7d6ca60c80..489e35da49 100644 --- a/src/qt/optionsdialog.h +++ b/src/qt/optionsdialog.h @@ -52,7 +52,7 @@ private Q_SLOTS: void showRestartWarning(bool fPersistent = false); void clearStatusLabel(); - void updateProxyValidationState(QValidatedLineEdit *pUiProxyIp); + void updateProxyValidationState(); /* query the networks, for which the default proxy is used */ void updateDefaultProxyNets(); -- cgit v1.2.3 From fa24439ff3d8ab5b9efaf66ef4dae6713b88cb35 Mon Sep 17 00:00:00 2001 From: MarcoFalke Date: Sun, 13 Dec 2015 17:58:29 +0100 Subject: Bump copyright headers to 2015 --- src/qt/optionsdialog.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src/qt/optionsdialog.h') diff --git a/src/qt/optionsdialog.h b/src/qt/optionsdialog.h index 489e35da49..e944fb9ee9 100644 --- a/src/qt/optionsdialog.h +++ b/src/qt/optionsdialog.h @@ -1,4 +1,4 @@ -// Copyright (c) 2011-2013 The Bitcoin Core developers +// Copyright (c) 2011-2015 The Bitcoin Core developers // Distributed under the MIT software license, see the accompanying // file COPYING or http://www.opensource.org/licenses/mit-license.php. -- cgit v1.2.3