diff --git a/Source/Core/DolphinWX/Src/FrameTools.cpp b/Source/Core/DolphinWX/Src/FrameTools.cpp index ce323ac9e7..0736984d65 100644 --- a/Source/Core/DolphinWX/Src/FrameTools.cpp +++ b/Source/Core/DolphinWX/Src/FrameTools.cpp @@ -986,10 +986,6 @@ void CFrame::DoStop() // Clear wiimote connection status from the status bar. GetStatusBar()->SetStatusText(wxT(" "), 1); - - // If batch mode was specified on the command-line, exit now. - if (m_bBatchMode) - Close(true); } } @@ -1021,6 +1017,12 @@ void CFrame::OnStop(wxCommandEvent& WXUNUSED (event)) { m_bGameLoading = false; DoStop(); + + // If batch mode was specified on the command-line, exit now. + if (m_bBatchMode) + Close(true); + else + UpdateGameList(); } void CFrame::OnReset(wxCommandEvent& WXUNUSED (event)) diff --git a/Source/Core/DolphinWX/Src/Main.cpp b/Source/Core/DolphinWX/Src/Main.cpp index 49e88d45c3..bca9d8b252 100644 --- a/Source/Core/DolphinWX/Src/Main.cpp +++ b/Source/Core/DolphinWX/Src/Main.cpp @@ -327,29 +327,34 @@ bool DolphinApp::OnInit() XInitThreads(); #endif - // Postpone final actions until event handler is running + // 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; } +void DolphinApp::MacOpenFile(const wxString &fileName) +{ + FileToLoad = fileName; + LoadFile = true; + + if (m_afterinit == NULL) + main_frame->BootGame(std::string(FileToLoad.mb_str())); +} + void DolphinApp::AfterInit(wxTimerEvent& WXUNUSED(event)) { delete m_afterinit; - - // Updating the game list makes use of wxProgressDialog which may - // only be run after OnInit() when the event handler is running. - main_frame->UpdateGameList(); - - // Check the autoboot options: + m_afterinit = NULL; // First check if we have an exec command line. if (LoadFile && FileToLoad != wxEmptyString) { main_frame->BootGame(std::string(FileToLoad.mb_str())); } - // If we have selected Automatic Start, start the default ISO, // or if no default ISO exists, start the last loaded ISO else if (main_frame->g_pCodeWindow) @@ -370,6 +375,9 @@ void DolphinApp::AfterInit(wxTimerEvent& WXUNUSED(event)) } } } + // No automatic start was requested; let the user make a selection. + else + main_frame->UpdateGameList(); } void DolphinApp::InitLanguageSupport() diff --git a/Source/Core/DolphinWX/Src/Main.h b/Source/Core/DolphinWX/Src/Main.h index 358b465253..ea44afac49 100644 --- a/Source/Core/DolphinWX/Src/Main.h +++ b/Source/Core/DolphinWX/Src/Main.h @@ -25,14 +25,16 @@ class CFrame; class DolphinApp : public wxApp { public: + CFrame* GetCFrame(); + +private: bool OnInit(); void OnEndSession(); int OnExit(); void OnFatalException(); - CFrame* GetCFrame(); void InitLanguageSupport(); + void MacOpenFile(const wxString &fileName); -private: DECLARE_EVENT_TABLE() wxTimer *m_afterinit; diff --git a/Source/Core/DolphinWX/Src/SConscript b/Source/Core/DolphinWX/Src/SConscript index 04643361dc..8b9c2e05f0 100644 --- a/Source/Core/DolphinWX/Src/SConscript +++ b/Source/Core/DolphinWX/Src/SConscript @@ -108,6 +108,12 @@ elif sys.platform == 'darwin': CFBundleVersion = '3.0', LSMinimumSystemVersion = '10.5.4', LSRequiresCarbon = True, + CFBundleDocumentTypes = [ + dict(CFBundleTypeExtensions = + ('ciso', 'dol', 'elf', 'gcm', 'gcz', 'iso', 'wad'), + CFBundleTypeIconFile = 'Dolphin.icns', + CFBundleTypeName = 'Nintendo GC/Wii file', + CFBundleTypeRole = 'Viewer')] ))) env.Command('dummy', '#' + env['prefix'],