X-Git-Url: https://git.novaco.in/?a=blobdiff_plain;f=src%2Fqt%2Foptionsdialog.h;h=cec9331ebf05a1be4e3f595d854c07d2684101a7;hb=113545bc7462804223563045bcea8071c9daeb9e;hp=d5238a36648d61d09cd455fbc58957fb957e363d;hpb=e285ffcd052a42a6e870f093e7663671a2a3b147;p=novacoin.git diff --git a/src/qt/optionsdialog.h b/src/qt/optionsdialog.h index d5238a3..cec9331 100644 --- a/src/qt/optionsdialog.h +++ b/src/qt/optionsdialog.h @@ -1,50 +1,68 @@ #ifndef OPTIONSDIALOG_H #define OPTIONSDIALOG_H -#include - -QT_BEGIN_NAMESPACE -class QStackedWidget; -class QListWidget; -class QListWidgetItem; -class QPushButton; -QT_END_NAMESPACE +#include + +namespace Ui { +class OptionsDialog; +} class OptionsModel; -class MainOptionsPage; -class DisplayOptionsPage; class MonitoredDataMapper; +class QValidatedLineEdit; -class OptionsDialog : public QDialog +/** Preferences dialog. */ +class OptionsDialog : public QWidget { Q_OBJECT + public: - explicit OptionsDialog(QWidget *parent=0); + explicit OptionsDialog(QWidget *parent = 0); + ~OptionsDialog(); void setModel(OptionsModel *model); + void setMapper(); -signals: - -public slots: - void changePage(int index); +protected: + bool eventFilter(QObject *object, QEvent *event); + void keyPressEvent(QKeyEvent *); private slots: - void okClicked(); - void cancelClicked(); - void applyClicked(); - void enableApply(); - void disableApply(); + /* enable only apply button */ + void enableApplyButton(); + /* disable only apply button */ + void disableApplyButton(); + /* enable apply button and OK button */ + void enableSaveButtons(); + /* disable apply button and OK button */ + void disableSaveButtons(); + /* set apply button and OK button state (enabled / disabled) */ + void setSaveButtonState(bool fState); + void on_okButton_clicked(); + void on_cancelButton_clicked(); + void on_applyButton_clicked(); + + void showRestartWarning_Proxy(); + void showRestartWarning_Tor(); + void showRestartWarning_Lang(); + void showRestartWarning_URL(); + void updateDisplayUnit(); + void handleProxyIpValid(QValidatedLineEdit *object, bool fState); + void handleTorIpValid(QValidatedLineEdit *object, bool fState); + +signals: + void proxyIpValid(QValidatedLineEdit *object, bool fValid); + void torIpValid(QValidatedLineEdit *object, bool fValid); + private: - QListWidget *contents_widget; - QStackedWidget *pages_widget; + Ui::OptionsDialog *ui; OptionsModel *model; MonitoredDataMapper *mapper; - QPushButton *apply_button; - - // Pages - MainOptionsPage *main_page; - DisplayOptionsPage *display_page; - - void setupMainPage(); + bool fRestartWarningDisplayed_Proxy; + bool fRestartWarningDisplayed_Tor; + bool fRestartWarningDisplayed_Lang; + bool fRestartWarningDisplayed_URL; + bool fProxyIpValid; + bool fTorIpValid; }; #endif // OPTIONSDIALOG_H