From 7ad90b1b80b474f035387223069ccd5aa5f7ba65 Mon Sep 17 00:00:00 2001 From: Christophe Dumez Date: Wed, 30 Dec 2009 15:07:51 +0000 Subject: [PATCH] - Fix Proxy type rank in enum (to be consistent with older qBittorrent versions) - Added Proxy settings to Web UI - Fix tiny bugs in proxy settings --- src/bittorrent.cpp | 2 +- src/eventmanager.cpp | 4 +- src/options_imp.cpp | 3 +- src/options_imp.h | 2 +- src/webui/preferences_content.html | 180 ++++++++++++++++++++++++++++- 5 files changed, 183 insertions(+), 8 deletions(-) diff --git a/src/bittorrent.cpp b/src/bittorrent.cpp index 27b8fa9ef..c32d9d3dd 100644 --- a/src/bittorrent.cpp +++ b/src/bittorrent.cpp @@ -60,7 +60,7 @@ #define MAX_TRACKER_ERRORS 2 #define MAX_RATIO 100. -enum ProxyType {HTTP, SOCKS4, SOCKS5, HTTP_PW, SOCKS5_PW}; +enum ProxyType {HTTP=1, SOCKS5=2, HTTP_PW=3, SOCKS5_PW=4, SOCKS4=5}; // Main constructor Bittorrent::Bittorrent() : preAllocateAll(false), addInPause(false), ratio_limit(-1), UPnPEnabled(false), NATPMPEnabled(false), LSDEnabled(false), DHTEnabled(false), current_dht_port(0), queueingEnabled(false), geoipDBLoaded(false), exiting(false) { diff --git a/src/eventmanager.cpp b/src/eventmanager.cpp index 64faecd9e..b066d5e81 100644 --- a/src/eventmanager.cpp +++ b/src/eventmanager.cpp @@ -198,9 +198,9 @@ void EventManager::setGlobalPreferences(QVariantMap m) const { if(m.contains("http_proxy_auth_enabled")) Preferences::setHTTPProxyAuthEnabled(m["http_proxy_auth_enabled"].toBool()); if(m.contains("http_proxy_username")) - Preferences::setHTTPProxyUsername(m["proxy_username"].toString()); + Preferences::setHTTPProxyUsername(m["http_proxy_username"].toString()); if(m.contains("http_proxy_password")) - Preferences::setHTTPProxyPassword(m["proxy_password"].toString()); + Preferences::setHTTPProxyPassword(m["http_proxy_password"].toString()); // IP Filter if(m.contains("ip_filter_enabled")) Preferences::setFilteringEnabled(m["ip_filter_enabled"].toBool()); diff --git a/src/options_imp.cpp b/src/options_imp.cpp index fd50a51f2..f691f7bcd 100644 --- a/src/options_imp.cpp +++ b/src/options_imp.cpp @@ -1201,7 +1201,6 @@ void options_imp::enablePeerProxy(int index){ lblProxyPort->setEnabled(false); spinProxyPort->setEnabled(false); checkProxyAuth->setEnabled(false); - checkProxyAuth->setEnabled(false); checkProxyAuth->setChecked(false); } } @@ -1221,7 +1220,7 @@ void options_imp::enableHTTPProxy(int index){ lblProxyPort_http->setEnabled(false); spinProxyPort_http->setEnabled(false); checkProxyAuth_http->setEnabled(false); - checkProxyAuth_http->setEnabled(false); + checkProxyAuth_http->setChecked(false); } } diff --git a/src/options_imp.h b/src/options_imp.h index 9483267de..e79e19cc3 100644 --- a/src/options_imp.h +++ b/src/options_imp.h @@ -34,7 +34,7 @@ #include "ui_options.h" #include -enum ProxyType {HTTP, SOCKS4, SOCKS5, HTTP_PW, SOCKS5_PW}; +enum ProxyType {HTTP=1, SOCKS5=2, HTTP_PW=3, SOCKS5_PW=4, SOCKS4=5}; // actions on double-click on torrents enum DoubleClickAction {TOGGLE_PAUSE, OPEN_DEST}; diff --git a/src/webui/preferences_content.html b/src/webui/preferences_content.html index 165250aed..0fa0ccf0f 100644 --- a/src/webui/preferences_content.html +++ b/src/webui/preferences_content.html @@ -135,8 +135,39 @@