Ticket #5067: filezilla.5067.patch

File filezilla.5067.patch, 5.5 KB (added by Tautvydas Andrikys, 12 years ago)

Implementation of this feature

  • src/interface/Mainfrm.cpp

    #5067 Already Connected dialog should include option to set choice as default
    
    diff -r 72b1ce0069e4 -r 1841d4867165 src/interface/Mainfrm.cpp
    a b  
    27532753            else
    27542754                XRCCTRL(dlg, "ID_NEWTAB", wxRadioButton)->SetValue(true);
    27552755
    2756             if (dlg.ShowModal() != wxID_OK)
     2756            int remembered = COptions::Get()->GetOptionVal(OPTION_ALREADYCONNECTED_REMEMBER);
     2757            wxCheckBox* remember = XRCCTRL(dlg, "ID_REMEMBERTAB", wxCheckBox);
     2758            remember->SetValue(remembered != 0);
     2759            if (remembered != 1 && dlg.ShowModal() != wxID_OK)
    27572760                return false;
    27582761
     2762            COptions::Get()->SetOption(OPTION_ALREADYCONNECTED_REMEMBER, remember->GetValue() ? 1 : 0);         
     2763           
    27592764            if (XRCCTRL(dlg, "ID_NEWTAB", wxRadioButton)->GetValue())
    27602765            {
    27612766                m_pContextControl->CreateTab();
  • src/interface/Options.cpp

    diff -r 72b1ce0069e4 -r 1841d4867165 src/interface/Options.cpp
    a b  
    172172    { "Enable invalid char filter", number, _T("1"), normal },
    173173    { "Invalid char replace", string, _T("_"), normal },
    174174    { "Already connected choice", number, _T("0"), normal },
     175    { "Remember already connected", number, _T("1"), normal },
    175176    { "Edit status dialog size", string, _T(""), normal },
    176177    { "Display current speed", number, _T("0"), normal },
    177178    { "Toolbar hidden", number, _T("0"), normal },
  • src/interface/Options.h

    diff -r 72b1ce0069e4 -r 1841d4867165 src/interface/Options.h
    a b  
    7777    OPTION_INVALID_CHAR_REPLACE_ENABLE,
    7878    OPTION_INVALID_CHAR_REPLACE,
    7979    OPTION_ALREADYCONNECTED_CHOICE,
     80    OPTION_ALREADYCONNECTED_REMEMBER,
    8081    OPTION_EDITSTATUSDIALOG_SIZE,
    8182    OPTION_SPEED_DISPLAY,
    8283    OPTION_TOOLBAR_HIDDEN,
  • src/interface/resources/dialogs.xrc

    diff -r 72b1ce0069e4 -r 1841d4867165 src/interface/resources/dialogs.xrc
    a b  
    48024802                  <label>Abort previous connection and connect in current tab</label>
    48034803                </object>
    48044804              </object>
     4805              <object class="sizeritem">
     4806                <object class="wxCheckBox" name="ID_REMEMBERTAB">
     4807                  <label>Remember my choice next time</label>
     4808                </object>
     4809              </object>
    48054810              <cols>1</cols>
    48064811              <vgap>5</vgap>
    48074812            </object>
  • src/interface/resources/settings.xrc

    diff -r 72b1ce0069e4 -r 1841d4867165 src/interface/resources/settings.xrc
    a b  
    182182            <flag>wxBOTTOM|wxLEFT|wxRIGHT</flag>
    183183            <border>4</border>
    184184          </object>
     185          <object class="sizeritem">
     186            <object class="wxFlexGridSizer">
     187              <object class="sizeritem">
     188                <object class="wxCheckBox" name="ID_REMEMBERRECONNECTTAB_SETTING">
     189                  <label>Remember current already connected action</label>
     190                </object>
     191              </object>
     192              <cols>1</cols>
     193              <vgap>5</vgap>
     194            </object>
     195            <flag>wxBOTTOM|wxLEFT|wxRIGHT</flag>
     196            <border>4</border>
     197          </object>
    185198          <label>Reconnection settings</label>
    186199          <orient>wxVERTICAL</orient>
    187200        </object>
  • src/interface/settings/optionspage_connection.cpp

    diff -r 72b1ce0069e4 -r 1841d4867165 src/interface/settings/optionspage_connection.cpp
    a b  
    1515    SetTextFromOption(XRCID("ID_RETRIES"), OPTION_RECONNECTCOUNT, failure);
    1616    SetTextFromOption(XRCID("ID_RETRYDELAY"), OPTION_RECONNECTDELAY, failure);
    1717    SetTextFromOption(XRCID("ID_TIMEOUT"), OPTION_TIMEOUT, failure);
     18    SetCheckFromOption(XRCID("ID_REMEMBERRECONNECTTAB_SETTING"), OPTION_ALREADYCONNECTED_REMEMBER, failure);
    1819    return !failure;
    1920}
    2021
     
    2324    SetIntOptionFromText(XRCID("ID_RETRIES"), OPTION_RECONNECTCOUNT);
    2425    SetIntOptionFromText(XRCID("ID_RETRYDELAY"), OPTION_RECONNECTDELAY);
    2526    SetOptionFromText(XRCID("ID_TIMEOUT"), OPTION_TIMEOUT);
     27    SetOptionFromCheck(XRCID("ID_REMEMBERRECONNECTTAB_SETTING"), OPTION_ALREADYCONNECTED_REMEMBER);
    2628    return true;
    2729}
    2830
  • src/interface/settings/optionspage_transfer.cpp

    diff -r 72b1ce0069e4 -r 1841d4867165 src/interface/settings/optionspage_transfer.cpp
    a b  
    5858    pTextCtrl->SetMaxLength(1);
    5959    pTextCtrl->ChangeValue(m_pOptions->GetOption(OPTION_INVALID_CHAR_REPLACE));
    6060
    61     SetCheckFromOption(XRCID("ID_ENABLE_REPLACE"), OPTION_INVALID_CHAR_REPLACE_ENABLE, failure);
     61    SetCheckFromOption(XRCID("ID_ENABLE_REPLACE"), OPTION_INVALID_CHAR_REPLACE_ENABLE, failure);   
    6262
    6363#ifdef __WXMSW__
    6464    wxString invalid = _T("\\ / : * ? \" < > |");
     
    8282    SetOptionFromText(XRCID("ID_UPLOADLIMIT"), OPTION_SPEEDLIMIT_OUTBOUND);
    8383    m_pOptions->SetOption(OPTION_SPEEDLIMIT_BURSTTOLERANCE, GetChoice(XRCID("ID_BURSTTOLERANCE")));
    8484    SetOptionFromText(XRCID("ID_REPLACE"), OPTION_INVALID_CHAR_REPLACE);
    85     SetOptionFromCheck(XRCID("ID_ENABLE_REPLACE"), OPTION_INVALID_CHAR_REPLACE_ENABLE);
     85    SetOptionFromCheck(XRCID("ID_ENABLE_REPLACE"), OPTION_INVALID_CHAR_REPLACE_ENABLE); 
    8686
    8787    return true;
    8888}