optionsdialog.h 1.5 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162
  1. // ECOin - Copyright (c) - 2014/2021 - GPLv3 - epsylon@riseup.net (https://03c8.net)
  2. #ifndef OPTIONSDIALOG_H
  3. #define OPTIONSDIALOG_H
  4. #include <QDialog>
  5. namespace Ui {
  6. class OptionsDialog;
  7. }
  8. class OptionsModel;
  9. class MonitoredDataMapper;
  10. class QValidatedLineEdit;
  11. /** Preferences dialog. */
  12. class OptionsDialog : public QDialog
  13. {
  14. Q_OBJECT
  15. public:
  16. explicit OptionsDialog(QWidget *parent = 0);
  17. ~OptionsDialog();
  18. void setModel(OptionsModel *model);
  19. void setMapper();
  20. protected:
  21. bool eventFilter(QObject *object, QEvent *event);
  22. private slots:
  23. /* enable only apply button */
  24. void enableApplyButton();
  25. /* disable only apply button */
  26. void disableApplyButton();
  27. /* enable apply button and OK button */
  28. void enableSaveButtons();
  29. /* disable apply button and OK button */
  30. void disableSaveButtons();
  31. /* set apply button and OK button state (enabled / disabled) */
  32. void setSaveButtonState(bool fState);
  33. void on_okButton_clicked();
  34. void on_cancelButton_clicked();
  35. void on_applyButton_clicked();
  36. void showRestartWarning_Proxy();
  37. void showRestartWarning_Lang();
  38. void updateDisplayUnit();
  39. void handleProxyIpValid(QValidatedLineEdit *object, bool fState);
  40. signals:
  41. void proxyIpValid(QValidatedLineEdit *object, bool fValid);
  42. private:
  43. Ui::OptionsDialog *ui;
  44. OptionsModel *model;
  45. MonitoredDataMapper *mapper;
  46. bool fRestartWarningDisplayed_Proxy;
  47. bool fRestartWarningDisplayed_Lang;
  48. bool fProxyIpValid;
  49. };
  50. #endif // OPTIONSDIALOG_H