diff options
author | Andrei Karas <akaras@inbox.ru> | 2012-04-01 18:48:02 +0300 |
---|---|---|
committer | Andrei Karas <akaras@inbox.ru> | 2012-04-01 18:48:02 +0300 |
commit | 8b1922e8e7a227090cf01b05e65209076dec9df5 (patch) | |
tree | ba3c487dff6da52c6cca10e925b2b5a77f073742 /src/gui | |
parent | eb119ecb58cce24813b37108fce4c0f343bdc2ab (diff) | |
download | plus-8b1922e8e7a227090cf01b05e65209076dec9df5.tar.gz plus-8b1922e8e7a227090cf01b05e65209076dec9df5.tar.bz2 plus-8b1922e8e7a227090cf01b05e65209076dec9df5.tar.xz plus-8b1922e8e7a227090cf01b05e65209076dec9df5.zip |
Add support form different proxy types in download process.
Diffstat (limited to 'src/gui')
-rw-r--r-- | src/gui/setup_other.cpp | 25 | ||||
-rw-r--r-- | src/gui/setup_other.h | 6 | ||||
-rw-r--r-- | src/gui/whoisonline.cpp | 2 |
3 files changed, 33 insertions, 0 deletions
diff --git a/src/gui/setup_other.cpp b/src/gui/setup_other.cpp index 02ad9ae5e..602f94fcb 100644 --- a/src/gui/setup_other.cpp +++ b/src/gui/setup_other.cpp @@ -167,6 +167,25 @@ Setup_Other::Setup_Other() new SetupItemCheckBox(_("Auto hide shortcuts buttons."), "", "autohideButtons", this, "autohideButtonsEvent"); + + new SetupItemLabel(_("Proxy server"), "", this); + + mProxyTypeList = new SetupItemNames(); + mProxyTypeList->push_back(_("System proxy")); + mProxyTypeList->push_back(_("Direct connection")); + mProxyTypeList->push_back("HTTP"); + mProxyTypeList->push_back("HTTP 1.0"); + mProxyTypeList->push_back("SOCKS4"); + mProxyTypeList->push_back("SOCKS4A"); + mProxyTypeList->push_back("SOCKS5"); + mProxyTypeList->push_back(_("SOCKS5 hostname")); + new SetupItemSlider2(_("Proxy type"), "", "downloadProxyType", this, + "downloadProxyTypeEvent", 0, 7, mProxyTypeList); + + new SetupItemTextField(_("Proxy address:port"), "", + "downloadProxy", this, "downloadProxyEvent"); + + new SetupItemLabel(_("Other"), "", this); new SetupItemCheckBox(_("Enable server side attack"), "", @@ -199,6 +218,12 @@ Setup_Other::Setup_Other() setDimension(gcn::Rectangle(0, 0, 550, 350)); } +Setup_Other::~Setup_Other() +{ + delete mProxyTypeList; + mProxyTypeList = nullptr; +} + void Setup_Other::apply() { SetupTabScroll::apply(); diff --git a/src/gui/setup_other.h b/src/gui/setup_other.h index 182a3f4c6..ae7daed50 100644 --- a/src/gui/setup_other.h +++ b/src/gui/setup_other.h @@ -25,6 +25,7 @@ #include "guichanfwd.h" +#include "gui/widgets/setupitem.h" #include "gui/widgets/setuptabscroll.h" #include <guichan/actionlistener.hpp> @@ -37,7 +38,12 @@ class Setup_Other : public SetupTabScroll public: Setup_Other(); + ~Setup_Other(); + void apply(); + + protected: + SetupItemNames *mProxyTypeList; }; #endif diff --git a/src/gui/whoisonline.cpp b/src/gui/whoisonline.cpp index aece25115..b9b692c0f 100644 --- a/src/gui/whoisonline.cpp +++ b/src/gui/whoisonline.cpp @@ -42,6 +42,7 @@ #include "playerrelations.h" #include "main.h" +#include "net/download.h" #include "net/net.h" #include "net/playerhandler.h" @@ -526,6 +527,7 @@ int WhoIsOnline::downloadThread(void *ptr) curl_easy_setopt(curl, CURLOPT_NOSIGNAL, 1); curl_easy_setopt(curl, CURLOPT_CONNECTTIMEOUT, 7); curl_easy_setopt(curl, CURLOPT_TIMEOUT, 30); + Net::Download::addProxy(curl); struct curl_slist *pHeaders = nullptr; // Make sure the resources2.txt and news.txt aren't cached, |