You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

optionsdialog.h 1.7KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071
  1. // Copyright (c) 2011-2016 The Starwels developers
  2. // Distributed under the MIT software license, see the accompanying
  3. // file COPYING or http://www.opensource.org/licenses/mit-license.php.
  4. #ifndef STARWELS_QT_OPTIONSDIALOG_H
  5. #define STARWELS_QT_OPTIONSDIALOG_H
  6. #include <QDialog>
  7. #include <QValidator>
  8. class OptionsModel;
  9. class QValidatedLineEdit;
  10. QT_BEGIN_NAMESPACE
  11. class QDataWidgetMapper;
  12. QT_END_NAMESPACE
  13. namespace Ui {
  14. class OptionsDialog;
  15. }
  16. /** Proxy address widget validator, checks for a valid proxy address.
  17. */
  18. class ProxyAddressValidator : public QValidator
  19. {
  20. Q_OBJECT
  21. public:
  22. explicit ProxyAddressValidator(QObject *parent);
  23. State validate(QString &input, int &pos) const;
  24. };
  25. /** Preferences dialog. */
  26. class OptionsDialog : public QDialog
  27. {
  28. Q_OBJECT
  29. public:
  30. explicit OptionsDialog(QWidget *parent, bool enableWallet);
  31. ~OptionsDialog();
  32. void setModel(OptionsModel *model);
  33. void setMapper();
  34. private Q_SLOTS:
  35. /* set OK button state (enabled / disabled) */
  36. void setOkButtonState(bool fState);
  37. void on_resetButton_clicked();
  38. void on_openStarwelsConfButton_clicked();
  39. void on_okButton_clicked();
  40. void on_cancelButton_clicked();
  41. void on_hideTrayIcon_stateChanged(int fState);
  42. void showRestartWarning(bool fPersistent = false);
  43. void clearStatusLabel();
  44. void updateProxyValidationState();
  45. /* query the networks, for which the default proxy is used */
  46. void updateDefaultProxyNets();
  47. Q_SIGNALS:
  48. void proxyIpChecks(QValidatedLineEdit *pUiProxyIp, int nProxyPort);
  49. private:
  50. Ui::OptionsDialog *ui;
  51. OptionsModel *model;
  52. QDataWidgetMapper *mapper;
  53. };
  54. #endif // STARWELS_QT_OPTIONSDIALOG_H