Improve Tor support
[novacoin.git] / src / qt / optionsdialog.h
1 #ifndef OPTIONSDIALOG_H
2 #define OPTIONSDIALOG_H
3
4 #include <QDialog>
5
6 namespace Ui {
7 class OptionsDialog;
8 }
9 class OptionsModel;
10 class MonitoredDataMapper;
11 class QValidatedLineEdit;
12
13 /** Preferences dialog. */
14 class OptionsDialog : public QDialog
15 {
16     Q_OBJECT
17
18 public:
19     explicit OptionsDialog(QWidget *parent = 0);
20     ~OptionsDialog();
21
22     void setModel(OptionsModel *model);
23     void setMapper();
24
25 protected:
26     bool eventFilter(QObject *object, QEvent *event);
27
28 private slots:
29     /* enable only apply button */
30     void enableApplyButton();
31     /* disable only apply button */
32     void disableApplyButton();
33     /* enable apply button and OK button */
34     void enableSaveButtons();
35     /* disable apply button and OK button */
36     void disableSaveButtons();
37     /* set apply button and OK button state (enabled / disabled) */
38     void setSaveButtonState(bool fState);
39     void on_okButton_clicked();
40     void on_cancelButton_clicked();
41     void on_applyButton_clicked();
42
43     void showRestartWarning_Proxy();
44     void showRestartWarning_Tor();
45     void showRestartWarning_Lang();
46     void showRestartWarning_URL();
47     void updateDisplayUnit();
48     void handleProxyIpValid(QValidatedLineEdit *object, bool fState);
49     void handleTorIpValid(QValidatedLineEdit *object, bool fState);
50
51 signals:
52     void proxyIpValid(QValidatedLineEdit *object, bool fValid);
53     void torIpValid(QValidatedLineEdit *object, bool fValid);
54
55 private:
56     Ui::OptionsDialog *ui;
57     OptionsModel *model;
58     MonitoredDataMapper *mapper;
59     bool fRestartWarningDisplayed_Proxy;
60     bool fRestartWarningDisplayed_Tor;
61     bool fRestartWarningDisplayed_Lang;
62     bool fRestartWarningDisplayed_URL;
63     bool fProxyIpValid;
64     bool fTorIpValid;
65 };
66
67 #endif // OPTIONSDIALOG_H