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.

optionsmodel.h 1.5KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556
  1. #ifndef OPTIONSMODEL_H
  2. #define OPTIONSMODEL_H
  3. #include <QAbstractListModel>
  4. class CWallet;
  5. /* Interface from QT to configuration data structure for bitcoin client.
  6. To QT, the options are presented as a list with the different options
  7. laid out vertically.
  8. This can be changed to a tree once the settings become sufficiently
  9. complex.
  10. */
  11. class OptionsModel : public QAbstractListModel
  12. {
  13. Q_OBJECT
  14. public:
  15. explicit OptionsModel(CWallet *wallet, QObject *parent = 0);
  16. enum OptionID {
  17. StartAtStartup, // bool
  18. MinimizeToTray, // bool
  19. MapPortUPnP, // bool
  20. MinimizeOnClose, // bool
  21. ConnectSOCKS4, // bool
  22. ProxyIP, // QString
  23. ProxyPort, // QString
  24. Fee, // qint64
  25. DisplayUnit, // BitcoinUnits::Unit
  26. DisplayAddresses, // bool
  27. OptionIDRowCount
  28. };
  29. int rowCount(const QModelIndex & parent = QModelIndex()) const;
  30. QVariant data(const QModelIndex & index, int role = Qt::DisplayRole) const;
  31. bool setData(const QModelIndex & index, const QVariant & value, int role = Qt::EditRole);
  32. /* Explicit getters */
  33. qint64 getTransactionFee();
  34. bool getMinimizeToTray();
  35. bool getMinimizeOnClose();
  36. int getDisplayUnit();
  37. bool getDisplayAddresses();
  38. private:
  39. // Wallet stores persistent options
  40. CWallet *wallet;
  41. int nDisplayUnit;
  42. bool bDisplayAddresses;
  43. signals:
  44. void displayUnitChanged(int unit);
  45. public slots:
  46. };
  47. #endif // OPTIONSMODEL_H