From c4443c2be141e5f45bb10376056f3083e97cde50 Mon Sep 17 00:00:00 2001 From: Philip Kaufmann Date: Fri, 8 Jun 2012 15:21:55 +0200 Subject: re-work optionsdialog to a tabbed UI based on an ui-file - extend network options with a SOCKS version selection - changing "Unit to show amounts in:" now also updates the unit used in the transaction fee box - string updates - link Apply button and OK button when enabling or disabling them - use LookupNumeric() from netbase to verify proxy address (via an EventFilter) - change proxy address field to QValidatedLineEdit and add visual feedback - add a status label used for displaying a message for invalid proxy addresses - allow usage of IPv6 address as proxy address - added warning message when enabling / disabling SOCKS proxy --- src/qt/optionsmodel.cpp | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) (limited to 'src/qt/optionsmodel.cpp') 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); -- cgit v1.2.3