Changeset View
Changeset View
Standalone View
Standalone View
src/qt/optionsmodel.h
// Copyright (c) 2011-2016 The Bitcoin Core developers | // Copyright (c) 2011-2016 The Bitcoin Core developers | ||||
// Distributed under the MIT software license, see the accompanying | // Distributed under the MIT software license, see the accompanying | ||||
// file COPYING or http://www.opensource.org/licenses/mit-license.php. | // file COPYING or http://www.opensource.org/licenses/mit-license.php. | ||||
#ifndef BITCOIN_QT_OPTIONSMODEL_H | #ifndef BITCOIN_QT_OPTIONSMODEL_H | ||||
#define BITCOIN_QT_OPTIONSMODEL_H | #define BITCOIN_QT_OPTIONSMODEL_H | ||||
#include "amount.h" | #include "amount.h" | ||||
#include <QAbstractListModel> | #include <QAbstractListModel> | ||||
namespace interface { | |||||
class Node; | |||||
} | |||||
QT_BEGIN_NAMESPACE | QT_BEGIN_NAMESPACE | ||||
class QNetworkProxy; | class QNetworkProxy; | ||||
QT_END_NAMESPACE | QT_END_NAMESPACE | ||||
extern const char *DEFAULT_GUI_PROXY_HOST; | extern const char *DEFAULT_GUI_PROXY_HOST; | ||||
static constexpr unsigned short DEFAULT_GUI_PROXY_PORT = 9050; | static constexpr unsigned short DEFAULT_GUI_PROXY_PORT = 9050; | ||||
/** Interface from Qt to configuration data structure for Bitcoin client. | /** Interface from Qt to configuration data structure for Bitcoin client. | ||||
To Qt, the options are presented as a list with the different options | To Qt, the options are presented as a list with the different options | ||||
laid out vertically. | laid out vertically. | ||||
This can be changed to a tree once the settings become sufficiently | This can be changed to a tree once the settings become sufficiently | ||||
complex. | complex. | ||||
*/ | */ | ||||
class OptionsModel : public QAbstractListModel { | class OptionsModel : public QAbstractListModel { | ||||
Q_OBJECT | Q_OBJECT | ||||
public: | public: | ||||
explicit OptionsModel(QObject *parent = 0, bool resetSettings = false); | explicit OptionsModel(interface::Node &node, QObject *parent = 0, | ||||
bool resetSettings = false); | |||||
enum OptionID { | enum OptionID { | ||||
StartAtStartup, // bool | StartAtStartup, // bool | ||||
HideTrayIcon, // bool | HideTrayIcon, // bool | ||||
MinimizeToTray, // bool | MinimizeToTray, // bool | ||||
MapPortUPnP, // bool | MapPortUPnP, // bool | ||||
MinimizeOnClose, // bool | MinimizeOnClose, // bool | ||||
ProxyUse, // bool | ProxyUse, // bool | ||||
Show All 36 Lines | public: | ||||
const QString &getOverriddenByCommandLine() { | const QString &getOverriddenByCommandLine() { | ||||
return strOverriddenByCommandLine; | return strOverriddenByCommandLine; | ||||
} | } | ||||
/* Restart flag helper */ | /* Restart flag helper */ | ||||
void setRestartRequired(bool fRequired); | void setRestartRequired(bool fRequired); | ||||
bool isRestartRequired() const; | bool isRestartRequired() const; | ||||
interface::Node &node() const { | |||||
return m_node; | |||||
} | |||||
private: | private: | ||||
interface::Node &m_node; | |||||
/* Qt-only settings */ | /* Qt-only settings */ | ||||
bool fHideTrayIcon; | bool fHideTrayIcon; | ||||
bool fMinimizeToTray; | bool fMinimizeToTray; | ||||
bool fMinimizeOnClose; | bool fMinimizeOnClose; | ||||
QString language; | QString language; | ||||
int nDisplayUnit; | int nDisplayUnit; | ||||
QString strThirdPartyTxUrls; | QString strThirdPartyTxUrls; | ||||
bool fCoinControlFeatures; | bool fCoinControlFeatures; | ||||
Show All 16 Lines |