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.cpp13
1 files changed, 13 insertions, 0 deletions
diff --git a/src/tracker_frame.cpp b/src/tracker_frame.cpp index 70fee2d..e944704 100644 --- a/src/tracker_frame.cpp +++ b/src/tracker_frame.cpp
@@ -22,6 +22,7 @@ enum TrackerFrameIds {
22 ID_SETTINGS = 3 22 ID_SETTINGS = 3
23}; 23};
24 24
25wxDEFINE_EVENT(STATE_RESET, wxCommandEvent);
25wxDEFINE_EVENT(STATE_CHANGED, wxCommandEvent); 26wxDEFINE_EVENT(STATE_CHANGED, wxCommandEvent);
26wxDEFINE_EVENT(STATUS_CHANGED, wxCommandEvent); 27wxDEFINE_EVENT(STATUS_CHANGED, wxCommandEvent);
27 28
@@ -56,6 +57,7 @@ TrackerFrame::TrackerFrame()
56 Bind(wxEVT_MENU, &TrackerFrame::OnSettings, this, ID_SETTINGS); 57 Bind(wxEVT_MENU, &TrackerFrame::OnSettings, this, ID_SETTINGS);
57 Bind(wxEVT_MENU, &TrackerFrame::OnCheckForUpdates, this, 58 Bind(wxEVT_MENU, &TrackerFrame::OnCheckForUpdates, this,
58 ID_CHECK_FOR_UPDATES); 59 ID_CHECK_FOR_UPDATES);
60 Bind(STATE_RESET, &TrackerFrame::OnStateReset, this);
59 Bind(STATE_CHANGED, &TrackerFrame::OnStateChanged, this); 61 Bind(STATE_CHANGED, &TrackerFrame::OnStateChanged, this);
60 Bind(STATUS_CHANGED, &TrackerFrame::OnStatusChanged, this); 62 Bind(STATUS_CHANGED, &TrackerFrame::OnStatusChanged, this);
61 63
@@ -103,6 +105,10 @@ void TrackerFrame::SetStatusMessage(std::string message) {
103 QueueEvent(event); 105 QueueEvent(event);
104} 106}
105 107
108void TrackerFrame::ResetIndicators() {
109 QueueEvent(new wxCommandEvent(STATE_RESET));
110}
111
106void TrackerFrame::UpdateIndicators() { 112void TrackerFrame::UpdateIndicators() {
107 QueueEvent(new wxCommandEvent(STATE_CHANGED)); 113 QueueEvent(new wxCommandEvent(STATE_CHANGED));
108} 114}
@@ -168,6 +174,13 @@ void TrackerFrame::OnCheckForUpdates(wxCommandEvent &event) {
168 CheckForUpdates(/*manual=*/true); 174 CheckForUpdates(/*manual=*/true);
169} 175}
170 176
177void TrackerFrame::OnStateReset(wxCommandEvent& event) {
178 tracker_panel_->UpdateIndicators();
179 achievements_pane_->UpdateIndicators();
180 subway_map_->OnConnect();
181 Refresh();
182}
183
171void TrackerFrame::OnStateChanged(wxCommandEvent &event) { 184void TrackerFrame::OnStateChanged(wxCommandEvent &event) {
172 tracker_panel_->UpdateIndicators(); 185 tracker_panel_->UpdateIndicators();
173 achievements_pane_->UpdateIndicators(); 186 achievements_pane_->UpdateIndicators();