Make lsn_reset ("detach databases") optional and off by default.
[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         DetachDatabases, // bool
30         OptionIDRowCount,
31     };
32
33     void Init();
34
35     /* Migrate settings from wallet.dat after app initialization */
36     bool Upgrade(); /* returns true if settings upgraded */
37
38     int rowCount(const QModelIndex & parent = QModelIndex()) const;
39     QVariant data(const QModelIndex & index, int role = Qt::DisplayRole) const;
40     bool setData(const QModelIndex & index, const QVariant & value, int role = Qt::EditRole);
41
42     /* Explicit getters */
43     qint64 getTransactionFee();
44     bool getMinimizeToTray();
45     bool getMinimizeOnClose();
46     int getDisplayUnit();
47     bool getDisplayAddresses();
48 private:
49     int nDisplayUnit;
50     bool bDisplayAddresses;
51     bool fMinimizeToTray;
52     bool fMinimizeOnClose;
53 signals:
54     void displayUnitChanged(int unit);
55
56 public slots:
57
58 };
59
60 #endif // OPTIONSMODEL_H