#5067 Already Connected dialog should include option to set choice as default
diff -r 72b1ce0069e4 -r 1841d4867165 src/interface/Mainfrm.cpp
a
|
b
|
|
2753 | 2753 | else |
2754 | 2754 | XRCCTRL(dlg, "ID_NEWTAB", wxRadioButton)->SetValue(true); |
2755 | 2755 | |
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) |
2757 | 2760 | return false; |
2758 | 2761 | |
| 2762 | COptions::Get()->SetOption(OPTION_ALREADYCONNECTED_REMEMBER, remember->GetValue() ? 1 : 0); |
| 2763 | |
2759 | 2764 | if (XRCCTRL(dlg, "ID_NEWTAB", wxRadioButton)->GetValue()) |
2760 | 2765 | { |
2761 | 2766 | m_pContextControl->CreateTab(); |
diff -r 72b1ce0069e4 -r 1841d4867165 src/interface/Options.cpp
a
|
b
|
|
172 | 172 | { "Enable invalid char filter", number, _T("1"), normal }, |
173 | 173 | { "Invalid char replace", string, _T("_"), normal }, |
174 | 174 | { "Already connected choice", number, _T("0"), normal }, |
| 175 | { "Remember already connected", number, _T("1"), normal }, |
175 | 176 | { "Edit status dialog size", string, _T(""), normal }, |
176 | 177 | { "Display current speed", number, _T("0"), normal }, |
177 | 178 | { "Toolbar hidden", number, _T("0"), normal }, |
diff -r 72b1ce0069e4 -r 1841d4867165 src/interface/Options.h
a
|
b
|
|
77 | 77 | OPTION_INVALID_CHAR_REPLACE_ENABLE, |
78 | 78 | OPTION_INVALID_CHAR_REPLACE, |
79 | 79 | OPTION_ALREADYCONNECTED_CHOICE, |
| 80 | OPTION_ALREADYCONNECTED_REMEMBER, |
80 | 81 | OPTION_EDITSTATUSDIALOG_SIZE, |
81 | 82 | OPTION_SPEED_DISPLAY, |
82 | 83 | OPTION_TOOLBAR_HIDDEN, |
diff -r 72b1ce0069e4 -r 1841d4867165 src/interface/resources/dialogs.xrc
a
|
b
|
|
4802 | 4802 | <label>Abort previous connection and connect in current tab</label> |
4803 | 4803 | </object> |
4804 | 4804 | </object> |
| 4805 | <object class="sizeritem"> |
| 4806 | <object class="wxCheckBox" name="ID_REMEMBERTAB"> |
| 4807 | <label>Remember my choice next time</label> |
| 4808 | </object> |
| 4809 | </object> |
4805 | 4810 | <cols>1</cols> |
4806 | 4811 | <vgap>5</vgap> |
4807 | 4812 | </object> |
diff -r 72b1ce0069e4 -r 1841d4867165 src/interface/resources/settings.xrc
a
|
b
|
|
182 | 182 | <flag>wxBOTTOM|wxLEFT|wxRIGHT</flag> |
183 | 183 | <border>4</border> |
184 | 184 | </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> |
185 | 198 | <label>Reconnection settings</label> |
186 | 199 | <orient>wxVERTICAL</orient> |
187 | 200 | </object> |
diff -r 72b1ce0069e4 -r 1841d4867165 src/interface/settings/optionspage_connection.cpp
a
|
b
|
|
15 | 15 | SetTextFromOption(XRCID("ID_RETRIES"), OPTION_RECONNECTCOUNT, failure); |
16 | 16 | SetTextFromOption(XRCID("ID_RETRYDELAY"), OPTION_RECONNECTDELAY, failure); |
17 | 17 | SetTextFromOption(XRCID("ID_TIMEOUT"), OPTION_TIMEOUT, failure); |
| 18 | SetCheckFromOption(XRCID("ID_REMEMBERRECONNECTTAB_SETTING"), OPTION_ALREADYCONNECTED_REMEMBER, failure); |
18 | 19 | return !failure; |
19 | 20 | } |
20 | 21 | |
… |
… |
|
23 | 24 | SetIntOptionFromText(XRCID("ID_RETRIES"), OPTION_RECONNECTCOUNT); |
24 | 25 | SetIntOptionFromText(XRCID("ID_RETRYDELAY"), OPTION_RECONNECTDELAY); |
25 | 26 | SetOptionFromText(XRCID("ID_TIMEOUT"), OPTION_TIMEOUT); |
| 27 | SetOptionFromCheck(XRCID("ID_REMEMBERRECONNECTTAB_SETTING"), OPTION_ALREADYCONNECTED_REMEMBER); |
26 | 28 | return true; |
27 | 29 | } |
28 | 30 | |
diff -r 72b1ce0069e4 -r 1841d4867165 src/interface/settings/optionspage_transfer.cpp
a
|
b
|
|
58 | 58 | pTextCtrl->SetMaxLength(1); |
59 | 59 | pTextCtrl->ChangeValue(m_pOptions->GetOption(OPTION_INVALID_CHAR_REPLACE)); |
60 | 60 | |
61 | | SetCheckFromOption(XRCID("ID_ENABLE_REPLACE"), OPTION_INVALID_CHAR_REPLACE_ENABLE, failure); |
| 61 | SetCheckFromOption(XRCID("ID_ENABLE_REPLACE"), OPTION_INVALID_CHAR_REPLACE_ENABLE, failure); |
62 | 62 | |
63 | 63 | #ifdef __WXMSW__ |
64 | 64 | wxString invalid = _T("\\ / : * ? \" < > |"); |
… |
… |
|
82 | 82 | SetOptionFromText(XRCID("ID_UPLOADLIMIT"), OPTION_SPEEDLIMIT_OUTBOUND); |
83 | 83 | m_pOptions->SetOption(OPTION_SPEEDLIMIT_BURSTTOLERANCE, GetChoice(XRCID("ID_BURSTTOLERANCE"))); |
84 | 84 | 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); |
86 | 86 | |
87 | 87 | return true; |
88 | 88 | } |