2015-12-13 16:58:29 +00:00
|
|
|
// Copyright (c) 2011-2015 The Bitcoin Core developers
|
2014-12-13 04:09:33 +00:00
|
|
|
// Distributed under the MIT software license, see the accompanying
|
2013-11-04 15:20:43 +00:00
|
|
|
// file COPYING or http://www.opensource.org/licenses/mit-license.php.
|
|
|
|
|
2014-11-03 15:16:40 +00:00
|
|
|
#ifndef BITCOIN_QT_OPTIONSDIALOG_H
|
|
|
|
#define BITCOIN_QT_OPTIONSDIALOG_H
|
2011-05-12 07:40:40 +00:00
|
|
|
|
|
|
|
#include <QDialog>
|
2015-11-16 09:43:36 +00:00
|
|
|
#include <QValidator>
|
2012-06-08 13:21:55 +00:00
|
|
|
|
2013-04-13 05:13:08 +00:00
|
|
|
class OptionsModel;
|
|
|
|
class QValidatedLineEdit;
|
|
|
|
|
2014-10-31 08:36:30 +00:00
|
|
|
QT_BEGIN_NAMESPACE
|
|
|
|
class QDataWidgetMapper;
|
|
|
|
QT_END_NAMESPACE
|
|
|
|
|
2012-06-08 13:21:55 +00:00
|
|
|
namespace Ui {
|
|
|
|
class OptionsDialog;
|
|
|
|
}
|
2011-05-12 07:40:40 +00:00
|
|
|
|
2015-11-16 09:43:36 +00:00
|
|
|
/** 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;
|
|
|
|
};
|
|
|
|
|
2011-11-13 12:19:52 +00:00
|
|
|
/** Preferences dialog. */
|
2011-05-12 07:40:40 +00:00
|
|
|
class OptionsDialog : public QDialog
|
|
|
|
{
|
|
|
|
Q_OBJECT
|
2012-06-08 13:21:55 +00:00
|
|
|
|
2011-05-12 07:40:40 +00:00
|
|
|
public:
|
2014-11-08 18:48:35 +00:00
|
|
|
explicit OptionsDialog(QWidget *parent, bool enableWallet);
|
2012-06-08 13:21:55 +00:00
|
|
|
~OptionsDialog();
|
2011-05-31 20:24:53 +00:00
|
|
|
|
|
|
|
void setModel(OptionsModel *model);
|
2012-06-08 13:21:55 +00:00
|
|
|
void setMapper();
|
2011-05-12 07:40:40 +00:00
|
|
|
|
2015-07-14 11:59:05 +00:00
|
|
|
private Q_SLOTS:
|
2013-12-03 08:10:10 +00:00
|
|
|
/* set OK button state (enabled / disabled) */
|
|
|
|
void setOkButtonState(bool fState);
|
2012-08-18 13:54:39 +00:00
|
|
|
void on_resetButton_clicked();
|
2012-06-08 13:21:55 +00:00
|
|
|
void on_okButton_clicked();
|
|
|
|
void on_cancelButton_clicked();
|
2016-05-12 02:28:02 +00:00
|
|
|
|
|
|
|
void on_hideTrayIcon_stateChanged(int fState);
|
2012-06-08 13:21:55 +00:00
|
|
|
|
2013-12-03 08:10:10 +00:00
|
|
|
void showRestartWarning(bool fPersistent = false);
|
|
|
|
void clearStatusLabel();
|
2015-11-18 13:02:14 +00:00
|
|
|
void updateProxyValidationState();
|
2014-07-25 16:20:40 +00:00
|
|
|
/* query the networks, for which the default proxy is used */
|
|
|
|
void updateDefaultProxyNets();
|
2012-06-08 13:21:55 +00:00
|
|
|
|
2015-07-14 11:59:05 +00:00
|
|
|
Q_SIGNALS:
|
2013-12-03 08:10:10 +00:00
|
|
|
void proxyIpChecks(QValidatedLineEdit *pUiProxyIp, int nProxyPort);
|
2011-11-13 12:19:52 +00:00
|
|
|
|
2011-05-12 12:44:52 +00:00
|
|
|
private:
|
2012-06-08 13:21:55 +00:00
|
|
|
Ui::OptionsDialog *ui;
|
2011-05-31 20:24:53 +00:00
|
|
|
OptionsModel *model;
|
2014-10-23 17:08:10 +00:00
|
|
|
QDataWidgetMapper *mapper;
|
2011-05-12 07:40:40 +00:00
|
|
|
};
|
|
|
|
|
2014-11-03 15:16:40 +00:00
|
|
|
#endif // BITCOIN_QT_OPTIONSDIALOG_H
|