2020-12-31 05:48:25 -03:00
|
|
|
// Copyright (c) 2011-2020 The Bitcoin Core developers
|
2014-12-13 01:09:33 -03:00
|
|
|
// Distributed under the MIT software license, see the accompanying
|
2013-11-04 12:20:43 -03:00
|
|
|
// file COPYING or http://www.opensource.org/licenses/mit-license.php.
|
|
|
|
|
2014-11-03 12:16:40 -03:00
|
|
|
#ifndef BITCOIN_QT_OPTIONSDIALOG_H
|
|
|
|
#define BITCOIN_QT_OPTIONSDIALOG_H
|
2011-05-12 03:40:40 -04:00
|
|
|
|
|
|
|
#include <QDialog>
|
2015-11-16 06:43:36 -03:00
|
|
|
#include <QValidator>
|
2012-06-08 09:21:55 -04:00
|
|
|
|
2013-04-13 02:13:08 -03:00
|
|
|
class OptionsModel;
|
|
|
|
class QValidatedLineEdit;
|
|
|
|
|
2014-10-31 05:36:30 -03:00
|
|
|
QT_BEGIN_NAMESPACE
|
|
|
|
class QDataWidgetMapper;
|
|
|
|
QT_END_NAMESPACE
|
|
|
|
|
2012-06-08 09:21:55 -04:00
|
|
|
namespace Ui {
|
|
|
|
class OptionsDialog;
|
|
|
|
}
|
2011-05-12 03:40:40 -04:00
|
|
|
|
2015-11-16 06:43:36 -03:00
|
|
|
/** Proxy address widget validator, checks for a valid proxy address.
|
|
|
|
*/
|
|
|
|
class ProxyAddressValidator : public QValidator
|
|
|
|
{
|
|
|
|
Q_OBJECT
|
|
|
|
|
|
|
|
public:
|
|
|
|
explicit ProxyAddressValidator(QObject *parent);
|
|
|
|
|
2020-03-14 03:49:59 -03:00
|
|
|
State validate(QString &input, int &pos) const override;
|
2015-11-16 06:43:36 -03:00
|
|
|
};
|
|
|
|
|
2011-11-13 09:19:52 -03:00
|
|
|
/** Preferences dialog. */
|
2011-05-12 03:40:40 -04:00
|
|
|
class OptionsDialog : public QDialog
|
|
|
|
{
|
|
|
|
Q_OBJECT
|
2012-06-08 09:21:55 -04:00
|
|
|
|
2011-05-12 03:40:40 -04:00
|
|
|
public:
|
2014-11-08 15:48:35 -03:00
|
|
|
explicit OptionsDialog(QWidget *parent, bool enableWallet);
|
2012-06-08 09:21:55 -04:00
|
|
|
~OptionsDialog();
|
2011-05-31 16:24:53 -04:00
|
|
|
|
2018-05-16 16:05:09 -04:00
|
|
|
enum Tab {
|
|
|
|
TAB_MAIN,
|
|
|
|
TAB_NETWORK,
|
|
|
|
};
|
|
|
|
|
2011-05-31 16:24:53 -04:00
|
|
|
void setModel(OptionsModel *model);
|
2012-06-08 09:21:55 -04:00
|
|
|
void setMapper();
|
2018-05-16 16:05:09 -04:00
|
|
|
void setCurrentTab(OptionsDialog::Tab tab);
|
2011-05-12 03:40:40 -04:00
|
|
|
|
2015-07-14 08:59:05 -03:00
|
|
|
private Q_SLOTS:
|
2013-12-03 05:10:10 -03:00
|
|
|
/* set OK button state (enabled / disabled) */
|
|
|
|
void setOkButtonState(bool fState);
|
2012-08-18 09:54:39 -04:00
|
|
|
void on_resetButton_clicked();
|
2017-02-28 14:13:34 -03:00
|
|
|
void on_openBitcoinConfButton_clicked();
|
2012-06-08 09:21:55 -04:00
|
|
|
void on_okButton_clicked();
|
|
|
|
void on_cancelButton_clicked();
|
2018-07-24 11:59:49 -04:00
|
|
|
|
2020-10-24 18:34:41 -03:00
|
|
|
void on_showTrayIcon_stateChanged(int state);
|
2012-06-08 09:21:55 -04:00
|
|
|
|
2018-05-15 06:46:19 -04:00
|
|
|
void togglePruneWarning(bool enabled);
|
2013-12-03 05:10:10 -03:00
|
|
|
void showRestartWarning(bool fPersistent = false);
|
|
|
|
void clearStatusLabel();
|
2015-11-18 10:02:14 -03:00
|
|
|
void updateProxyValidationState();
|
2014-07-25 12:20:40 -04:00
|
|
|
/* query the networks, for which the default proxy is used */
|
|
|
|
void updateDefaultProxyNets();
|
2012-06-08 09:21:55 -04:00
|
|
|
|
2015-07-14 08:59:05 -03:00
|
|
|
Q_SIGNALS:
|
2021-03-01 17:35:28 -03:00
|
|
|
void proxyIpChecks(QValidatedLineEdit *pUiProxyIp, uint16_t nProxyPort);
|
2011-11-13 09:19:52 -03:00
|
|
|
|
2011-05-12 08:44:52 -04:00
|
|
|
private:
|
2012-06-08 09:21:55 -04:00
|
|
|
Ui::OptionsDialog *ui;
|
2011-05-31 16:24:53 -04:00
|
|
|
OptionsModel *model;
|
2014-10-23 14:08:10 -03:00
|
|
|
QDataWidgetMapper *mapper;
|
2011-05-12 03:40:40 -04:00
|
|
|
};
|
|
|
|
|
2014-11-03 12:16:40 -03:00
|
|
|
#endif // BITCOIN_QT_OPTIONSDIALOG_H
|