Ticket #1528: filezilla_bypassProxy_rev2099.patch

File filezilla_bypassProxy_rev2099.patch, 8.6 KB (added by paolozambotti, 16 years ago)

diff from svn repository rev. 2099

  • src/interface/sitemanager.cpp

     
    11151115    else
    11161116        data->m_server.SetEncodingType(ENCODING_AUTO);
    11171117
     1118    if (XRCCTRL(*this, "ID_BYPASSPROXY", wxCheckBox)->GetValue())
     1119    {
     1120        data->m_server.SetBypassProxy(true);
     1121    }
     1122    else
     1123        data->m_server.SetBypassProxy(false);
    11181124    return true;
    11191125}
    11201126
     
    12121218        XRCCTRL(*this, "ID_HOST", wxTextCtrl)->SetValue(_T(""));
    12131219        XRCCTRL(*this, "ID_PORT", wxTextCtrl)->SetValue(_T(""));
    12141220        XRCCTRL(*this, "ID_PROTOCOL", wxChoice)->SetStringSelection(_("FTP"));
     1221        XRCCTRL(*this, "ID_BYPASSPROXY", wxCheckBox)->SetValue(false);
    12151222        XRCCTRL(*this, "ID_LOGONTYPE", wxChoice)->SetStringSelection(_("Anonymous"));
    12161223        XRCCTRL(*this, "ID_USER", wxTextCtrl)->SetValue(_T(""));
    12171224        XRCCTRL(*this, "ID_PASS", wxTextCtrl)->SetValue(_T(""));
     
    12581265        else
    12591266            XRCCTRL(*this, "ID_PROTOCOL", wxChoice)->SetStringSelection(CServer::GetProtocolName(FTP));
    12601267        XRCCTRL(*this, "ID_PROTOCOL", wxWindow)->Enable(!predefined);
     1268        XRCCTRL(*this, "ID_BYPASSPROXY", wxCheckBox)->SetValue(data->m_server.GetBypassProxy());
    12611269
    12621270        XRCCTRL(*this, "ID_USER", wxTextCtrl)->Enable(!predefined && data->m_server.GetLogonType() != ANONYMOUS);
    12631271        XRCCTRL(*this, "ID_PASS", wxTextCtrl)->Enable(!predefined && data->m_server.GetLogonType() == NORMAL || data->m_server.GetLogonType() == ACCOUNT);
  • src/interface/resources/dialogs.xrc

     
    788788                              <object class="wxChoice" name="ID_PROTOCOL">
    789789                                <content/>
    790790                                <selection>0</selection>
     791                                <size>260,-1</size>
    791792                              </object>
    792793                              <flag>wxGROW</flag>
    793794                            </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>&amp;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>
    794817                            <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">
    805818                              <object class="wxStaticText">
    806819                                <label>&amp;Logontype:</label>
    807820                              </object>
  • src/interface/quickconnectbar.cpp

     
    108108        return;
    109109    }
    110110
    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    }
    115131}
    116132
    117133void CQuickconnectBar::OnQuickconnectDropdown(wxCommandEvent& event)
     
    119135    wxMenu* pMenu = new wxMenu;
    120136
    121137    // 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"));
    124141    pMenu->AppendSeparator();
    125142
    126143    m_recentServers = CRecentServerList::GetMostRecentServers();
     
    141158{
    142159    const int id = event.GetId();
    143160    if (id == 1)
     161        OnQuickconnect(event);
     162    else if (id == 2)
    144163        ClearFields();
    145     else if (id == 2)
     164    else if (id == 3)
    146165        CRecentServerList::Clear();
    147166
    148167    if (id < 10)
  • src/interface/xmlfunctions.cpp

     
    513513            return false;
    514514    }
    515515   
     516    if (GetTextElementInt(node, "BypassProxy", false) == 0)
     517      server.SetBypassProxy(false);
     518    else
     519      server.SetBypassProxy(true);
     520       
    516521    return true;
    517522}
    518523
     
    580585                AddTextElement(pElement, "Command", *iter);
    581586        }
    582587    }
     588   
     589    AddTextElement(node, "BypassProxy", server.GetBypassProxy());
    583590}
    584591
    585592void SetTextAttribute(TiXmlElement* node, const char* name, const wxString& value)
  • src/include/server.h

     
    7171    int GetTimezoneOffset() const;
    7272    enum PasvMode GetPasvMode() const;
    7373    int MaximumMultipleConnections() const;
     74    bool GetBypassProxy() const;
    7475   
    7576    // Return true if URL could be parsed correctly, false otherwise.
    7677    // If parsing fails, pError is filled with the reason and the CServer instance may be left an undefined state.
     
    112113    // These commands will be executed after a successful login.
    113114    const std::vector<wxString>& GetPostLoginCommands() const { return m_postLoginCommands; }
    114115    bool SetPostLoginCommands(const std::vector<wxString>& postLoginCommands);
     116    void SetBypassProxy(bool val);
    115117
    116118protected:
    117119    void Initialize();
     
    131133    wxString m_customEncoding;
    132134
    133135    std::vector<wxString> m_postLoginCommands;
     136    bool m_bypassProxy;
    134137};
    135138
    136139#endif
  • src/engine/server.cpp

     
    228228    m_encodingType = op.m_encodingType;
    229229    m_customEncoding = op.m_customEncoding;
    230230    m_postLoginCommands = op.m_postLoginCommands;
     231    m_bypassProxy = op.m_bypassProxy;
    231232
    232233    return *this;
    233234}
     
    546547    m_maximumMultipleConnections = 0;
    547548    m_encodingType = ENCODING_AUTO;
    548549    m_customEncoding = _T("");
     550    m_bypassProxy = false;
    549551}
    550552
    551553bool CServer::SetEncodingType(enum CharsetEncoding type, const wxString& encoding /*=_T("")*/)
     
    681683
    682684    return _T("");
    683685}
     686
     687void CServer::SetBypassProxy(bool val)
     688{
     689  m_bypassProxy = val;
     690}
     691
     692bool CServer::GetBypassProxy() const
     693{
     694  return m_bypassProxy;
     695}
  • src/engine/ftpcontrolsocket.cpp

     
    524524    pData->loginSequence.clear();
    525525
    526526    int proxyType = m_pEngine->GetOptions()->GetOptionVal(OPTION_FTP_PROXY_TYPE);
    527     if (!proxyType)
     527    if (!proxyType || server.GetBypassProxy())
    528528    {
    529529        // User
    530530        t_loginCommand cmd = {false, false, user, _T("")};
     
    41424142    CFtpLogonOpData* pData = new CFtpLogonOpData;
    41434143    m_pCurOpData = pData;
    41444144
    4145     if (m_pEngine->GetOptions()->GetOptionVal(OPTION_FTP_PROXY_TYPE))
     4145    if (m_pEngine->GetOptions()->GetOptionVal(OPTION_FTP_PROXY_TYPE) && !server.GetBypassProxy())
    41464146    {
    41474147        pData->host = m_pEngine->GetOptions()->GetOption(OPTION_FTP_PROXY_HOST);
    41484148        int pos = pData->host.Find(':');