From 121be22532263ca650015e000f6b881461891cc9 Mon Sep 17 00:00:00 2001 From: Shawn Hoffman Date: Wed, 28 Jan 2009 16:51:05 +0000 Subject: [PATCH] buildfix and some cleanup git-svn-id: https://dolphin-emu.googlecode.com/svn/trunk@2026 8ced0084-cf51-0410-be5f-012b33b47a6e --- Source/Core/DolphinWX/Src/Frame.cpp | 29 +------ Source/Core/DolphinWX/Src/Frame.h | 2 +- Source/Core/DolphinWX/Src/FrameTools.cpp | 86 ++++++++++--------- .../Plugin_Wiimote/Plugin_Wiimote.vcproj | 12 +-- 4 files changed, 55 insertions(+), 74 deletions(-) diff --git a/Source/Core/DolphinWX/Src/Frame.cpp b/Source/Core/DolphinWX/Src/Frame.cpp index ab188cae5e..dabbe89a9b 100644 --- a/Source/Core/DolphinWX/Src/Frame.cpp +++ b/Source/Core/DolphinWX/Src/Frame.cpp @@ -240,7 +240,7 @@ EVT_MENU_RANGE(IDM_LOADSLOT1, IDM_LOADSLOT10, CFrame::OnLoadState) EVT_MENU_RANGE(IDM_SAVESLOT1, IDM_SAVESLOT10, CFrame::OnSaveState) EVT_SIZE(CFrame::OnResize) -EVT_LIST_ITEM_ACTIVATED(LIST_CTRL, CFrame::OnEvent_ListCtrl_ItemActivated) +EVT_LIST_ITEM_ACTIVATED(LIST_CTRL, CFrame::OnGameListCtrl_ItemActivated) EVT_HOST_COMMAND(wxID_ANY, CFrame::OnHostMessage) #if wxUSE_TIMER EVT_TIMER(wxID_ANY, CFrame::OnTimer) @@ -412,10 +412,11 @@ void CFrame::OnHostMessage(wxCommandEvent& event) } -void CFrame::OnEvent_ListCtrl_ItemActivated(wxListEvent& WXUNUSED (event)) +void CFrame::OnGameListCtrl_ItemActivated(wxListEvent& WXUNUSED (event)) { BootGame(); } + void CFrame::OnKeyDown(wxKeyEvent& event) { // Toggle fullscreen from Alt + Enter or Esc @@ -593,28 +594,4 @@ void CFrame::Update() } } #endif -void CFrame::BootGame() -{ - // Start the selected ISO - if (m_GameListCtrl->GetSelectedISO() != 0) - { - BootManager::BootCore(m_GameListCtrl->GetSelectedISO()->GetFileName()); - } - - // Start the default ISO, or if we don't have a default ISO, start the last started ISO - else if (!SConfig::GetInstance().m_LocalCoreStartupParameter.m_strDefaultGCM.empty() && - wxFileExists(wxString(SConfig::GetInstance().m_LocalCoreStartupParameter.m_strDefaultGCM.c_str(), wxConvUTF8))) - { - BootManager::BootCore(SConfig::GetInstance().m_LocalCoreStartupParameter.m_strDefaultGCM); - } - - else if (!SConfig::GetInstance().m_LastFilename.empty() && - wxFileExists(wxString(SConfig::GetInstance().m_LastFilename.c_str(), wxConvUTF8))) - { - BootManager::BootCore(SConfig::GetInstance().m_LastFilename); - } -} ////////////////////////////////////////// - - - diff --git a/Source/Core/DolphinWX/Src/Frame.h b/Source/Core/DolphinWX/Src/Frame.h index 7886c97056..b7249718f0 100644 --- a/Source/Core/DolphinWX/Src/Frame.h +++ b/Source/Core/DolphinWX/Src/Frame.h @@ -202,7 +202,7 @@ class CFrame : public wxFrame void OnMemcard(wxCommandEvent& event); // Misc void OnShow_CheatsWindow(wxCommandEvent& event); - void OnEvent_ListCtrl_ItemActivated(wxListEvent& event); + void OnGameListCtrl_ItemActivated(wxListEvent& event); // Menu items wxMenuBar* m_pMenuBar; diff --git a/Source/Core/DolphinWX/Src/FrameTools.cpp b/Source/Core/DolphinWX/Src/FrameTools.cpp index ef5eb3e6f8..5fbf1ef671 100644 --- a/Source/Core/DolphinWX/Src/FrameTools.cpp +++ b/Source/Core/DolphinWX/Src/FrameTools.cpp @@ -341,6 +341,50 @@ void CFrame::InitBitmaps() if (GetToolBar() != NULL) RecreateToolbar(); } +void CFrame::BootGame() +{ + #ifdef MUSICMOD // Music modification + MM_OnPlay(); + #endif + + + // shuffle2: wxBusyInfo is meant to be created on the stack + // and only stay around for the life of the scope it's in. + // If that is not what we want, find another solution. I don't + // think such a dialog is needed anyways, so maybe kill it? + wxBusyInfo bootingDialog(wxString::FromAscii("Booting..."), this); + + if (Core::GetState() != Core::CORE_UNINITIALIZED) + { + if (Core::GetState() == Core::CORE_RUN) + { + Core::SetState(Core::CORE_PAUSE); + } + else + { + Core::SetState(Core::CORE_RUN); + } + UpdateGUI(); + } + // Start the selected ISO + else if (m_GameListCtrl->GetSelectedISO() != 0) + { + BootManager::BootCore(m_GameListCtrl->GetSelectedISO()->GetFileName()); + } + /* Start the default ISO, or if we don't have a default ISO, start the last + started ISO */ + else if (!SConfig::GetInstance().m_LocalCoreStartupParameter.m_strDefaultGCM.empty() && + wxFileExists(wxString(SConfig::GetInstance().m_LocalCoreStartupParameter. + m_strDefaultGCM.c_str(), wxConvUTF8))) + { + BootManager::BootCore(SConfig::GetInstance().m_LocalCoreStartupParameter.m_strDefaultGCM); + } + else if (!SConfig::GetInstance().m_LastFilename.empty() && + wxFileExists(wxString(SConfig::GetInstance().m_LastFilename.c_str(), wxConvUTF8))) + { + BootManager::BootCore(SConfig::GetInstance().m_LastFilename); + } +} // ======================================================= // Open file to boot or for changing disc @@ -441,47 +485,7 @@ void CFrame::OnBrowse(wxCommandEvent& WXUNUSED (event)) // ------------- void CFrame::OnPlay(wxCommandEvent& WXUNUSED (event)) { - #ifdef MUSICMOD // Music modification - MM_OnPlay(); - #endif - - - // shuffle2: wxBusyInfo is meant to be created on the stack - // and only stay around for the life of the scope it's in. - // If that is not what we want, find another solution. I don't - // think such a dialog is needed anyways, so maybe kill it? - wxBusyInfo bootingDialog(wxString::FromAscii("Booting..."), this); - - if (Core::GetState() != Core::CORE_UNINITIALIZED) - { - if (Core::GetState() == Core::CORE_RUN) - { - Core::SetState(Core::CORE_PAUSE); - } - else - { - Core::SetState(Core::CORE_RUN); - } - UpdateGUI(); - } - // Start the selected ISO - else if (m_GameListCtrl->GetSelectedISO() != 0) - { - BootManager::BootCore(m_GameListCtrl->GetSelectedISO()->GetFileName()); - } - /* Start the default ISO, or if we don't have a default ISO, start the last - started ISO */ - else if (!SConfig::GetInstance().m_LocalCoreStartupParameter.m_strDefaultGCM.empty() && - wxFileExists(wxString(SConfig::GetInstance().m_LocalCoreStartupParameter. - m_strDefaultGCM.c_str(), wxConvUTF8))) - { - BootManager::BootCore(SConfig::GetInstance().m_LocalCoreStartupParameter.m_strDefaultGCM); - } - else if (!SConfig::GetInstance().m_LastFilename.empty() && - wxFileExists(wxString(SConfig::GetInstance().m_LastFilename.c_str(), wxConvUTF8))) - { - BootManager::BootCore(SConfig::GetInstance().m_LastFilename); - } + BootGame(); } // ============= diff --git a/Source/Plugins/Plugin_Wiimote/Plugin_Wiimote.vcproj b/Source/Plugins/Plugin_Wiimote/Plugin_Wiimote.vcproj index 8993fb652e..e492a8c5b8 100644 --- a/Source/Plugins/Plugin_Wiimote/Plugin_Wiimote.vcproj +++ b/Source/Plugins/Plugin_Wiimote/Plugin_Wiimote.vcproj @@ -1,7 +1,7 @@