From e344578a01342462c5265e8d4d2c274c53fbda2d Mon Sep 17 00:00:00 2001 From: Jonathan Li Date: Tue, 21 Mar 2017 19:06:34 +0000 Subject: [PATCH] pcsx2: Remove unused MenuId_Sys_Restart and related code --- pcsx2/gui/App.h | 2 -- pcsx2/gui/MainFrame.cpp | 25 ++----------------------- pcsx2/gui/MainFrame.h | 1 - pcsx2/gui/MainMenuClicks.cpp | 6 ------ pcsx2/gui/UpdateUI.cpp | 12 ------------ 5 files changed, 2 insertions(+), 44 deletions(-) diff --git a/pcsx2/gui/App.h b/pcsx2/gui/App.h index 4dd838564d..87003a3665 100644 --- a/pcsx2/gui/App.h +++ b/pcsx2/gui/App.h @@ -93,7 +93,6 @@ enum MenuIdentifiers MenuId_Sys_SuspendResume, // suspends/resumes active emulation, retains plugin states - MenuId_Sys_Restart, // Issues a complete VM reset (wipes preserved states) MenuId_Sys_Shutdown, // Closes virtual machine, shuts down plugins, wipes states. MenuId_Sys_LoadStates, // Opens load states submenu MenuId_Sys_SaveStates, // Opens save states submenu @@ -763,7 +762,6 @@ extern void UI_EnableStateActions(); extern void UI_DisableSysActions(); extern void UI_EnableSysActions(); -extern void UI_DisableSysReset(); extern void UI_DisableSysShutdown(); diff --git a/pcsx2/gui/MainFrame.cpp b/pcsx2/gui/MainFrame.cpp index ebfe08bea2..5deddd8a59 100644 --- a/pcsx2/gui/MainFrame.cpp +++ b/pcsx2/gui/MainFrame.cpp @@ -203,8 +203,6 @@ void MainEmuFrame::ConnectMenus() Bind(wxEVT_MENU, &MainEmuFrame::Menu_EnableHostFs_Click, this, MenuId_EnableHostFs); Bind(wxEVT_MENU, &MainEmuFrame::Menu_SysShutdown_Click, this, MenuId_Sys_Shutdown); Bind(wxEVT_MENU, &MainEmuFrame::Menu_Exit_Click, this, MenuId_Exit); - // No actual menu item for this. - //Bind(wxEVT_MENU, &MainEmuFrame::Menu_SysReset_Click, this, MenuId_Sys_Restart); // CDVD Bind(wxEVT_MENU, &MainEmuFrame::Menu_IsoBrowse_Click, this, MenuId_IsoBrowse); @@ -593,15 +591,10 @@ void MainEmuFrame::ApplyCoreStatus() { wxMenuBar& menubar( *GetMenuBar() ); - wxMenuItem* susres = menubar.FindItem( MenuId_Sys_SuspendResume ); - wxMenuItem* restart = menubar.FindItem( MenuId_Sys_Restart ); - // [TODO] : Ideally each of these items would bind a listener instance to the AppCoreThread // dispatcher, and modify their states accordingly. This is just a hack (for now) -- air - bool ActiveVM = SysHasValidState(); - - if( susres ) + if (wxMenuItem* susres = menubar.FindItem(MenuId_Sys_SuspendResume)) { if( !CoreThread.IsClosing() ) { @@ -611,6 +604,7 @@ void MainEmuFrame::ApplyCoreStatus() } else { + bool ActiveVM = SysHasValidState(); susres->Enable(ActiveVM); if( ActiveVM ) { @@ -625,20 +619,6 @@ void MainEmuFrame::ApplyCoreStatus() } } - if( restart ) - { - if( ActiveVM ) - { - restart->SetItemLabel(_("Res&tart")); - restart->SetHelp(_("Simulates hardware reset of the PS2 virtual machine.")); - } - else - { - restart->Enable( false ); - restart->SetHelp(_("No emulation state is active; boot something first.")); - } - } - const CDVD_SourceType Source = g_Conf->CdvdSource; const MenuIdentifiers fullboot_id = MenuId_Boot_CDVD; const MenuIdentifiers fastboot_id = MenuId_Boot_CDVD2; @@ -680,7 +660,6 @@ void MainEmuFrame::ApplyCoreStatus() if (wxMenuItem *cdvd_full = menubar.FindItem(fullboot_id)) { - switch (Source) { case CDVD_SourceType::Iso: diff --git a/pcsx2/gui/MainFrame.h b/pcsx2/gui/MainFrame.h index 9b9f14e4ed..7c65a2b020 100644 --- a/pcsx2/gui/MainFrame.h +++ b/pcsx2/gui/MainFrame.h @@ -185,7 +185,6 @@ protected: void Menu_Exit_Click(wxCommandEvent &event); void Menu_SuspendResume_Click(wxCommandEvent &event); - void Menu_SysReset_Click(wxCommandEvent &event); void Menu_SysShutdown_Click(wxCommandEvent &event); void Menu_ConfigPlugin_Click(wxCommandEvent &event); diff --git a/pcsx2/gui/MainMenuClicks.cpp b/pcsx2/gui/MainMenuClicks.cpp index 275232efb6..d8b8fe588d 100644 --- a/pcsx2/gui/MainMenuClicks.cpp +++ b/pcsx2/gui/MainMenuClicks.cpp @@ -544,12 +544,6 @@ void MainEmuFrame::Menu_SuspendResume_Click(wxCommandEvent &event) GetSysExecutorThread().PostEvent( new SysExecEvent_ToggleSuspend() ); } -void MainEmuFrame::Menu_SysReset_Click(wxCommandEvent &event) -{ - UI_DisableSysReset(); - sApp.SysExecute(); -} - void MainEmuFrame::Menu_SysShutdown_Click(wxCommandEvent &event) { //if( !SysHasValidState() && !CorePlugins.AreAnyInitialized() ) return; diff --git a/pcsx2/gui/UpdateUI.cpp b/pcsx2/gui/UpdateUI.cpp index a8605a46be..11566d5265 100644 --- a/pcsx2/gui/UpdateUI.cpp +++ b/pcsx2/gui/UpdateUI.cpp @@ -50,19 +50,10 @@ void UI_UpdateSysControls() _SaveLoadStuff( SysHasValidState() ); } -void UI_DisableSysReset() -{ - if( wxGetApp().Rpc_TryInvokeAsync( UI_DisableSysReset ) ) return; - sMainFrame.EnableMenuItem( MenuId_Sys_Restart, false ); - - _SaveLoadStuff( false ); -} - void UI_DisableSysShutdown() { if( wxGetApp().Rpc_TryInvokeAsync( &UI_DisableSysShutdown ) ) return; - sMainFrame.EnableMenuItem( MenuId_Sys_Restart, false ); sMainFrame.EnableMenuItem( MenuId_Sys_Shutdown, false ); } @@ -70,7 +61,6 @@ void UI_EnableSysShutdown() { if( wxGetApp().Rpc_TryInvokeAsync( &UI_EnableSysShutdown ) ) return; - sMainFrame.EnableMenuItem( MenuId_Sys_Restart, true ); sMainFrame.EnableMenuItem( MenuId_Sys_Shutdown, true ); } @@ -79,7 +69,6 @@ void UI_DisableSysActions() { if( wxGetApp().Rpc_TryInvokeAsync( &UI_DisableSysActions ) ) return; - sMainFrame.EnableMenuItem( MenuId_Sys_Restart, false ); sMainFrame.EnableMenuItem( MenuId_Sys_Shutdown, false ); _SaveLoadStuff( false ); @@ -89,7 +78,6 @@ void UI_EnableSysActions() { if( wxGetApp().Rpc_TryInvokeAsync( &UI_EnableSysActions ) ) return; - sMainFrame.EnableMenuItem( MenuId_Sys_Restart, true ); sMainFrame.EnableMenuItem( MenuId_Sys_Shutdown, true ); _SaveLoadStuff( true );