2a583406c0
6d5fcad576
[gui] Make proxy icon from statusbar clickable (Cristian Mircea Messel)
Pull request description:
Clicking on the proxy icon will open settings showing the network tab
https://github.com/bitcoin/bitcoin/pull/11491#issuecomment-336685303
Tree-SHA512: c3549749296918818694a371326d1a3b1075478918aaee940b5c7119a7e2cb991dcfda78f20d44d6d001157b9b82951f0d5157b17f4f0d1a0a242795efade036
78 lines
1.8 KiB
C++
78 lines
1.8 KiB
C++
// Copyright (c) 2011-2018 The Bitcoin Core developers
|
|
// Distributed under the MIT software license, see the accompanying
|
|
// file COPYING or http://www.opensource.org/licenses/mit-license.php.
|
|
|
|
#ifndef BITCOIN_QT_OPTIONSDIALOG_H
|
|
#define BITCOIN_QT_OPTIONSDIALOG_H
|
|
|
|
#include <QDialog>
|
|
#include <QValidator>
|
|
|
|
class OptionsModel;
|
|
class QValidatedLineEdit;
|
|
|
|
QT_BEGIN_NAMESPACE
|
|
class QDataWidgetMapper;
|
|
QT_END_NAMESPACE
|
|
|
|
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
|
|
{
|
|
Q_OBJECT
|
|
|
|
public:
|
|
explicit OptionsDialog(QWidget *parent, bool enableWallet);
|
|
~OptionsDialog();
|
|
|
|
enum Tab {
|
|
TAB_MAIN,
|
|
TAB_NETWORK,
|
|
};
|
|
|
|
void setModel(OptionsModel *model);
|
|
void setMapper();
|
|
void setCurrentTab(OptionsDialog::Tab tab);
|
|
|
|
private Q_SLOTS:
|
|
/* set OK button state (enabled / disabled) */
|
|
void setOkButtonState(bool fState);
|
|
void on_resetButton_clicked();
|
|
void on_openBitcoinConfButton_clicked();
|
|
void on_okButton_clicked();
|
|
void on_cancelButton_clicked();
|
|
|
|
void on_hideTrayIcon_stateChanged(int fState);
|
|
|
|
void togglePruneWarning(bool enabled);
|
|
void showRestartWarning(bool fPersistent = false);
|
|
void clearStatusLabel();
|
|
void updateProxyValidationState();
|
|
/* query the networks, for which the default proxy is used */
|
|
void updateDefaultProxyNets();
|
|
|
|
Q_SIGNALS:
|
|
void proxyIpChecks(QValidatedLineEdit *pUiProxyIp, int nProxyPort);
|
|
|
|
private:
|
|
Ui::OptionsDialog *ui;
|
|
OptionsModel *model;
|
|
QDataWidgetMapper *mapper;
|
|
};
|
|
|
|
#endif // BITCOIN_QT_OPTIONSDIALOG_H
|