mirror of
https://github.com/dolphin-emu/dolphin.git
synced 2025-07-23 14:19:46 -06:00
DolphinWX: Kill off trivial event tables
Also fixes some of the wonky stuff in Main where we would fire an event to do post-init stuff which isn't necessary anymore.
This commit is contained in:
@ -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("");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user