diff options
| author | skidau <skidau@gmail.com> | 2014-11-11 11:55:49 +1100 |
|---|---|---|
| committer | skidau <skidau@gmail.com> | 2014-11-11 11:55:49 +1100 |
| commit | 71d8165a8649cde73663b1534bbdd6094faecf2d (patch) | |
| tree | d7fd65e5d6392b61b8fbb22b886cbc40fc06d0af /Source/Core/DolphinWX/Main.cpp | |
| parent | 974dd2101901196d30ba09e5e7e5a6fc0f57ada2 (diff) | |
| parent | ac387031a4b62baa96935c422c16e54dd0284a1b (diff) | |
Merge pull request #1518 from lioncash/evt
DolphinWX: Kill off trivial event tables
Diffstat (limited to 'Source/Core/DolphinWX/Main.cpp')
| -rw-r--r-- | Source/Core/DolphinWX/Main.cpp | 28 |
1 files changed, 8 insertions, 20 deletions
diff --git a/Source/Core/DolphinWX/Main.cpp b/Source/Core/DolphinWX/Main.cpp index 9ce0c3628e..5212887ae0 100644 --- a/Source/Core/DolphinWX/Main.cpp +++ b/Source/Core/DolphinWX/Main.cpp @@ -89,12 +89,6 @@ class wxFrame; IMPLEMENT_APP(DolphinApp) -BEGIN_EVENT_TABLE(DolphinApp, wxApp) - EVT_TIMER(wxID_ANY, DolphinApp::AfterInit) - EVT_QUERY_END_SESSION(DolphinApp::OnEndSession) - EVT_END_SESSION(DolphinApp::OnEndSession) -END_EVENT_TABLE() - bool wxMsgAlert(const char*, const char*, bool, int); std::string wxStringTranslator(const char *); @@ -138,6 +132,9 @@ bool DolphinApp::Initialize(int& c, wxChar **v) bool DolphinApp::OnInit() { + Bind(wxEVT_QUERY_END_SESSION, &DolphinApp::OnEndSession, this); + Bind(wxEVT_END_SESSION, &DolphinApp::OnEndSession, this); + InitLanguageSupport(); // Declarations and definitions @@ -309,18 +306,14 @@ bool DolphinApp::OnInit() y = wxDefaultCoord; #endif - main_frame = new CFrame((wxFrame*)nullptr, wxID_ANY, + main_frame = new CFrame(nullptr, wxID_ANY, StrToWxStr(scm_rev_str), wxPoint(x, y), wxSize(w, h), UseDebugger, BatchMode, UseLogger); SetTopWindow(main_frame); main_frame->SetMinSize(wxSize(400, 300)); - // Postpone final actions until event handler is running. - // Updating the game list makes use of wxProgressDialog which may - // only be run after OnInit() when the event handler is running. - m_afterinit = new wxTimer(this, wxID_ANY); - m_afterinit->Start(1, wxTIMER_ONE_SHOT); + AfterInit(); return true; } @@ -329,16 +322,11 @@ void DolphinApp::MacOpenFile(const wxString &fileName) { FileToLoad = fileName; LoadFile = true; - - if (m_afterinit == nullptr) - main_frame->BootGame(WxStrToStr(FileToLoad)); + main_frame->BootGame(WxStrToStr(FileToLoad)); } -void DolphinApp::AfterInit(wxTimerEvent& WXUNUSED(event)) +void DolphinApp::AfterInit() { - delete m_afterinit; - m_afterinit = nullptr; - if (!BatchMode) main_frame->UpdateGameList(); @@ -352,7 +340,7 @@ void DolphinApp::AfterInit(wxTimerEvent& WXUNUSED(event)) } else { - main_frame->BootGame(std::string("")); + main_frame->BootGame(""); } } } |
