diff options
author | Star Rauchenberger <fefferburbia@gmail.com> | 2023-11-17 10:11:41 -0500 |
---|---|---|
committer | Star Rauchenberger <fefferburbia@gmail.com> | 2023-11-17 10:11:41 -0500 |
commit | a9bc708c7eeeada4c59952ce71aa071175f8f27d (patch) | |
tree | b55d7ae50b2e96a44319ba7ec97cebe32fe2febf /src/tracker_frame.cpp | |
parent | 2ee15755735ff6243d3e3b1c2ade4d9bbe0b6dc6 (diff) | |
download | lingo-ap-tracker-a9bc708c7eeeada4c59952ce71aa071175f8f27d.tar.gz lingo-ap-tracker-a9bc708c7eeeada4c59952ce71aa071175f8f27d.tar.bz2 lingo-ap-tracker-a9bc708c7eeeada4c59952ce71aa071175f8f27d.zip |
Added hybrid areas and settings dialog
Diffstat (limited to 'src/tracker_frame.cpp')
-rw-r--r-- | src/tracker_frame.cpp | 22 |
1 files changed, 21 insertions, 1 deletions
diff --git a/src/tracker_frame.cpp b/src/tracker_frame.cpp index a74e81e..5341fa6 100644 --- a/src/tracker_frame.cpp +++ b/src/tracker_frame.cpp | |||
@@ -9,11 +9,16 @@ | |||
9 | #include "achievements_pane.h" | 9 | #include "achievements_pane.h" |
10 | #include "ap_state.h" | 10 | #include "ap_state.h" |
11 | #include "connection_dialog.h" | 11 | #include "connection_dialog.h" |
12 | #include "settings_dialog.h" | ||
12 | #include "tracker_config.h" | 13 | #include "tracker_config.h" |
13 | #include "tracker_panel.h" | 14 | #include "tracker_panel.h" |
14 | #include "version.h" | 15 | #include "version.h" |
15 | 16 | ||
16 | enum TrackerFrameIds { ID_CONNECT = 1, ID_CHECK_FOR_UPDATES = 2 }; | 17 | enum TrackerFrameIds { |
18 | ID_CONNECT = 1, | ||
19 | ID_CHECK_FOR_UPDATES = 2, | ||
20 | ID_SETTINGS = 3 | ||
21 | }; | ||
17 | 22 | ||
18 | wxDEFINE_EVENT(STATE_CHANGED, wxCommandEvent); | 23 | wxDEFINE_EVENT(STATE_CHANGED, wxCommandEvent); |
19 | wxDEFINE_EVENT(STATUS_CHANGED, wxCommandEvent); | 24 | wxDEFINE_EVENT(STATUS_CHANGED, wxCommandEvent); |
@@ -29,6 +34,7 @@ TrackerFrame::TrackerFrame() | |||
29 | 34 | ||
30 | wxMenu *menuFile = new wxMenu(); | 35 | wxMenu *menuFile = new wxMenu(); |
31 | menuFile->Append(ID_CONNECT, "&Connect"); | 36 | menuFile->Append(ID_CONNECT, "&Connect"); |
37 | menuFile->Append(ID_SETTINGS, "&Settings"); | ||
32 | menuFile->Append(wxID_EXIT); | 38 | menuFile->Append(wxID_EXIT); |
33 | 39 | ||
34 | wxMenu *menuHelp = new wxMenu(); | 40 | wxMenu *menuHelp = new wxMenu(); |
@@ -47,6 +53,7 @@ TrackerFrame::TrackerFrame() | |||
47 | Bind(wxEVT_MENU, &TrackerFrame::OnAbout, this, wxID_ABOUT); | 53 | Bind(wxEVT_MENU, &TrackerFrame::OnAbout, this, wxID_ABOUT); |
48 | Bind(wxEVT_MENU, &TrackerFrame::OnExit, this, wxID_EXIT); | 54 | Bind(wxEVT_MENU, &TrackerFrame::OnExit, this, wxID_EXIT); |
49 | Bind(wxEVT_MENU, &TrackerFrame::OnConnect, this, ID_CONNECT); | 55 | Bind(wxEVT_MENU, &TrackerFrame::OnConnect, this, ID_CONNECT); |
56 | Bind(wxEVT_MENU, &TrackerFrame::OnSettings, this, ID_SETTINGS); | ||
50 | Bind(wxEVT_MENU, &TrackerFrame::OnCheckForUpdates, this, | 57 | Bind(wxEVT_MENU, &TrackerFrame::OnCheckForUpdates, this, |
51 | ID_CHECK_FOR_UPDATES); | 58 | ID_CHECK_FOR_UPDATES); |
52 | Bind(STATE_CHANGED, &TrackerFrame::OnStateChanged, this); | 59 | Bind(STATE_CHANGED, &TrackerFrame::OnStateChanged, this); |
@@ -119,6 +126,19 @@ void TrackerFrame::OnConnect(wxCommandEvent &event) { | |||
119 | } | 126 | } |
120 | } | 127 | } |
121 | 128 | ||
129 | void TrackerFrame::OnSettings(wxCommandEvent &event) { | ||
130 | SettingsDialog dlg; | ||
131 | |||
132 | if (dlg.ShowModal() == wxID_OK) { | ||
133 | GetTrackerConfig().should_check_for_updates = | ||
134 | dlg.GetShouldCheckForUpdates(); | ||
135 | GetTrackerConfig().hybrid_areas = dlg.GetHybridAreas(); | ||
136 | GetTrackerConfig().Save(); | ||
137 | |||
138 | UpdateIndicators(); | ||
139 | } | ||
140 | } | ||
141 | |||
122 | void TrackerFrame::OnCheckForUpdates(wxCommandEvent &event) { | 142 | void TrackerFrame::OnCheckForUpdates(wxCommandEvent &event) { |
123 | CheckForUpdates(/*manual=*/true); | 143 | CheckForUpdates(/*manual=*/true); |
124 | } | 144 | } |