5d75e061e16b4965331c9880f73fe5f03333d1e2
[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_Lang();
45     void showRestartWarning_URL();
46     void updateDisplayUnit();
47     void handleProxyIpValid(QValidatedLineEdit *object, bool fState);
48
49 signals:
50     void proxyIpValid(QValidatedLineEdit *object, bool fValid);
51
52 private:
53     Ui::OptionsDialog *ui;
54     OptionsModel *model;
55     MonitoredDataMapper *mapper;
56     bool fRestartWarningDisplayed_Proxy;
57     bool fRestartWarningDisplayed_Lang;
58     bool fRestartWarningDisplayed_URL;
59     bool fProxyIpValid;
60 };
61
62 #endif // OPTIONSDIALOG_H