mirror of
https://github.com/jwinterm/myriadcoin.git
synced 2026-12-03 12:34:12 +01:00
0.9.2
This commit is contained in:
+259
-167
@@ -1,11 +1,28 @@
|
||||
// Copyright (c) 2011-2014 The Bitcoin developers
|
||||
// Distributed under the MIT/X11 software license, see the accompanying
|
||||
// file COPYING or http://www.opensource.org/licenses/mit-license.php.
|
||||
|
||||
#if defined(HAVE_CONFIG_H)
|
||||
#include "bitcoin-config.h"
|
||||
#endif
|
||||
|
||||
#include "optionsmodel.h"
|
||||
|
||||
#include "bitcoinunits.h"
|
||||
#include "init.h"
|
||||
#include "walletdb.h"
|
||||
#include "guiutil.h"
|
||||
|
||||
#include "init.h"
|
||||
#include "main.h"
|
||||
#include "net.h"
|
||||
#include "txdb.h" // for -dbcache defaults
|
||||
#ifdef ENABLE_WALLET
|
||||
#include "wallet.h"
|
||||
#include "walletdb.h"
|
||||
#endif
|
||||
|
||||
#include <QNetworkProxy>
|
||||
#include <QSettings>
|
||||
#include <QStringList>
|
||||
|
||||
OptionsModel::OptionsModel(QObject *parent) :
|
||||
QAbstractListModel(parent)
|
||||
@@ -13,137 +30,130 @@ OptionsModel::OptionsModel(QObject *parent) :
|
||||
Init();
|
||||
}
|
||||
|
||||
bool static ApplyProxySettings()
|
||||
void OptionsModel::addOverriddenOption(const std::string &option)
|
||||
{
|
||||
QSettings settings;
|
||||
CService addrProxy(settings.value("addrProxy", "127.0.0.1:9050").toString().toStdString());
|
||||
int nSocksVersion(settings.value("nSocksVersion", 5).toInt());
|
||||
if (!settings.value("fUseProxy", false).toBool()) {
|
||||
addrProxy = CService();
|
||||
nSocksVersion = 0;
|
||||
return false;
|
||||
}
|
||||
if (nSocksVersion && !addrProxy.IsValid())
|
||||
return false;
|
||||
if (!IsLimited(NET_IPV4))
|
||||
SetProxy(NET_IPV4, addrProxy, nSocksVersion);
|
||||
if (nSocksVersion > 4) {
|
||||
#ifdef USE_IPV6
|
||||
if (!IsLimited(NET_IPV6))
|
||||
SetProxy(NET_IPV6, addrProxy, nSocksVersion);
|
||||
#endif
|
||||
SetNameProxy(addrProxy, nSocksVersion);
|
||||
}
|
||||
return true;
|
||||
strOverriddenByCommandLine += QString::fromStdString(option) + "=" + QString::fromStdString(mapArgs[option]) + " ";
|
||||
}
|
||||
|
||||
// Writes all missing QSettings with their default values
|
||||
void OptionsModel::Init()
|
||||
{
|
||||
QSettings settings;
|
||||
|
||||
// These are Qt-only settings:
|
||||
nDisplayUnit = settings.value("nDisplayUnit", BitcoinUnits::BTC).toInt();
|
||||
bDisplayAddresses = settings.value("bDisplayAddresses", false).toBool();
|
||||
fMinimizeToTray = settings.value("fMinimizeToTray", false).toBool();
|
||||
fMinimizeOnClose = settings.value("fMinimizeOnClose", false).toBool();
|
||||
nTransactionFee = settings.value("nTransactionFee").toLongLong();
|
||||
language = settings.value("language", "").toString();
|
||||
// Ensure restart flag is unset on client startup
|
||||
setRestartRequired(false);
|
||||
|
||||
// These are shared with core Bitcoin; we want
|
||||
// command-line options to override the GUI settings:
|
||||
if (settings.contains("fUseUPnP"))
|
||||
SoftSetBoolArg("-upnp", settings.value("fUseUPnP").toBool());
|
||||
if (settings.contains("addrProxy") && settings.value("fUseProxy").toBool())
|
||||
SoftSetArg("-proxy", settings.value("addrProxy").toString().toStdString());
|
||||
if (settings.contains("nSocksVersion") && settings.value("fUseProxy").toBool())
|
||||
SoftSetArg("-socks", settings.value("nSocksVersion").toString().toStdString());
|
||||
if (!language.isEmpty())
|
||||
SoftSetArg("-lang", language.toStdString());
|
||||
// These are Qt-only settings:
|
||||
|
||||
// Window
|
||||
if (!settings.contains("fMinimizeToTray"))
|
||||
settings.setValue("fMinimizeToTray", false);
|
||||
fMinimizeToTray = settings.value("fMinimizeToTray").toBool();
|
||||
|
||||
if (!settings.contains("fMinimizeOnClose"))
|
||||
settings.setValue("fMinimizeOnClose", false);
|
||||
fMinimizeOnClose = settings.value("fMinimizeOnClose").toBool();
|
||||
|
||||
// Display
|
||||
if (!settings.contains("nDisplayUnit"))
|
||||
settings.setValue("nDisplayUnit", BitcoinUnits::BTC);
|
||||
nDisplayUnit = settings.value("nDisplayUnit").toInt();
|
||||
|
||||
if (!settings.contains("bDisplayAddresses"))
|
||||
settings.setValue("bDisplayAddresses", false);
|
||||
bDisplayAddresses = settings.value("bDisplayAddresses", false).toBool();
|
||||
|
||||
if (!settings.contains("strThirdPartyTxUrls"))
|
||||
settings.setValue("strThirdPartyTxUrls", "");
|
||||
strThirdPartyTxUrls = settings.value("strThirdPartyTxUrls", "").toString();
|
||||
|
||||
if (!settings.contains("fCoinControlFeatures"))
|
||||
settings.setValue("fCoinControlFeatures", false);
|
||||
fCoinControlFeatures = settings.value("fCoinControlFeatures", false).toBool();
|
||||
|
||||
// These are shared with the core or have a command-line parameter
|
||||
// and we want command-line parameters to overwrite the GUI settings.
|
||||
//
|
||||
// If setting doesn't exist create it with defaults.
|
||||
//
|
||||
// If SoftSetArg() or SoftSetBoolArg() return false we were overridden
|
||||
// by command-line and show this in the UI.
|
||||
|
||||
// Main
|
||||
if (!settings.contains("nDatabaseCache"))
|
||||
settings.setValue("nDatabaseCache", (qint64)nDefaultDbCache);
|
||||
if (!SoftSetArg("-dbcache", settings.value("nDatabaseCache").toString().toStdString()))
|
||||
addOverriddenOption("-dbcache");
|
||||
|
||||
if (!settings.contains("nThreadsScriptVerif"))
|
||||
settings.setValue("nThreadsScriptVerif", DEFAULT_SCRIPTCHECK_THREADS);
|
||||
if (!SoftSetArg("-par", settings.value("nThreadsScriptVerif").toString().toStdString()))
|
||||
addOverriddenOption("-par");
|
||||
|
||||
// Wallet
|
||||
#ifdef ENABLE_WALLET
|
||||
if (!settings.contains("nTransactionFee"))
|
||||
settings.setValue("nTransactionFee", (qint64)DEFAULT_TRANSACTION_FEE);
|
||||
nTransactionFee = settings.value("nTransactionFee").toLongLong(); // if -paytxfee is set, this will be overridden later in init.cpp
|
||||
if (mapArgs.count("-paytxfee"))
|
||||
addOverriddenOption("-paytxfee");
|
||||
|
||||
if (!settings.contains("bSpendZeroConfChange"))
|
||||
settings.setValue("bSpendZeroConfChange", true);
|
||||
if (!SoftSetBoolArg("-spendzeroconfchange", settings.value("bSpendZeroConfChange").toBool()))
|
||||
addOverriddenOption("-spendzeroconfchange");
|
||||
#endif
|
||||
|
||||
// Network
|
||||
if (!settings.contains("fUseUPnP"))
|
||||
#ifdef USE_UPNP
|
||||
settings.setValue("fUseUPnP", true);
|
||||
#else
|
||||
settings.setValue("fUseUPnP", false);
|
||||
#endif
|
||||
if (!SoftSetBoolArg("-upnp", settings.value("fUseUPnP").toBool()))
|
||||
addOverriddenOption("-upnp");
|
||||
|
||||
if (!settings.contains("fUseProxy"))
|
||||
settings.setValue("fUseProxy", false);
|
||||
if (!settings.contains("addrProxy"))
|
||||
settings.setValue("addrProxy", "127.0.0.1:9050");
|
||||
// Only try to set -proxy, if user has enabled fUseProxy
|
||||
if (settings.value("fUseProxy").toBool() && !SoftSetArg("-proxy", settings.value("addrProxy").toString().toStdString()))
|
||||
addOverriddenOption("-proxy");
|
||||
if (!settings.contains("nSocksVersion"))
|
||||
settings.setValue("nSocksVersion", 5);
|
||||
// Only try to set -socks, if user has enabled fUseProxy
|
||||
if (settings.value("fUseProxy").toBool() && !SoftSetArg("-socks", settings.value("nSocksVersion").toString().toStdString()))
|
||||
addOverriddenOption("-socks");
|
||||
|
||||
// Display
|
||||
if (!settings.contains("language"))
|
||||
settings.setValue("language", "");
|
||||
if (!SoftSetArg("-lang", settings.value("language").toString().toStdString()))
|
||||
addOverriddenOption("-lang");
|
||||
|
||||
language = settings.value("language").toString();
|
||||
}
|
||||
|
||||
void OptionsModel::Reset()
|
||||
{
|
||||
QSettings settings;
|
||||
|
||||
// Remove all entries in this QSettings object
|
||||
// Remove all entries from our QSettings object
|
||||
settings.clear();
|
||||
|
||||
// default setting for OptionsModel::StartAtStartup - disabled
|
||||
if (GUIUtil::GetStartOnSystemStartup())
|
||||
GUIUtil::SetStartOnSystemStartup(false);
|
||||
|
||||
// Re-Init to get default values
|
||||
Init();
|
||||
|
||||
// Ensure Upgrade() is not running again by setting the bImportFinished flag
|
||||
settings.setValue("bImportFinished", true);
|
||||
}
|
||||
|
||||
bool OptionsModel::Upgrade()
|
||||
{
|
||||
QSettings settings;
|
||||
|
||||
if (settings.contains("bImportFinished"))
|
||||
return false; // Already upgraded
|
||||
|
||||
settings.setValue("bImportFinished", true);
|
||||
|
||||
// Move settings from old wallet.dat (if any):
|
||||
CWalletDB walletdb(strWalletFile);
|
||||
|
||||
QList<QString> intOptions;
|
||||
intOptions << "nDisplayUnit" << "nTransactionFee";
|
||||
foreach(QString key, intOptions)
|
||||
{
|
||||
int value = 0;
|
||||
if (walletdb.ReadSetting(key.toStdString(), value))
|
||||
{
|
||||
settings.setValue(key, value);
|
||||
walletdb.EraseSetting(key.toStdString());
|
||||
}
|
||||
}
|
||||
QList<QString> boolOptions;
|
||||
boolOptions << "bDisplayAddresses" << "fMinimizeToTray" << "fMinimizeOnClose" << "fUseProxy" << "fUseUPnP";
|
||||
foreach(QString key, boolOptions)
|
||||
{
|
||||
bool value = false;
|
||||
if (walletdb.ReadSetting(key.toStdString(), value))
|
||||
{
|
||||
settings.setValue(key, value);
|
||||
walletdb.EraseSetting(key.toStdString());
|
||||
}
|
||||
}
|
||||
try
|
||||
{
|
||||
CAddress addrProxyAddress;
|
||||
if (walletdb.ReadSetting("addrProxy", addrProxyAddress))
|
||||
{
|
||||
settings.setValue("addrProxy", addrProxyAddress.ToStringIPPort().c_str());
|
||||
walletdb.EraseSetting("addrProxy");
|
||||
}
|
||||
}
|
||||
catch (std::ios_base::failure &e)
|
||||
{
|
||||
// 0.6.0rc1 saved this as a CService, which causes failure when parsing as a CAddress
|
||||
CService addrProxy;
|
||||
if (walletdb.ReadSetting("addrProxy", addrProxy))
|
||||
{
|
||||
settings.setValue("addrProxy", addrProxy.ToStringIPPort().c_str());
|
||||
walletdb.EraseSetting("addrProxy");
|
||||
}
|
||||
}
|
||||
ApplyProxySettings();
|
||||
Init();
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
int OptionsModel::rowCount(const QModelIndex & parent) const
|
||||
{
|
||||
return OptionIDRowCount;
|
||||
}
|
||||
|
||||
// read QSettings values and return them
|
||||
QVariant OptionsModel::data(const QModelIndex & index, int role) const
|
||||
{
|
||||
if(role == Qt::EditRole)
|
||||
@@ -152,50 +162,61 @@ QVariant OptionsModel::data(const QModelIndex & index, int role) const
|
||||
switch(index.row())
|
||||
{
|
||||
case StartAtStartup:
|
||||
return QVariant(GUIUtil::GetStartOnSystemStartup());
|
||||
return GUIUtil::GetStartOnSystemStartup();
|
||||
case MinimizeToTray:
|
||||
return QVariant(fMinimizeToTray);
|
||||
return fMinimizeToTray;
|
||||
case MapPortUPnP:
|
||||
#ifdef USE_UPNP
|
||||
return settings.value("fUseUPnP", GetBoolArg("-upnp", true));
|
||||
return settings.value("fUseUPnP");
|
||||
#else
|
||||
return QVariant(false);
|
||||
return false;
|
||||
#endif
|
||||
case MinimizeOnClose:
|
||||
return QVariant(fMinimizeOnClose);
|
||||
case ProxyUse: {
|
||||
proxyType proxy;
|
||||
return QVariant(GetProxy(NET_IPV4, proxy));
|
||||
}
|
||||
return fMinimizeOnClose;
|
||||
|
||||
// default proxy
|
||||
case ProxyUse:
|
||||
return settings.value("fUseProxy", false);
|
||||
case ProxyIP: {
|
||||
proxyType proxy;
|
||||
if (GetProxy(NET_IPV4, proxy))
|
||||
return QVariant(QString::fromStdString(proxy.first.ToStringIP()));
|
||||
else
|
||||
return QVariant(QString::fromStdString("127.0.0.1"));
|
||||
// contains IP at index 0 and port at index 1
|
||||
QStringList strlIpPort = settings.value("addrProxy").toString().split(":", QString::SkipEmptyParts);
|
||||
return strlIpPort.at(0);
|
||||
}
|
||||
case ProxyPort: {
|
||||
proxyType proxy;
|
||||
if (GetProxy(NET_IPV4, proxy))
|
||||
return QVariant(proxy.first.GetPort());
|
||||
else
|
||||
return QVariant(9050);
|
||||
}
|
||||
case ProxySocksVersion: {
|
||||
proxyType proxy;
|
||||
if (GetProxy(NET_IPV4, proxy))
|
||||
return QVariant(proxy.second);
|
||||
else
|
||||
return QVariant(5);
|
||||
// contains IP at index 0 and port at index 1
|
||||
QStringList strlIpPort = settings.value("addrProxy").toString().split(":", QString::SkipEmptyParts);
|
||||
return strlIpPort.at(1);
|
||||
}
|
||||
case ProxySocksVersion:
|
||||
return settings.value("nSocksVersion", 5);
|
||||
|
||||
#ifdef ENABLE_WALLET
|
||||
case Fee:
|
||||
return QVariant(nTransactionFee);
|
||||
// Attention: Init() is called before nTransactionFee is set in AppInit2()!
|
||||
// To ensure we can change the fee on-the-fly update our QSetting when
|
||||
// opening OptionsDialog, which queries Fee via the mapper.
|
||||
if (nTransactionFee != settings.value("nTransactionFee").toLongLong())
|
||||
settings.setValue("nTransactionFee", (qint64)nTransactionFee);
|
||||
// Todo: Consider to revert back to use just nTransactionFee here, if we don't want
|
||||
// -paytxfee to update our QSettings!
|
||||
return settings.value("nTransactionFee");
|
||||
case SpendZeroConfChange:
|
||||
return settings.value("bSpendZeroConfChange");
|
||||
#endif
|
||||
case DisplayUnit:
|
||||
return QVariant(nDisplayUnit);
|
||||
return nDisplayUnit;
|
||||
case DisplayAddresses:
|
||||
return QVariant(bDisplayAddresses);
|
||||
return bDisplayAddresses;
|
||||
case ThirdPartyTxUrls:
|
||||
return strThirdPartyTxUrls;
|
||||
case Language:
|
||||
return settings.value("language", "");
|
||||
return settings.value("language");
|
||||
case CoinControlFeatures:
|
||||
return fCoinControlFeatures;
|
||||
case DatabaseCache:
|
||||
return settings.value("nDatabaseCache");
|
||||
case ThreadsScriptVerif:
|
||||
return settings.value("nThreadsScriptVerif");
|
||||
default:
|
||||
return QVariant();
|
||||
}
|
||||
@@ -203,6 +224,7 @@ QVariant OptionsModel::data(const QModelIndex & index, int role) const
|
||||
return QVariant();
|
||||
}
|
||||
|
||||
// write QSettings values
|
||||
bool OptionsModel::setData(const QModelIndex & index, const QVariant & value, int role)
|
||||
{
|
||||
bool successful = true; /* set to false on parse error */
|
||||
@@ -218,7 +240,7 @@ bool OptionsModel::setData(const QModelIndex & index, const QVariant & value, in
|
||||
fMinimizeToTray = value.toBool();
|
||||
settings.setValue("fMinimizeToTray", fMinimizeToTray);
|
||||
break;
|
||||
case MapPortUPnP:
|
||||
case MapPortUPnP: // core option - can be changed on-the-fly
|
||||
settings.setValue("fUseUPnP", value.toBool());
|
||||
MapPort(value.toBool());
|
||||
break;
|
||||
@@ -226,45 +248,59 @@ bool OptionsModel::setData(const QModelIndex & index, const QVariant & value, in
|
||||
fMinimizeOnClose = value.toBool();
|
||||
settings.setValue("fMinimizeOnClose", fMinimizeOnClose);
|
||||
break;
|
||||
|
||||
// default proxy
|
||||
case ProxyUse:
|
||||
settings.setValue("fUseProxy", value.toBool());
|
||||
successful = ApplyProxySettings();
|
||||
if (settings.value("fUseProxy") != value) {
|
||||
settings.setValue("fUseProxy", value.toBool());
|
||||
setRestartRequired(true);
|
||||
}
|
||||
break;
|
||||
case ProxyIP: {
|
||||
proxyType proxy;
|
||||
proxy.first = CService("127.0.0.1", 9050);
|
||||
GetProxy(NET_IPV4, proxy);
|
||||
|
||||
CNetAddr addr(value.toString().toStdString());
|
||||
proxy.first.SetIP(addr);
|
||||
settings.setValue("addrProxy", proxy.first.ToStringIPPort().c_str());
|
||||
successful = ApplyProxySettings();
|
||||
// contains current IP at index 0 and current port at index 1
|
||||
QStringList strlIpPort = settings.value("addrProxy").toString().split(":", QString::SkipEmptyParts);
|
||||
// if that key doesn't exist or has a changed IP
|
||||
if (!settings.contains("addrProxy") || strlIpPort.at(0) != value.toString()) {
|
||||
// construct new value from new IP and current port
|
||||
QString strNewValue = value.toString() + ":" + strlIpPort.at(1);
|
||||
settings.setValue("addrProxy", strNewValue);
|
||||
setRestartRequired(true);
|
||||
}
|
||||
}
|
||||
break;
|
||||
case ProxyPort: {
|
||||
proxyType proxy;
|
||||
proxy.first = CService("127.0.0.1", 9050);
|
||||
GetProxy(NET_IPV4, proxy);
|
||||
|
||||
proxy.first.SetPort(value.toInt());
|
||||
settings.setValue("addrProxy", proxy.first.ToStringIPPort().c_str());
|
||||
successful = ApplyProxySettings();
|
||||
// contains current IP at index 0 and current port at index 1
|
||||
QStringList strlIpPort = settings.value("addrProxy").toString().split(":", QString::SkipEmptyParts);
|
||||
// if that key doesn't exist or has a changed port
|
||||
if (!settings.contains("addrProxy") || strlIpPort.at(1) != value.toString()) {
|
||||
// construct new value from current IP and new port
|
||||
QString strNewValue = strlIpPort.at(0) + ":" + value.toString();
|
||||
settings.setValue("addrProxy", strNewValue);
|
||||
setRestartRequired(true);
|
||||
}
|
||||
}
|
||||
break;
|
||||
case ProxySocksVersion: {
|
||||
proxyType proxy;
|
||||
proxy.second = 5;
|
||||
GetProxy(NET_IPV4, proxy);
|
||||
|
||||
proxy.second = value.toInt();
|
||||
settings.setValue("nSocksVersion", proxy.second);
|
||||
successful = ApplyProxySettings();
|
||||
if (settings.value("nSocksVersion") != value) {
|
||||
settings.setValue("nSocksVersion", value.toInt());
|
||||
setRestartRequired(true);
|
||||
}
|
||||
}
|
||||
break;
|
||||
case Fee:
|
||||
#ifdef ENABLE_WALLET
|
||||
case Fee: // core option - can be changed on-the-fly
|
||||
// Todo: Add is valid check and warn via message, if not
|
||||
nTransactionFee = value.toLongLong();
|
||||
settings.setValue("nTransactionFee", nTransactionFee);
|
||||
settings.setValue("nTransactionFee", (qint64)nTransactionFee);
|
||||
emit transactionFeeChanged(nTransactionFee);
|
||||
break;
|
||||
case SpendZeroConfChange:
|
||||
if (settings.value("bSpendZeroConfChange") != value) {
|
||||
settings.setValue("bSpendZeroConfChange", value);
|
||||
setRestartRequired(true);
|
||||
}
|
||||
break;
|
||||
#endif
|
||||
case DisplayUnit:
|
||||
nDisplayUnit = value.toInt();
|
||||
settings.setValue("nDisplayUnit", nDisplayUnit);
|
||||
@@ -274,8 +310,35 @@ bool OptionsModel::setData(const QModelIndex & index, const QVariant & value, in
|
||||
bDisplayAddresses = value.toBool();
|
||||
settings.setValue("bDisplayAddresses", bDisplayAddresses);
|
||||
break;
|
||||
case ThirdPartyTxUrls:
|
||||
if (strThirdPartyTxUrls != value.toString()) {
|
||||
strThirdPartyTxUrls = value.toString();
|
||||
settings.setValue("strThirdPartyTxUrls", strThirdPartyTxUrls);
|
||||
setRestartRequired(true);
|
||||
}
|
||||
break;
|
||||
case Language:
|
||||
settings.setValue("language", value);
|
||||
if (settings.value("language") != value) {
|
||||
settings.setValue("language", value);
|
||||
setRestartRequired(true);
|
||||
}
|
||||
break;
|
||||
case CoinControlFeatures:
|
||||
fCoinControlFeatures = value.toBool();
|
||||
settings.setValue("fCoinControlFeatures", fCoinControlFeatures);
|
||||
emit coinControlFeaturesChanged(fCoinControlFeatures);
|
||||
break;
|
||||
case DatabaseCache:
|
||||
if (settings.value("nDatabaseCache") != value) {
|
||||
settings.setValue("nDatabaseCache", value);
|
||||
setRestartRequired(true);
|
||||
}
|
||||
break;
|
||||
case ThreadsScriptVerif:
|
||||
if (settings.value("nThreadsScriptVerif") != value) {
|
||||
settings.setValue("nThreadsScriptVerif", value);
|
||||
setRestartRequired(true);
|
||||
}
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
@@ -286,7 +349,36 @@ bool OptionsModel::setData(const QModelIndex & index, const QVariant & value, in
|
||||
return successful;
|
||||
}
|
||||
|
||||
qint64 OptionsModel::getTransactionFee()
|
||||
bool OptionsModel::getProxySettings(QNetworkProxy& proxy) const
|
||||
{
|
||||
return nTransactionFee;
|
||||
// Directly query current base proxy, because
|
||||
// GUI settings can be overridden with -proxy.
|
||||
proxyType curProxy;
|
||||
if (GetProxy(NET_IPV4, curProxy)) {
|
||||
if (curProxy.second == 5) {
|
||||
proxy.setType(QNetworkProxy::Socks5Proxy);
|
||||
proxy.setHostName(QString::fromStdString(curProxy.first.ToStringIP()));
|
||||
proxy.setPort(curProxy.first.GetPort());
|
||||
|
||||
return true;
|
||||
}
|
||||
else
|
||||
return false;
|
||||
}
|
||||
else
|
||||
proxy.setType(QNetworkProxy::NoProxy);
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
void OptionsModel::setRestartRequired(bool fRequired)
|
||||
{
|
||||
QSettings settings;
|
||||
return settings.setValue("fRestartRequired", fRequired);
|
||||
}
|
||||
|
||||
bool OptionsModel::isRestartRequired()
|
||||
{
|
||||
QSettings settings;
|
||||
return settings.value("fRestartRequired", false).toBool();
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user