Tommy 碎碎念

Tommy Wu's blog

« 上一篇 | 下一篇 »

FileZilla 3.7.3 Generic Proxy per site
post by tommy @ 01 十月, 2013 13:23

這是讓 FileZilla 支援每個站點獨立設定要使用的 proxy 的修正.

diff --strip-trailing-cr -Nur filezilla-3.7.3.orig/src/engine/ControlSocket.cpp filezilla-3.7.3/src/engine/ControlSocket.cpp
--- filezilla-3.7.3.orig/src/engine/ControlSocket.cpp 2013-06-09 11:30:07.000000000 +0800
+++ filezilla-3.7.3/src/engine/ControlSocket.cpp 2013-10-01 11:30:39.023788900 +0800
@@ -1163,21 +1163,44 @@
wxString host;
unsigned int port = 0;
 
- const int proxy_type = m_pEngine->GetOptions()->GetOptionVal(OPTION_PROXY_TYPE);
- if (proxy_type > CProxySocket::unknown && proxy_type < CProxySocket::proxytype_count && !m_pCurrentServer->GetBypassProxy())
+ int proxyType = 0;
+ wxString proxyHost;
+ unsigned int proxyPort;
+ wxString proxyUser;
+ wxString proxyPass;
+
+ if (m_pCurrentServer->GetProxyType() > CProxySocket::unknown &&
+ m_pCurrentServer->GetProxyType() < CProxySocket::proxytype_count
+ && m_pCurrentServer->GetProxyHost() != _T(""))
+ {
+ proxyType = m_pCurrentServer->GetProxyType();
+ proxyHost = m_pCurrentServer->GetProxyHost();
+ proxyPort = m_pCurrentServer->GetProxyPort();
+ proxyUser = m_pCurrentServer->GetProxyUser();
+ proxyPass = m_pCurrentServer->GetProxyPass();
+ }
+ else if (!m_pCurrentServer->GetBypassProxy())
+ {
+ proxyType = m_pEngine->GetOptions()->GetOptionVal(OPTION_PROXY_TYPE);
+ proxyHost = m_pEngine->GetOptions()->GetOption(OPTION_PROXY_HOST);
+ proxyPort = m_pEngine->GetOptions()->GetOptionVal(OPTION_PROXY_PORT);
+ proxyUser = m_pEngine->GetOptions()->GetOption(OPTION_PROXY_USER);
+ proxyPass = m_pEngine->GetOptions()->GetOption(OPTION_PROXY_PASS);
+ }
+ if (proxyType > CProxySocket::unknown && proxyType < CProxySocket::proxytype_count)
{
LogMessage(::Status, _("Connecting to %s through proxy"), m_pCurrentServer->FormatHost().c_str());
 
- host = m_pEngine->GetOptions()->GetOption(OPTION_PROXY_HOST);
- port = m_pEngine->GetOptions()->GetOptionVal(OPTION_PROXY_PORT);
+ host = proxyHost;
+ port = proxyPort;
 
delete m_pBackend;
m_pProxyBackend = new CProxySocket(this, m_pSocket, this);
m_pBackend = m_pProxyBackend;
- int res = m_pProxyBackend->Handshake((enum CProxySocket::ProxyType)proxy_type,
+ int res = m_pProxyBackend->Handshake((enum CProxySocket::ProxyType)proxyType,
m_pCurrentServer->GetHost(), m_pCurrentServer->GetPort(),
- m_pEngine->GetOptions()->GetOption(OPTION_PROXY_USER),
- m_pEngine->GetOptions()->GetOption(OPTION_PROXY_PASS));
+ proxyUser,
+ proxyPass);
 
if (res != EINPROGRESS)
{
@@ -1485,4 +1508,4 @@
int CControlSocket::Chmod(const CChmodCommand&)
{
return FZ_REPLY_NOTSUPPORTED;
-}
\ No newline at end of file
+}
diff --strip-trailing-cr -Nur filezilla-3.7.3.orig/src/engine/ftpcontrolsocket.cpp filezilla-3.7.3/src/engine/ftpcontrolsocket.cpp
--- filezilla-3.7.3.orig/src/engine/ftpcontrolsocket.cpp 2013-06-09 11:30:07.000000000 +0800
+++ filezilla-3.7.3/src/engine/ftpcontrolsocket.cpp 2013-10-01 11:30:39.029791700 +0800
@@ -4395,7 +4395,8 @@
 
// Do not use FTP proxy if generic proxy is set
int generic_proxy_type = m_pEngine->GetOptions()->GetOptionVal(OPTION_PROXY_TYPE);
- if ((generic_proxy_type <= CProxySocket::unknown || generic_proxy_type >= CProxySocket::proxytype_count) &&
+ if ((server.GetProxyType() <= CProxySocket::unknown || server.GetProxyType() >= CProxySocket::proxytype_count || server.GetProxyHost() == _T("")) &&
+ (generic_proxy_type <= CProxySocket::unknown || generic_proxy_type >= CProxySocket::proxytype_count) &&
(pData->ftp_proxy_type = m_pEngine->GetOptions()->GetOptionVal(OPTION_FTP_PROXY_TYPE)) && !server.GetBypassProxy())
{
pData->host = m_pEngine->GetOptions()->GetOption(OPTION_FTP_PROXY_HOST);
diff --strip-trailing-cr -Nur filezilla-3.7.3.orig/src/engine/server.cpp filezilla-3.7.3/src/engine/server.cpp
--- filezilla-3.7.3.orig/src/engine/server.cpp 2013-01-14 12:30:09.000000000 +0800
+++ filezilla-3.7.3/src/engine/server.cpp 2013-10-01 11:30:39.036796600 +0800
@@ -307,6 +307,11 @@
m_timezoneOffset = op.m_timezoneOffset;
m_pasvMode = op.m_pasvMode;
m_maximumMultipleConnections = op.m_maximumMultipleConnections;
+ m_proxyType = op.m_proxyType;
+ m_proxyHost = op.m_proxyHost;
+ m_proxyPort = op.m_proxyPort;
+ m_proxyUser = op.m_proxyUser;
+ m_proxyPass = op.m_proxyPass;
m_encodingType = op.m_encodingType;
m_customEncoding = op.m_customEncoding;
m_postLoginCommands = op.m_postLoginCommands;
@@ -350,6 +355,16 @@
return false;
else if (m_pasvMode != op.m_pasvMode)
return false;
+ else if (m_proxyType != op.m_proxyType)
+ return false;
+ else if (m_proxyHost != op.m_proxyHost)
+ return false;
+ else if (m_proxyPort != op.m_proxyPort)
+ return false;
+ else if (m_proxyUser != op.m_proxyUser)
+ return false;
+ else if (m_proxyPass != op.m_proxyPass)
+ return false;
else if (m_encodingType != op.m_encodingType)
return false;
else if (m_encodingType == ENCODING_CUSTOM)
@@ -436,6 +451,27 @@
else if (m_pasvMode > op.m_pasvMode)
return false;
 
+ if (m_proxyType < op.m_proxyType)
+ return true;
+ else if (m_proxyType > op.m_proxyType)
+ return false;
+ if (m_proxyHost < op.m_proxyHost)
+ return true;
+ else if (m_proxyHost > op.m_proxyHost)
+ return false;
+ if (m_proxyPort < op.m_proxyPort)
+ return true;
+ else if (m_proxyPort > op.m_proxyPort)
+ return false;
+ if (m_proxyUser < op.m_proxyUser)
+ return true;
+ else if (m_proxyUser > op.m_proxyUser)
+ return false;
+ if (m_proxyPass < op.m_proxyPass)
+ return true;
+ else if (m_proxyPass > op.m_proxyPass)
+ return false;
+
if (m_encodingType < op.m_encodingType)
return true;
else if (m_encodingType > op.m_encodingType)
@@ -489,6 +525,16 @@
return false;
else if (m_pasvMode != op.m_pasvMode)
return false;
+ else if (m_proxyType != op.m_proxyType)
+ return false;
+ else if (m_proxyHost != op.m_proxyHost)
+ return false;
+ else if (m_proxyPort != op.m_proxyPort)
+ return false;
+ else if (m_proxyUser != op.m_proxyUser)
+ return false;
+ else if (m_proxyPass != op.m_proxyPass)
+ return false;
else if (m_encodingType != op.m_encodingType)
return false;
else if (m_encodingType == ENCODING_CUSTOM)
@@ -635,6 +681,62 @@
return m_maximumMultipleConnections;
}
 
+int CServer::GetProxyType() const
+{
+ return m_proxyType;
+}
+
+void CServer::SetProxyType(int type)
+{
+ m_proxyType = type;
+}
+
+wxString CServer::GetProxyHost() const
+{
+ return m_proxyHost;
+}
+
+bool CServer::SetProxyHost(wxString host)
+{
+ m_proxyHost = host;
+ return true;
+}
+
+unsigned int CServer::GetProxyPort() const
+{
+ return m_proxyPort;
+}
+
+bool CServer::SetProxyPort(unsigned int port)
+{
+ if (port < 1 || port > 65535)
+ return false;
+ m_proxyPort = port;
+ return true;
+}
+
+wxString CServer::GetProxyUser() const
+{
+ return m_proxyUser;
+}
+
+bool CServer::SetProxyUser(wxString user)
+{
+ m_proxyUser = user;
+ return true;
+}
+
+wxString CServer::GetProxyPass() const
+{
+ return m_proxyPass;
+}
+
+bool CServer::SetProxyPass(wxString pass)
+{
+ m_proxyPass = pass;
+ return true;
+}
+
wxString CServer::FormatHost(bool always_omit_port /*=false*/) const
{
wxString host = m_host;
@@ -683,6 +785,11 @@
m_timezoneOffset = 0;
m_pasvMode = MODE_DEFAULT;
m_maximumMultipleConnections = 0;
+ m_proxyType = 0;
+ m_proxyUser = _T("");
+ m_proxyPort = 8080;
+ m_proxyUser = _T("");
+ m_proxyPass = _T("");
m_encodingType = ENCODING_AUTO;
m_customEncoding = _T("");
m_bypassProxy = false;
diff --strip-trailing-cr -Nur filezilla-3.7.3.orig/src/engine/sftpcontrolsocket.cpp filezilla-3.7.3/src/engine/sftpcontrolsocket.cpp
--- filezilla-3.7.3.orig/src/engine/sftpcontrolsocket.cpp 2013-06-09 11:30:07.000000000 +0800
+++ filezilla-3.7.3/src/engine/sftpcontrolsocket.cpp 2013-10-01 11:30:39.044802800 +0800
@@ -486,7 +486,8 @@
switch (pData->opState)
{
case connect_init:
- if (m_pEngine->GetOptions()->GetOptionVal(OPTION_PROXY_TYPE) && !m_pCurrentServer->GetBypassProxy())
+ if ((m_pCurrentServer->GetProxyType() && m_pCurrentServer->GetProxyHost() != _T("")) ||
+ (m_pEngine->GetOptions()->GetOptionVal(OPTION_PROXY_TYPE) && !m_pCurrentServer->GetBypassProxy()))
pData->opState = connect_proxy;
else if (pData->pKeyFiles)
pData->opState = connect_keys;
@@ -540,37 +541,59 @@
{
case connect_proxy:
{
- int type;
- switch (m_pEngine->GetOptions()->GetOptionVal(OPTION_PROXY_TYPE))
- {
- case CProxySocket::HTTP:
- type = 1;
- break;
- case CProxySocket::SOCKS5:
- type = 2;
- break;
- default:
- LogMessage(__TFILE__, __LINE__, this, Debug_Warning, _T("Unsupported proxy type"));
- DoClose(FZ_REPLY_INTERNALERROR);
- return FZ_REPLY_ERROR;
- }
-
- wxString cmd = wxString::Format(_T("proxy %d \"%s\" %d"), type,
- m_pEngine->GetOptions()->GetOption(OPTION_PROXY_HOST).c_str(),
- m_pEngine->GetOptions()->GetOptionVal(OPTION_PROXY_PORT));
- wxString user = m_pEngine->GetOptions()->GetOption(OPTION_PROXY_USER);
- if (user != _T(""))
- cmd += _T(" \"") + user + _T("\"");
-
- wxString show = cmd;
-
- wxString pass = m_pEngine->GetOptions()->GetOption(OPTION_PROXY_PASS);
- if (pass != _T(""))
- {
- cmd += _T(" \"") + pass + _T("\"");
- show += _T(" \"") + wxString('*', pass.Len()) + _T("\"");
- }
- res = Send(cmd, show);
+ int proxyType;
+ wxString proxyHost;
+ unsigned int proxyPort;
+ wxString proxyUser;
+ wxString proxyPass;
+
+ if (m_pCurrentServer->GetProxyType() && m_pCurrentServer->GetProxyHost() != _T(""))
+ {
+ proxyType = m_pCurrentServer->GetProxyType();
+ proxyHost = m_pCurrentServer->GetProxyHost();
+ proxyPort = m_pCurrentServer->GetProxyPort();
+ proxyUser = m_pCurrentServer->GetProxyUser();
+ proxyPass = m_pCurrentServer->GetProxyPass();
+ }
+ else {
+ proxyType = m_pEngine->GetOptions()->GetOptionVal(OPTION_PROXY_TYPE);
+ proxyHost = m_pEngine->GetOptions()->GetOption(OPTION_PROXY_HOST);
+ proxyPort = m_pEngine->GetOptions()->GetOptionVal(OPTION_PROXY_PORT);
+ proxyUser = m_pEngine->GetOptions()->GetOption(OPTION_PROXY_USER);
+ proxyPass = m_pEngine->GetOptions()->GetOption(OPTION_PROXY_PASS);
+ }
+
+ int type;
+ switch (proxyType)
+ {
+ case CProxySocket::HTTP:
+ type = 1;
+ break;
+ case CProxySocket::SOCKS5:
+ type = 2;
+ break;
+ default:
+ LogMessage(__TFILE__, __LINE__, this, Debug_Warning, _T("Unsupported proxy type"));
+ DoClose(FZ_REPLY_INTERNALERROR);
+ return FZ_REPLY_ERROR;
+ }
+
+ wxString cmd = wxString::Format(_T("proxy %d \"%s\" %d"), type,
+ proxyHost.c_str(),
+ proxyPort);
+ wxString user = proxyUser;
+ if (user != _T(""))
+ cmd += _T(" \"") + user + _T("\"");
+
+ wxString show = cmd;
+
+ wxString pass = proxyPass;
+ if (pass != _T(""))
+ {
+ cmd += _T(" \"") + pass + _T("\"");
+ show += _T(" \"") + wxString('*', pass.Len()) + _T("\"");
+ }
+ res = Send(cmd, show);
}
break;
case connect_keys:
diff --strip-trailing-cr -Nur filezilla-3.7.3.orig/src/include/server.h filezilla-3.7.3/src/include/server.h
--- filezilla-3.7.3.orig/src/include/server.h 2013-01-14 12:30:08.000000000 +0800
+++ filezilla-3.7.3/src/include/server.h 2013-10-01 11:30:39.049805500 +0800
@@ -107,6 +107,17 @@
void SetPasvMode(enum PasvMode pasvMode);
void MaximumMultipleConnections(int maximum);
 
+ int GetProxyType() const;
+ void SetProxyType(int type);
+ wxString GetProxyHost() const;
+ bool SetProxyHost(wxString host);
+ unsigned int GetProxyPort() const;
+ bool SetProxyPort(unsigned int port);
+ wxString GetProxyUser() const;
+ bool SetProxyUser(wxString user);
+ wxString GetProxyPass() const;
+ bool SetProxyPass(wxString pass);
+
wxString FormatHost(bool always_omit_port = false) const;
wxString FormatServer(const bool always_include_prefix = false) const;
 
@@ -158,6 +169,11 @@
int m_timezoneOffset;
enum PasvMode m_pasvMode;
int m_maximumMultipleConnections;
+ int m_proxyType;
+ wxString m_proxyHost;
+ unsigned int m_proxyPort;
+ wxString m_proxyUser;
+ wxString m_proxyPass;
enum CharsetEncoding m_encodingType;
wxString m_customEncoding;
wxString m_name;
diff --strip-trailing-cr -Nur filezilla-3.7.3.orig/src/interface/queue_storage.cpp filezilla-3.7.3/src/interface/queue_storage.cpp
--- filezilla-3.7.3.orig/src/interface/queue_storage.cpp 2012-10-25 11:30:07.000000000 +0800
+++ filezilla-3.7.3/src/interface/queue_storage.cpp 2013-10-01 11:30:39.056810800 +0800
@@ -58,7 +58,12 @@
encoding,
bypass_proxy,
post_login_commands,
- name
+ name,
+ proxy_type,
+ proxy_host,
+ proxy_port,
+ proxy_user,
+ proxy_pass
};
}
 
@@ -78,7 +83,12 @@
{ _T("encoding"), text, 0 },
{ _T("bypass_proxy"), integer, 0 },
{ _T("post_login_commands"), text, 0 },
- { _T("name"), text, 0 }
+ { _T("name"), text, 0 },
+ { _T("proxy_type"), integer, 0 },
+ { _T("proxy_host"), text, 0 },
+ { _T("proxy_port"), integer, 0 },
+ { _T("proxy_user"), text, 0 },
+ { _T("proxy_pass"), text, 0 }
};
 
namespace file_table_column_names
@@ -647,6 +657,12 @@
}
Bind(insertServerQuery_, server_table_column_names::max_connections, server.MaximumMultipleConnections());
 
+ Bind(insertServerQuery_, server_table_column_names::proxy_type, static_cast<int>(server.GetProxyType()));
+ Bind(insertServerQuery_, server_table_column_names::proxy_host, server.GetProxyHost());
+ Bind(insertServerQuery_, server_table_column_names::proxy_port, static_cast<int>(server.GetProxyPort()));
+ Bind(insertServerQuery_, server_table_column_names::proxy_user, server.GetProxyUser());
+ Bind(insertServerQuery_, server_table_column_names::proxy_pass, server.GetProxyPass());
+
switch (server.GetEncodingType())
{
default:
@@ -912,6 +928,21 @@
return INVALID_DATA;
server.MaximumMultipleConnections(maximumMultipleConnections);
 
+ int proxyType = GetColumnInt(selectServersQuery_, server_table_column_names::proxy_type);
+ server.SetProxyType(proxyType);
+ wxString proxyHost = GetColumnText(selectServersQuery_, server_table_column_names::proxy_host);
+ if (!server.SetProxyHost(proxyHost))
+ return INVALID_DATA;
+ int proxyPort = GetColumnInt(selectServersQuery_, server_table_column_names::proxy_port);
+ if (!server.SetProxyPort(proxyPort))
+ return INVALID_DATA;
+ wxString proxyUser = GetColumnText(selectServersQuery_, server_table_column_names::proxy_user);
+ if (!server.SetProxyUser(proxyUser))
+ return INVALID_DATA;
+ wxString proxyPass = GetColumnText(selectServersQuery_, server_table_column_names::proxy_pass);
+ if (!server.SetProxyPass(proxyPass))
+ return INVALID_DATA;
+
wxString encodingType = GetColumnText(selectServersQuery_, server_table_column_names::encoding);
if (encodingType.empty() || encodingType == _T("Auto"))
server.SetEncodingType(ENCODING_AUTO);
diff --strip-trailing-cr -Nur filezilla-3.7.3.orig/src/interface/resources/dialogs.xrc filezilla-3.7.3/src/interface/resources/dialogs.xrc
--- filezilla-3.7.3.orig/src/interface/resources/dialogs.xrc 2013-07-01 11:30:11.000000000 +0800
+++ filezilla-3.7.3/src/interface/resources/dialogs.xrc 2013-10-01 11:30:39.071819400 +0800
@@ -961,7 +961,7 @@
<cellpos>3,0</cellpos>
<cellspan>0,2</cellspan>
</object>
-
+
<object class="sizeritem">
<object class="wxStaticText">
<label>&amp;Logon Type:</label>
@@ -1245,6 +1245,110 @@
</object>
</object>
</object>
+ </object>
+ <object class="notebookpage">
+ <label>Generic proxy</label>
+ <object class="wxPanel">
+ <object class="wxBoxSizer">
+ <orient>wxVERTICAL</orient>
+ <object class="sizeritem">
+ <object class="wxStaticBoxSizer">
+ <label>Generic proxy</label>
+ <orient>wxHORIZONTAL</orient>
+ <object class="sizeritem">
+ <object class="wxFlexGridSizer">
+ <cols>1</cols>
+ <vgap>5</vgap>
+ <object class="sizeritem">
+ <object class="wxStaticText">
+ <label>Type of generic proxy:</label>
+ </object>
+ </object>
+ <object class="sizeritem">
+ <object class="wxRadioButton" name="ID_PROXYTYPE_NONE">
+ <label>&amp;None</label>
+ </object>
+ </object>
+ <object class="sizeritem">
+ <object class="wxRadioButton" name="ID_PROXYTYPE_HTTP">
+ <label>&amp;HTTP/1.1 using CONNECT method</label>
+ </object>
+ </object>
+ <object class="sizeritem">
+ <object class="wxRadioButton" name="ID_PROXYTYPE_SOCKS5">
+ <label>&amp;SOCKS 5</label>
+ </object>
+ </object>
+ <object class="sizeritem">
+ <object class="wxFlexGridSizer">
+ <cols>2</cols>
+ <object class="sizeritem">
+ <object class="wxStaticText">
+ <label>P&amp;roxy host:</label>
+ </object>
+ <flag>wxALIGN_CENTRE_VERTICAL</flag>
+ </object>
+ <object class="sizeritem">
+ <object class="wxTextCtrl" name="ID_PROXY_HOST"/>
+ <flag>wxALIGN_CENTRE_VERTICAL|wxGROW</flag>
+ </object>
+ <object class="sizeritem">
+ <object class="wxStaticText">
+ <label>Proxy &amp;port:</label>
+ </object>
+ <flag>wxALIGN_CENTRE_VERTICAL</flag>
+ </object>
+ <object class="sizeritem">
+ <object class="wxTextCtrl" name="ID_PROXY_PORT">
+ <size>50,-1</size>
+ </object>
+ <flag>wxALIGN_CENTRE_VERTICAL</flag>
+ </object>
+ <object class="sizeritem">
+ <object class="wxStaticText">
+ <label>Proxy &amp;user:</label>
+ </object>
+ <flag>wxALIGN_CENTRE_VERTICAL</flag>
+ </object>
+ <object class="sizeritem">
+ <object class="wxTextCtrl" name="ID_PROXY_USER"/>
+ <flag>wxALIGN_CENTRE_VERTICAL|wxGROW</flag>
+ </object>
+ <object class="sizeritem">
+ <object class="wxStaticText">
+ <label>Pro&amp;xy password:</label>
+ </object>
+ <flag>wxALIGN_CENTRE_VERTICAL</flag>
+ </object>
+ <object class="sizeritem">
+ <object class="wxTextCtrl" name="ID_PROXY_PASS">
+ <style>wxTE_PASSWORD</style>
+ </object>
+ <flag>wxALIGN_CENTRE_VERTICAL|wxGROW</flag>
+ </object>
+ <vgap>5</vgap>
+ <hgap>5</hgap>
+ <growablecols>1</growablecols>
+ </object>
+ <flag>wxGROW</flag>
+ </object>
+ <growablecols>0</growablecols>
+ <object class="sizeritem">
+ <object class="wxStaticText">
+ <label>Note: Using a generic proxy forces passive mode on FTP connections.</label>
+ </object>
+ </object>
+ </object>
+ <option>1</option>
+ <flag>wxBOTTOM|wxLEFT|wxRIGHT|wxGROW</flag>
+ <border>5</border>
+ </object>
+ </object>
+ <option>1</option>
+ <flag>wxGROW</flag>
+ </object>
+ </object>
+ </object>
</object>
<object class="notebookpage">
<label>Charset</label>
diff --strip-trailing-cr -Nur filezilla-3.7.3.orig/src/interface/sitemanager_dialog.cpp filezilla-3.7.3/src/interface/sitemanager_dialog.cpp
--- filezilla-3.7.3.orig/src/interface/sitemanager_dialog.cpp 2013-05-01 11:30:04.000000000 +0800
+++ filezilla-3.7.3/src/interface/sitemanager_dialog.cpp 2013-10-01 11:30:39.078825500 +0800
@@ -32,6 +32,9 @@
EVT_BUTTON(XRCID("ID_BROWSE"), CSiteManagerDialog::OnRemoteDirBrowse)
EVT_TREE_ITEM_ACTIVATED(XRCID("ID_SITETREE"), CSiteManagerDialog::OnItemActivated)
EVT_CHECKBOX(XRCID("ID_LIMITMULTIPLE"), CSiteManagerDialog::OnLimitMultipleConnectionsChanged)
+EVT_RADIOBUTTON(XRCID("ID_PROXYTYPE_NONE"), CSiteManagerDialog::OnProxyChange)
+EVT_RADIOBUTTON(XRCID("ID_PROXYTYPE_HTTP"), CSiteManagerDialog::OnProxyChange)
+EVT_RADIOBUTTON(XRCID("ID_PROXYTYPE_SOCKS5"), CSiteManagerDialog::OnProxyChange)
EVT_RADIOBUTTON(XRCID("ID_CHARSET_AUTO"), CSiteManagerDialog::OnCharsetChange)
EVT_RADIOBUTTON(XRCID("ID_CHARSET_UTF8"), CSiteManagerDialog::OnCharsetChange)
EVT_RADIOBUTTON(XRCID("ID_CHARSET_CUSTOM"), CSiteManagerDialog::OnCharsetChange)
@@ -403,6 +406,10 @@
XRCCTRL(*this, "ID_TRANSFERMODE_ACTIVE", wxRadioButton)->Update();
XRCCTRL(*this, "ID_TRANSFERMODE_PASSIVE", wxRadioButton)->Update();
 
+ XRCCTRL(*this, "ID_PROXYTYPE_NONE", wxRadioButton)->Update();
+ XRCCTRL(*this, "ID_PROXYTYPE_HTTP", wxRadioButton)->Update();
+ XRCCTRL(*this, "ID_PROXYTYPE_SOCKS5", wxRadioButton)->Update();
+
wxTreeItemId item = pTree->GetSelection();
if (!item.IsOk())
pTree->SelectItem(m_ownSites);
@@ -1396,6 +1403,19 @@
else
server.m_server.MaximumMultipleConnections(0);
 
+ if (XRCCTRL(*this, "ID_PROXYTYPE_HTTP", wxRadioButton)->GetValue())
+ server.m_server.SetProxyType(1);
+ else if (XRCCTRL(*this, "ID_PROXYTYPE_SOCKS5", wxRadioButton)->GetValue())
+ server.m_server.SetProxyType(2);
+ else
+ server.m_server.SetProxyType(0);
+ server.m_server.SetProxyHost(XRCCTRL(*this, "ID_PROXY_HOST", wxTextCtrl)->GetValue());
+ unsigned long proxyPort;
+ XRCCTRL(*this, "ID_PROXY_PORT", wxTextCtrl)->GetValue().ToULong(&proxyPort);
+ server.m_server.SetProxyPort(proxyPort);
+ server.m_server.SetProxyUser(XRCCTRL(*this, "ID_PROXY_USER", wxTextCtrl)->GetValue());
+ server.m_server.SetProxyPass(XRCCTRL(*this, "ID_PROXY_PASS", wxTextCtrl)->GetValue());
+
if (XRCCTRL(*this, "ID_CHARSET_UTF8", wxRadioButton)->GetValue())
server.m_server.SetEncodingType(ENCODING_UTF8);
else if (XRCCTRL(*this, "ID_CHARSET_CUSTOM", wxRadioButton)->GetValue())
@@ -1642,6 +1662,43 @@
XRCCTRL(*this, "ID_MAXMULTIPLE&qu
Del.icio.us Furl HEMiDEMi Technorati MyShare
迴響
暱稱:
標題:
個人網頁:
電子郵件:
迴響

  

Bad Behavior 已經阻擋了 68 個過去 7 天試圖闖關的垃圾迴響與引用。
Power by LifeType. Template design by JamesHuang. Valid XHTML and CSS