diff options
| author | Star Rauchenberger <fefferburbia@gmail.com> | 2024-03-07 10:31:22 -0500 |
|---|---|---|
| committer | Star Rauchenberger <fefferburbia@gmail.com> | 2024-03-07 10:31:22 -0500 |
| commit | d0029a806b8b6d244a6a3ec5b243303a8203cdd5 (patch) | |
| tree | 978cfb8fc9ec880a99b0a4c0c1d8ffa2503db622 /src/tracker_frame.cpp | |
| parent | 10d6eff4dc1ab7a79920721c0fe2ed371d7dfaf3 (diff) | |
| download | lingo-ap-tracker-d0029a806b8b6d244a6a3ec5b243303a8203cdd5.tar.gz lingo-ap-tracker-d0029a806b8b6d244a6a3ec5b243303a8203cdd5.tar.bz2 lingo-ap-tracker-d0029a806b8b6d244a6a3ec5b243303a8203cdd5.zip | |
Added connection history
Diffstat (limited to 'src/tracker_frame.cpp')
| -rw-r--r-- | src/tracker_frame.cpp | 21 |
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(), |
