diff options
Diffstat (limited to 'src/tracker_frame.cpp')
-rw-r--r-- | src/tracker_frame.cpp | 26 |
1 files changed, 26 insertions, 0 deletions
diff --git a/src/tracker_frame.cpp b/src/tracker_frame.cpp index 4a4e3b5..6a4ab2e 100644 --- a/src/tracker_frame.cpp +++ b/src/tracker_frame.cpp | |||
@@ -18,6 +18,8 @@ | |||
18 | #include "ipc_dialog.h" | 18 | #include "ipc_dialog.h" |
19 | #include "ipc_state.h" | 19 | #include "ipc_state.h" |
20 | #include "items_pane.h" | 20 | #include "items_pane.h" |
21 | #include "log_dialog.h" | ||
22 | #include "logger.h" | ||
21 | #include "options_pane.h" | 23 | #include "options_pane.h" |
22 | #include "paintings_pane.h" | 24 | #include "paintings_pane.h" |
23 | #include "settings_dialog.h" | 25 | #include "settings_dialog.h" |
@@ -50,6 +52,7 @@ enum TrackerFrameIds { | |||
50 | ID_ZOOM_OUT = 5, | 52 | ID_ZOOM_OUT = 5, |
51 | ID_OPEN_SAVE_FILE = 6, | 53 | ID_OPEN_SAVE_FILE = 6, |
52 | ID_IPC_CONNECT = 7, | 54 | ID_IPC_CONNECT = 7, |
55 | ID_LOG_DIALOG = 8, | ||
53 | }; | 56 | }; |
54 | 57 | ||
55 | wxDEFINE_EVENT(STATE_RESET, wxCommandEvent); | 58 | wxDEFINE_EVENT(STATE_RESET, wxCommandEvent); |
@@ -80,6 +83,8 @@ TrackerFrame::TrackerFrame() | |||
80 | wxMenu *menuView = new wxMenu(); | 83 | wxMenu *menuView = new wxMenu(); |
81 | zoom_in_menu_item_ = menuView->Append(ID_ZOOM_IN, "Zoom In\tCtrl-+"); | 84 | zoom_in_menu_item_ = menuView->Append(ID_ZOOM_IN, "Zoom In\tCtrl-+"); |
82 | zoom_out_menu_item_ = menuView->Append(ID_ZOOM_OUT, "Zoom Out\tCtrl--"); | 85 | zoom_out_menu_item_ = menuView->Append(ID_ZOOM_OUT, "Zoom Out\tCtrl--"); |
86 | menuView->AppendSeparator(); | ||
87 | menuView->Append(ID_LOG_DIALOG, "Show Log Window\tCtrl-L"); | ||
83 | 88 | ||
84 | zoom_in_menu_item_->Enable(false); | 89 | zoom_in_menu_item_->Enable(false); |
85 | zoom_out_menu_item_->Enable(false); | 90 | zoom_out_menu_item_->Enable(false); |
@@ -106,6 +111,7 @@ TrackerFrame::TrackerFrame() | |||
106 | ID_CHECK_FOR_UPDATES); | 111 | ID_CHECK_FOR_UPDATES); |
107 | Bind(wxEVT_MENU, &TrackerFrame::OnZoomIn, this, ID_ZOOM_IN); | 112 | Bind(wxEVT_MENU, &TrackerFrame::OnZoomIn, this, ID_ZOOM_IN); |
108 | Bind(wxEVT_MENU, &TrackerFrame::OnZoomOut, this, ID_ZOOM_OUT); | 113 | Bind(wxEVT_MENU, &TrackerFrame::OnZoomOut, this, ID_ZOOM_OUT); |
114 | Bind(wxEVT_MENU, &TrackerFrame::OnOpenLogWindow, this, ID_LOG_DIALOG); | ||
109 | Bind(wxEVT_NOTEBOOK_PAGE_CHANGED, &TrackerFrame::OnChangePage, this); | 115 | Bind(wxEVT_NOTEBOOK_PAGE_CHANGED, &TrackerFrame::OnChangePage, this); |
110 | Bind(wxEVT_MENU, &TrackerFrame::OnOpenFile, this, ID_OPEN_SAVE_FILE); | 116 | Bind(wxEVT_MENU, &TrackerFrame::OnOpenFile, this, ID_OPEN_SAVE_FILE); |
111 | Bind(wxEVT_SPLITTER_SASH_POS_CHANGED, &TrackerFrame::OnSashPositionChanged, | 117 | Bind(wxEVT_SPLITTER_SASH_POS_CHANGED, &TrackerFrame::OnSashPositionChanged, |
@@ -270,6 +276,26 @@ void TrackerFrame::OnZoomOut(wxCommandEvent &event) { | |||
270 | } | 276 | } |
271 | } | 277 | } |
272 | 278 | ||
279 | void TrackerFrame::OnOpenLogWindow(wxCommandEvent &event) { | ||
280 | if (log_dialog_ == nullptr) { | ||
281 | log_dialog_ = new LogDialog(this); | ||
282 | log_dialog_->Show(); | ||
283 | TrackerSetLogDialog(log_dialog_); | ||
284 | |||
285 | log_dialog_->Bind(wxEVT_CLOSE_WINDOW, &TrackerFrame::OnCloseLogWindow, | ||
286 | this); | ||
287 | } else { | ||
288 | log_dialog_->SetFocus(); | ||
289 | } | ||
290 | } | ||
291 | |||
292 | void TrackerFrame::OnCloseLogWindow(wxCloseEvent& event) { | ||
293 | TrackerSetLogDialog(nullptr); | ||
294 | log_dialog_ = nullptr; | ||
295 | |||
296 | event.Skip(); | ||
297 | } | ||
298 | |||
273 | void TrackerFrame::OnChangePage(wxBookCtrlEvent &event) { | 299 | void TrackerFrame::OnChangePage(wxBookCtrlEvent &event) { |
274 | zoom_in_menu_item_->Enable(event.GetSelection() == 1); | 300 | zoom_in_menu_item_->Enable(event.GetSelection() == 1); |
275 | zoom_out_menu_item_->Enable(event.GetSelection() == 1); | 301 | zoom_out_menu_item_->Enable(event.GetSelection() == 1); |