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:
parent
5027554beb
commit
da82d7e178
|
@ -425,7 +425,6 @@ cUIDsys::cUIDsys()
|
|||
|
||||
if (m_Elements.empty())
|
||||
{
|
||||
SElement Element;
|
||||
*(u64*)&(Element.titleID) = Common::swap64(TITLEID_SYSMENU);
|
||||
*(u32*)&(Element.UID) = Common::swap32(lastUID++);
|
||||
|
||||
|
|
|
@ -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()
|
||||
|
|
|
@ -35,12 +35,15 @@ private:
|
|||
void InitLanguageSupport();
|
||||
void MacOpenFile(const wxString &fileName);
|
||||
|
||||
DECLARE_EVENT_TABLE()
|
||||
|
||||
wxTimer *m_afterinit;
|
||||
bool BatchMode;
|
||||
bool LoadFile;
|
||||
wxString FileToLoad;
|
||||
wxLocale *m_locale;
|
||||
|
||||
int MainLoop();
|
||||
void AfterInit(wxTimerEvent& WXUNUSED(event));
|
||||
};
|
||||
|
||||
DECLARE_APP(DolphinApp);
|
||||
|
|
Loading…
Reference in New Issue