Ticket #1528: filezilla_bypassProxy_rev2099.patch
File filezilla_bypassProxy_rev2099.patch, 8.6 KB (added by , 16 years ago) |
---|
-
src/interface/sitemanager.cpp
1115 1115 else 1116 1116 data->m_server.SetEncodingType(ENCODING_AUTO); 1117 1117 1118 if (XRCCTRL(*this, "ID_BYPASSPROXY", wxCheckBox)->GetValue()) 1119 { 1120 data->m_server.SetBypassProxy(true); 1121 } 1122 else 1123 data->m_server.SetBypassProxy(false); 1118 1124 return true; 1119 1125 } 1120 1126 … … 1212 1218 XRCCTRL(*this, "ID_HOST", wxTextCtrl)->SetValue(_T("")); 1213 1219 XRCCTRL(*this, "ID_PORT", wxTextCtrl)->SetValue(_T("")); 1214 1220 XRCCTRL(*this, "ID_PROTOCOL", wxChoice)->SetStringSelection(_("FTP")); 1221 XRCCTRL(*this, "ID_BYPASSPROXY", wxCheckBox)->SetValue(false); 1215 1222 XRCCTRL(*this, "ID_LOGONTYPE", wxChoice)->SetStringSelection(_("Anonymous")); 1216 1223 XRCCTRL(*this, "ID_USER", wxTextCtrl)->SetValue(_T("")); 1217 1224 XRCCTRL(*this, "ID_PASS", wxTextCtrl)->SetValue(_T("")); … … 1258 1265 else 1259 1266 XRCCTRL(*this, "ID_PROTOCOL", wxChoice)->SetStringSelection(CServer::GetProtocolName(FTP)); 1260 1267 XRCCTRL(*this, "ID_PROTOCOL", wxWindow)->Enable(!predefined); 1268 XRCCTRL(*this, "ID_BYPASSPROXY", wxCheckBox)->SetValue(data->m_server.GetBypassProxy()); 1261 1269 1262 1270 XRCCTRL(*this, "ID_USER", wxTextCtrl)->Enable(!predefined && data->m_server.GetLogonType() != ANONYMOUS); 1263 1271 XRCCTRL(*this, "ID_PASS", wxTextCtrl)->Enable(!predefined && data->m_server.GetLogonType() == NORMAL || data->m_server.GetLogonType() == ACCOUNT); -
src/interface/resources/dialogs.xrc
788 788 <object class="wxChoice" name="ID_PROTOCOL"> 789 789 <content/> 790 790 <selection>0</selection> 791 <size>260,-1</size> 791 792 </object> 792 793 <flag>wxGROW</flag> 793 794 </object> 795 <vgap>5</vgap> 796 <hgap>5</hgap> 797 </object> 798 <flag>wxALL|wxGROW</flag> 799 <border>5</border> 800 </object> 801 <object class="sizeritem"> 802 <object class="wxCheckBox" name="ID_BYPASSPROXY"> 803 <label>&Bypass proxy</label> 804 </object> 805 <flag>wxTOP|wxBOTTOM|wxLEFT|wxGROW</flag> 806 <border>5</border> 807 </object> 808 <object class="sizeritem"> 809 <object class="wxStaticLine"/> 810 <flag>wxTOP|wxBOTTOM|wxGROW</flag> 811 <border>5</border> 812 </object> 813 <orient>wxVERTICAL</orient> 814 <object class="sizeritem"> 815 <object class="wxFlexGridSizer"> 816 <cols>2</cols> 794 817 <object class="sizeritem"> 795 <object class="wxStaticLine"/>796 <flag>wxTOP|wxBOTTOM|wxGROW</flag>797 <border>5</border>798 </object>799 <object class="sizeritem">800 <object class="wxStaticLine"/>801 <flag>wxTOP|wxBOTTOM|wxGROW</flag>802 <border>5</border>803 </object>804 <object class="sizeritem">805 818 <object class="wxStaticText"> 806 819 <label>&Logontype:</label> 807 820 </object> -
src/interface/quickconnectbar.cpp
108 108 return; 109 109 } 110 110 111 if (!m_pState->Connect(server, true)) 112 return; 113 114 CRecentServerList::SetMostRecentServer(server); 111 if (event.GetId() == 1) 112 { 113 bool oldBypassProxy = server.GetBypassProxy(); 114 server.SetBypassProxy(true); 115 if (!m_pState->Connect(server, true)) 116 { 117 server.SetBypassProxy(oldBypassProxy); 118 return; 119 } 120 121 CRecentServerList::SetMostRecentServer(server); 122 server.SetBypassProxy(oldBypassProxy); 123 } 124 else 125 { 126 if (!m_pState->Connect(server, true)) 127 return; 128 129 CRecentServerList::SetMostRecentServer(server); 130 } 115 131 } 116 132 117 133 void CQuickconnectBar::OnQuickconnectDropdown(wxCommandEvent& event) … … 119 135 wxMenu* pMenu = new wxMenu; 120 136 121 137 // We have to start with id 1 since menu items with id 0 don't work under OS X 122 pMenu->Append(1, _("Clear quickconnect bar")); 123 pMenu->Append(2, _("Clear history")); 138 pMenu->Append(1, _("Connect bypassing proxy settings")); 139 pMenu->Append(2, _("Clear quickconnect bar")); 140 pMenu->Append(3, _("Clear history")); 124 141 pMenu->AppendSeparator(); 125 142 126 143 m_recentServers = CRecentServerList::GetMostRecentServers(); … … 141 158 { 142 159 const int id = event.GetId(); 143 160 if (id == 1) 161 OnQuickconnect(event); 162 else if (id == 2) 144 163 ClearFields(); 145 else if (id == 2)164 else if (id == 3) 146 165 CRecentServerList::Clear(); 147 166 148 167 if (id < 10) -
src/interface/xmlfunctions.cpp
513 513 return false; 514 514 } 515 515 516 if (GetTextElementInt(node, "BypassProxy", false) == 0) 517 server.SetBypassProxy(false); 518 else 519 server.SetBypassProxy(true); 520 516 521 return true; 517 522 } 518 523 … … 580 585 AddTextElement(pElement, "Command", *iter); 581 586 } 582 587 } 588 589 AddTextElement(node, "BypassProxy", server.GetBypassProxy()); 583 590 } 584 591 585 592 void SetTextAttribute(TiXmlElement* node, const char* name, const wxString& value) -
src/include/server.h
71 71 int GetTimezoneOffset() const; 72 72 enum PasvMode GetPasvMode() const; 73 73 int MaximumMultipleConnections() const; 74 bool GetBypassProxy() const; 74 75 75 76 // Return true if URL could be parsed correctly, false otherwise. 76 77 // If parsing fails, pError is filled with the reason and the CServer instance may be left an undefined state. … … 112 113 // These commands will be executed after a successful login. 113 114 const std::vector<wxString>& GetPostLoginCommands() const { return m_postLoginCommands; } 114 115 bool SetPostLoginCommands(const std::vector<wxString>& postLoginCommands); 116 void SetBypassProxy(bool val); 115 117 116 118 protected: 117 119 void Initialize(); … … 131 133 wxString m_customEncoding; 132 134 133 135 std::vector<wxString> m_postLoginCommands; 136 bool m_bypassProxy; 134 137 }; 135 138 136 139 #endif -
src/engine/server.cpp
228 228 m_encodingType = op.m_encodingType; 229 229 m_customEncoding = op.m_customEncoding; 230 230 m_postLoginCommands = op.m_postLoginCommands; 231 m_bypassProxy = op.m_bypassProxy; 231 232 232 233 return *this; 233 234 } … … 546 547 m_maximumMultipleConnections = 0; 547 548 m_encodingType = ENCODING_AUTO; 548 549 m_customEncoding = _T(""); 550 m_bypassProxy = false; 549 551 } 550 552 551 553 bool CServer::SetEncodingType(enum CharsetEncoding type, const wxString& encoding /*=_T("")*/) … … 681 683 682 684 return _T(""); 683 685 } 686 687 void CServer::SetBypassProxy(bool val) 688 { 689 m_bypassProxy = val; 690 } 691 692 bool CServer::GetBypassProxy() const 693 { 694 return m_bypassProxy; 695 } -
src/engine/ftpcontrolsocket.cpp
524 524 pData->loginSequence.clear(); 525 525 526 526 int proxyType = m_pEngine->GetOptions()->GetOptionVal(OPTION_FTP_PROXY_TYPE); 527 if (!proxyType )527 if (!proxyType || server.GetBypassProxy()) 528 528 { 529 529 // User 530 530 t_loginCommand cmd = {false, false, user, _T("")}; … … 4142 4142 CFtpLogonOpData* pData = new CFtpLogonOpData; 4143 4143 m_pCurOpData = pData; 4144 4144 4145 if (m_pEngine->GetOptions()->GetOptionVal(OPTION_FTP_PROXY_TYPE) )4145 if (m_pEngine->GetOptions()->GetOptionVal(OPTION_FTP_PROXY_TYPE) && !server.GetBypassProxy()) 4146 4146 { 4147 4147 pData->host = m_pEngine->GetOptions()->GetOption(OPTION_FTP_PROXY_HOST); 4148 4148 int pos = pData->host.Find(':');