Окно опций теперь QWidget
[novacoin.git] / src / qt / optionsdialog.h
1 #ifndef OPTIONSDIALOG_H
2 #define OPTIONSDIALOG_H
3
4 #include <QWidget>
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 QWidget
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     void keyPressEvent(QKeyEvent *);
28
29 private slots:
30     /* enable only apply button */
31     void enableApplyButton();
32     /* disable only apply button */
33     void disableApplyButton();
34     /* enable apply button and OK button */
35     void enableSaveButtons();
36     /* disable apply button and OK button */
37     void disableSaveButtons();
38     /* set apply button and OK button state (enabled / disabled) */
39     void setSaveButtonState(bool fState);
40     void on_okButton_clicked();
41     void on_cancelButton_clicked();
42     void on_applyButton_clicked();
43
44     void showRestartWarning_Proxy();
45     void showRestartWarning_Tor();
46     void showRestartWarning_Lang();
47     void showRestartWarning_URL();
48     void updateDisplayUnit();
49     void handleProxyIpValid(QValidatedLineEdit *object, bool fState);
50     void handleTorIpValid(QValidatedLineEdit *object, bool fState);
51
52 signals:
53     void proxyIpValid(QValidatedLineEdit *object, bool fValid);
54     void torIpValid(QValidatedLineEdit *object, bool fValid);
55
56 private:
57     Ui::OptionsDialog *ui;
58     OptionsModel *model;
59     MonitoredDataMapper *mapper;
60     bool fRestartWarningDisplayed_Proxy;
61     bool fRestartWarningDisplayed_Tor;
62     bool fRestartWarningDisplayed_Lang;
63     bool fRestartWarningDisplayed_URL;
64     bool fProxyIpValid;
65     bool fTorIpValid;
66 };
67
68 #endif // OPTIONSDIALOG_H