Reinstate AfterInit(), which is still needed for MacOpenFile()

to work properly and possibly also wxProgressDialog.


git-svn-id: https://dolphin-emu.googlecode.com/svn/trunk@7355 8ced0084-cf51-0410-be5f-012b33b47a6e
This commit is contained in:
Soren Jorvang
2011-03-16 01:50:46 +00:00
parent 5027554beb
commit da82d7e178
3 changed files with 19 additions and 6 deletions

View File

@ -51,6 +51,10 @@
IMPLEMENT_APP(DolphinApp)
BEGIN_EVENT_TABLE(DolphinApp, wxApp)
EVT_TIMER(wxID_ANY, DolphinApp::AfterInit)
END_EVENT_TABLE()
#include <wx/stdpaths.h>
bool wxMsgAlert(const char*, const char*, bool, int);
std::string wxStringTranslator(const char *);
@ -321,6 +325,12 @@ bool DolphinApp::OnInit()
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);
return true;
}
@ -329,12 +339,15 @@ void DolphinApp::MacOpenFile(const wxString &fileName)
FileToLoad = fileName;
LoadFile = true;
if (IsMainLoopRunning())
if (m_afterinit == NULL)
main_frame->BootGame(std::string(FileToLoad.mb_str()));
}
int DolphinApp::MainLoop()
void DolphinApp::AfterInit(wxTimerEvent& WXUNUSED(event))
{
delete m_afterinit;
m_afterinit = NULL;
if (!BatchMode)
main_frame->UpdateGameList();
@ -362,8 +375,6 @@ int DolphinApp::MainLoop()
}
}
}
return wxApp::MainLoop();
}
void DolphinApp::InitLanguageSupport()