about summary refs log tree commit diff stats
path: root/src/tracker_frame.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/tracker_frame.cpp')
-rw-r--r--src/tracker_frame.cpp21
1 files changed, 18 insertions, 3 deletions
diff --git a/src/tracker_frame.cpp b/src/tracker_frame.cpp index a8c1063..d64e0d3 100644 --- a/src/tracker_frame.cpp +++ b/src/tracker_frame.cpp
@@ -115,9 +115,24 @@ void TrackerFrame::OnConnect(wxCommandEvent &event) {
115 ConnectionDialog dlg; 115 ConnectionDialog dlg;
116 116
117 if (dlg.ShowModal() == wxID_OK) { 117 if (dlg.ShowModal() == wxID_OK) {
118 GetTrackerConfig().ap_server = dlg.GetServerValue(); 118 GetTrackerConfig().connection_details.ap_server = dlg.GetServerValue();
119 GetTrackerConfig().ap_player = dlg.GetPlayerValue(); 119 GetTrackerConfig().connection_details.ap_player = dlg.GetPlayerValue();
120 GetTrackerConfig().ap_password = dlg.GetPasswordValue(); 120 GetTrackerConfig().connection_details.ap_password = dlg.GetPasswordValue();
121
122 std::deque<ConnectionDetails> new_history;
123 new_history.push_back(GetTrackerConfig().connection_details);
124
125 for (const ConnectionDetails& details : GetTrackerConfig().connection_history) {
126 if (details != GetTrackerConfig().connection_details) {
127 new_history.push_back(details);
128 }
129 }
130
131 while (new_history.size() > 5) {
132 new_history.pop_back();
133 }
134
135 GetTrackerConfig().connection_history = std::move(new_history);
121 GetTrackerConfig().Save(); 136 GetTrackerConfig().Save();
122 137
123 AP_Connect(dlg.GetServerValue(), dlg.GetPlayerValue(), 138 AP_Connect(dlg.GetServerValue(), dlg.GetPlayerValue(),