2011-05-31 20:24:53 +00:00
|
|
|
#ifndef OPTIONSMODEL_H
|
|
|
|
#define OPTIONSMODEL_H
|
|
|
|
|
|
|
|
#include <QAbstractListModel>
|
|
|
|
|
2011-06-26 17:23:24 +00:00
|
|
|
class CWallet;
|
|
|
|
|
2011-11-13 12:19:52 +00:00
|
|
|
/** Interface from QT to configuration data structure for bitcoin client.
|
2011-06-05 12:19:57 +00:00
|
|
|
To QT, the options are presented as a list with the different options
|
|
|
|
laid out vertically.
|
|
|
|
This can be changed to a tree once the settings become sufficiently
|
|
|
|
complex.
|
|
|
|
*/
|
2011-05-31 20:24:53 +00:00
|
|
|
class OptionsModel : public QAbstractListModel
|
|
|
|
{
|
|
|
|
Q_OBJECT
|
|
|
|
public:
|
2011-06-26 17:23:24 +00:00
|
|
|
explicit OptionsModel(CWallet *wallet, QObject *parent = 0);
|
2011-05-31 20:24:53 +00:00
|
|
|
|
|
|
|
enum OptionID {
|
2011-07-26 11:08:34 +00:00
|
|
|
StartAtStartup, // bool
|
|
|
|
MinimizeToTray, // bool
|
|
|
|
MapPortUPnP, // bool
|
|
|
|
MinimizeOnClose, // bool
|
|
|
|
ConnectSOCKS4, // bool
|
|
|
|
ProxyIP, // QString
|
|
|
|
ProxyPort, // QString
|
|
|
|
Fee, // qint64
|
2011-07-29 12:36:35 +00:00
|
|
|
DisplayUnit, // BitcoinUnits::Unit
|
2011-07-30 15:42:02 +00:00
|
|
|
DisplayAddresses, // bool
|
2011-05-31 20:24:53 +00:00
|
|
|
OptionIDRowCount
|
|
|
|
};
|
|
|
|
|
|
|
|
int rowCount(const QModelIndex & parent = QModelIndex()) const;
|
|
|
|
QVariant data(const QModelIndex & index, int role = Qt::DisplayRole) const;
|
|
|
|
bool setData(const QModelIndex & index, const QVariant & value, int role = Qt::EditRole);
|
|
|
|
|
2011-06-01 07:34:12 +00:00
|
|
|
/* Explicit getters */
|
|
|
|
qint64 getTransactionFee();
|
2011-06-01 12:40:06 +00:00
|
|
|
bool getMinimizeToTray();
|
|
|
|
bool getMinimizeOnClose();
|
2011-07-29 12:36:35 +00:00
|
|
|
int getDisplayUnit();
|
2011-07-30 15:42:02 +00:00
|
|
|
bool getDisplayAddresses();
|
2011-06-26 17:23:24 +00:00
|
|
|
private:
|
|
|
|
// Wallet stores persistent options
|
|
|
|
CWallet *wallet;
|
2011-07-29 12:36:35 +00:00
|
|
|
int nDisplayUnit;
|
2011-07-30 15:42:02 +00:00
|
|
|
bool bDisplayAddresses;
|
2011-05-31 20:24:53 +00:00
|
|
|
signals:
|
2011-07-29 12:36:35 +00:00
|
|
|
void displayUnitChanged(int unit);
|
2011-05-31 20:24:53 +00:00
|
|
|
|
|
|
|
public slots:
|
|
|
|
|
|
|
|
};
|
|
|
|
|
|
|
|
#endif // OPTIONSMODEL_H
|