Master Core  v0.0.9 - 2abfd2849db8ba7a83957c64eb976b406713c123
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
optionsmodel.h
Go to the documentation of this file.
1 // Copyright (c) 2011-2013 The Bitcoin developers
2 // Distributed under the MIT/X11 software license, see the accompanying
3 // file COPYING or http://www.opensource.org/licenses/mit-license.php.
4 
5 #ifndef OPTIONSMODEL_H
6 #define OPTIONSMODEL_H
7 
8 #include <QAbstractListModel>
9 
10 QT_BEGIN_NAMESPACE
11 class QNetworkProxy;
12 QT_END_NAMESPACE
13 
21 {
22  Q_OBJECT
23 
24 public:
25  explicit OptionsModel(QObject *parent = 0);
26 
27  enum OptionID {
28  StartAtStartup, // bool
29  MinimizeToTray, // bool
30  MapPortUPnP, // bool
31  MinimizeOnClose, // bool
32  ProxyUse, // bool
33  ProxyIP, // QString
34  ProxyPort, // int
36  Fee, // qint64
37  DisplayUnit, // BitcoinUnits::Unit
39  ThirdPartyTxUrls, // QString
40  Language, // QString
43  DatabaseCache, // int
46  };
47 
48  void Init();
49  void Reset();
50 
51  int rowCount(const QModelIndex & parent = QModelIndex()) const;
52  QVariant data(const QModelIndex & index, int role = Qt::DisplayRole) const;
53  bool setData(const QModelIndex & index, const QVariant & value, int role = Qt::EditRole);
54 
55  /* Explicit getters */
58  int getDisplayUnit() { return nDisplayUnit; }
61  bool getProxySettings(QNetworkProxy& proxy) const;
64 
65  /* Restart flag helper */
66  void setRestartRequired(bool fRequired);
67  bool isRestartRequired();
68 
69 private:
70  /* Qt-only settings */
73  QString language;
78  /* settings that were overriden by command-line */
80 
82  void addOverriddenOption(const std::string &option);
83 
84 signals:
85  void displayUnitChanged(int unit);
86  void transactionFeeChanged(qint64);
87  void coinControlFeaturesChanged(bool);
88 };
89 
90 #endif // OPTIONSMODEL_H
bool getMinimizeOnClose()
Definition: optionsmodel.h:57
bool setData(const QModelIndex &index, const QVariant &value, int role=Qt::EditRole)
void addOverriddenOption(const std::string &option)
Add option to list of GUI options overridden through command line/config file.
void transactionFeeChanged(qint64)
const QString & getOverriddenByCommandLine()
Definition: optionsmodel.h:63
QString language
Definition: optionsmodel.h:73
bool bDisplayAddresses
Definition: optionsmodel.h:75
void coinControlFeaturesChanged(bool)
OptionsModel(QObject *parent=0)
bool fMinimizeOnClose
Definition: optionsmodel.h:72
bool getCoinControlFeatures()
Definition: optionsmodel.h:62
int rowCount(const QModelIndex &parent=QModelIndex()) const
bool getProxySettings(QNetworkProxy &proxy) const
bool fMinimizeToTray
Definition: optionsmodel.h:71
int getDisplayUnit()
Definition: optionsmodel.h:58
void displayUnitChanged(int unit)
bool getDisplayAddresses()
Definition: optionsmodel.h:59
bool fCoinControlFeatures
Definition: optionsmodel.h:77
void setRestartRequired(bool fRequired)
Interface from Qt to configuration data structure for Bitcoin client.
Definition: optionsmodel.h:20
QString strThirdPartyTxUrls
Definition: optionsmodel.h:76
bool isRestartRequired()
bool getMinimizeToTray()
Definition: optionsmodel.h:56
QVariant data(const QModelIndex &index, int role=Qt::DisplayRole) const
QString strOverriddenByCommandLine
Definition: optionsmodel.h:79
QString getThirdPartyTxUrls()
Definition: optionsmodel.h:60