diff options
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(""); } } } |
