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.cpp22
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
16enum TrackerFrameIds { ID_CONNECT = 1, ID_CHECK_FOR_UPDATES = 2 }; 17enum TrackerFrameIds {
18 ID_CONNECT = 1,
19 ID_CHECK_FOR_UPDATES = 2,
20 ID_SETTINGS = 3
21};
17 22
18wxDEFINE_EVENT(STATE_CHANGED, wxCommandEvent); 23wxDEFINE_EVENT(STATE_CHANGED, wxCommandEvent);
19wxDEFINE_EVENT(STATUS_CHANGED, wxCommandEvent); 24wxDEFINE_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
129void 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
122void TrackerFrame::OnCheckForUpdates(wxCommandEvent &event) { 142void TrackerFrame::OnCheckForUpdates(wxCommandEvent &event) {
123 CheckForUpdates(/*manual=*/true); 143 CheckForUpdates(/*manual=*/true);
124} 144}