Bugfix: Replace "URL" with "URI" where we aren't actually working with URLs
[novacoin.git] / src / qt / optionsmodel.h
1 #ifndef OPTIONSMODEL_H
2 #define OPTIONSMODEL_H
3
4 #include <QAbstractListModel>
5
6 /** Interface from QT to configuration data structure for bitcoin client.
7    To QT, the options are presented as a list with the different options
8    laid out vertically.
9    This can be changed to a tree once the settings become sufficiently
10    complex.
11  */
12 class OptionsModel : public QAbstractListModel
13 {
14     Q_OBJECT
15 public:
16     explicit OptionsModel(QObject *parent = 0);
17
18     enum OptionID {
19         StartAtStartup, // bool
20         MinimizeToTray, // bool
21         MapPortUPnP, // bool
22         MinimizeOnClose, // bool
23         ConnectSOCKS4, // bool
24         ProxyIP, // QString
25         ProxyPort, // QString
26         Fee, // qint64
27         DisplayUnit, // BitcoinUnits::Unit
28         DisplayAddresses, // bool
29         OptionIDRowCount
30     };
31
32     void Init();
33
34     /* Migrate settings from wallet.dat after app initialization */
35     bool Upgrade(); /* returns true if settings upgraded */
36
37     int rowCount(const QModelIndex & parent = QModelIndex()) const;
38     QVariant data(const QModelIndex & index, int role = Qt::DisplayRole) const;
39     bool setData(const QModelIndex & index, const QVariant & value, int role = Qt::EditRole);
40
41     /* Explicit getters */
42     qint64 getTransactionFee();
43     bool getMinimizeToTray();
44     bool getMinimizeOnClose();
45     int getDisplayUnit();
46     bool getDisplayAddresses();
47 private:
48     int nDisplayUnit;
49     bool bDisplayAddresses;
50     bool fMinimizeToTray;
51     bool fMinimizeOnClose;
52 signals:
53     void displayUnitChanged(int unit);
54
55 public slots:
56
57 };
58
59 #endif // OPTIONSMODEL_H