diff options
author | Wladimir J. van der Laan <laanwj@gmail.com> | 2012-06-13 07:37:24 -0700 |
---|---|---|
committer | Wladimir J. van der Laan <laanwj@gmail.com> | 2012-06-13 07:37:24 -0700 |
commit | 44c89996c8a9472b03b90ef1cfffb7c8503bf1da (patch) | |
tree | 437bad1af7dccf5ced0f0056757d134334f4b056 /src/qt/optionsmodel.cpp | |
parent | c4879a0c2fea705b6ad7956502acc7897838e841 (diff) | |
parent | c4443c2be141e5f45bb10376056f3083e97cde50 (diff) |
Merge pull request #1433 from Diapolo/tabbed_optionsdialog
GUI: re-work current options dialog to a tabbed layout and use an UI-file
Diffstat (limited to 'src/qt/optionsmodel.cpp')
-rw-r--r-- | src/qt/optionsmodel.cpp | 9 |
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); |