aboutsummaryrefslogtreecommitdiff
path: root/src/qt/optionsmodel.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/qt/optionsmodel.cpp')
-rw-r--r--src/qt/optionsmodel.cpp9
1 files changed, 8 insertions, 1 deletions
diff --git a/src/qt/optionsmodel.cpp b/src/qt/optionsmodel.cpp
index 64d91cb0b1..d6c6bbf409 100644
--- a/src/qt/optionsmodel.cpp
+++ b/src/qt/optionsmodel.cpp
@@ -20,6 +20,7 @@ bool static ApplyProxySettings()
if (!settings.value("fUseProxy", false).toBool()) {
addrProxy = CService();
nSocksVersion = 0;
+ return false;
}
if (nSocksVersion && !addrProxy.IsValid())
return false;
@@ -53,6 +54,8 @@ void OptionsModel::Init()
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 (settings.contains("detachDB"))
SoftSetBoolArg("-detachdb", settings.value("detachDB").toBool());
if (!language.isEmpty())
@@ -142,7 +145,7 @@ QVariant OptionsModel::data(const QModelIndex & index, int role) const
case ProxyUse:
return settings.value("fUseProxy", false);
case ProxySocksVersion:
- return settings.value("nSocksVersion", false);
+ return settings.value("nSocksVersion", 5);
case ProxyIP: {
CService addrProxy;
if (GetProxy(NET_IPV4, addrProxy))
@@ -203,6 +206,10 @@ bool OptionsModel::setData(const QModelIndex & index, const QVariant & value, in
settings.setValue("fUseProxy", value.toBool());
ApplyProxySettings();
break;
+ case ProxySocksVersion:
+ settings.setValue("nSocksVersion", value.toInt());
+ ApplyProxySettings();
+ break;
case ProxyIP:
{
CService addrProxy("127.0.0.1", 9050);