From 5d4c714662f4bf9e4ef025b85ffd96331e265724 Mon Sep 17 00:00:00 2001 From: Lioncash Date: Thu, 3 Nov 2016 23:43:35 -0400 Subject: CodeWindow: Hide GetMenuBar() This eliminates public usage of the GetMenuBar() function in CodeWindow. The benefit of this is it also gets rid of the need to perform direct access across the config dialog and the main frame. It also gets rid of the use of the main_frame global. GetMenuBar() will be removed entirely from CodeWindow in a follow-up that also removes any related remnants of code made obsolete with its removal. --- Source/Core/DolphinWX/FrameTools.cpp | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) (limited to 'Source/Core/DolphinWX/FrameTools.cpp') diff --git a/Source/Core/DolphinWX/FrameTools.cpp b/Source/Core/DolphinWX/FrameTools.cpp index 674d27ab89..cb4297585f 100644 --- a/Source/Core/DolphinWX/FrameTools.cpp +++ b/Source/Core/DolphinWX/FrameTools.cpp @@ -210,7 +210,8 @@ void CFrame::BindDebuggerMenuBarUpdateEvents() Bind(wxEVT_UPDATE_UI, &CFrame::OnEnableMenuItemIfCPUCanStep, this, IDM_STEPOUT); Bind(wxEVT_UPDATE_UI, &CFrame::OnEnableMenuItemIfCPUCanStep, this, IDM_STEPOVER); - Bind(wxEVT_UPDATE_UI, &CFrame::OnEnableMenuItemIfCorePaused, this, IDM_INTERPRETER); + Bind(wxEVT_UPDATE_UI, &CFrame::OnUpdateInterpreterMenuItem, this, IDM_INTERPRETER); + Bind(wxEVT_UPDATE_UI, &CFrame::OnEnableMenuItemIfCorePaused, this, IDM_JIT_OFF); Bind(wxEVT_UPDATE_UI, &CFrame::OnEnableMenuItemIfCorePaused, this, IDM_JIT_LS_OFF); Bind(wxEVT_UPDATE_UI, &CFrame::OnEnableMenuItemIfCorePaused, this, IDM_JIT_LSLXZ_OFF); @@ -1086,6 +1087,16 @@ void CFrame::OnEnableMenuItemIfCPUCanStep(wxUpdateUIEvent& event) event.Enable(Core::GetState() != Core::CORE_UNINITIALIZED && CPU::IsStepping()); } +void CFrame::OnUpdateInterpreterMenuItem(wxUpdateUIEvent& event) +{ + OnEnableMenuItemIfCorePaused(event); + + if (GetMenuBar()->FindItem(IDM_INTERPRETER)->IsChecked()) + return; + + event.Check(SConfig::GetInstance().iCPUCore == PowerPC::CORE_INTERPRETER); +} + void CFrame::ClearStatusBar() { if (this->GetStatusBar()->IsEnabled()) -- cgit v1.2.3