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/Config/GeneralConfigPane.cpp | 16 +++------------- 1 file changed, 3 insertions(+), 13 deletions(-) (limited to 'Source/Core/DolphinWX/Config/GeneralConfigPane.cpp') diff --git a/Source/Core/DolphinWX/Config/GeneralConfigPane.cpp b/Source/Core/DolphinWX/Config/GeneralConfigPane.cpp index 78501ba14a..742c551277 100644 --- a/Source/Core/DolphinWX/Config/GeneralConfigPane.cpp +++ b/Source/Core/DolphinWX/Config/GeneralConfigPane.cpp @@ -2,6 +2,8 @@ // Licensed under GPLv2+ // Refer to the license.txt file included. +#include "DolphinWX/Config/GeneralConfigPane.h" + #include #include #include @@ -16,10 +18,6 @@ #include "Core/ConfigManager.h" #include "Core/Core.h" #include "Core/PowerPC/PowerPC.h" -#include "DolphinWX/Config/GeneralConfigPane.h" -#include "DolphinWX/Debugger/CodeWindow.h" -#include "DolphinWX/Frame.h" -#include "DolphinWX/Main.h" GeneralConfigPane::GeneralConfigPane(wxWindow* parent, wxWindowID id) : wxPanel(parent, id) { @@ -200,15 +198,7 @@ void GeneralConfigPane::OnThrottlerChoiceChanged(wxCommandEvent& event) void GeneralConfigPane::OnCPUEngineRadioBoxChanged(wxCommandEvent& event) { - const int selection = m_cpu_engine_radiobox->GetSelection(); - - if (main_frame->g_pCodeWindow) - { - bool using_interp = (SConfig::GetInstance().iCPUCore == PowerPC::CORE_INTERPRETER); - main_frame->g_pCodeWindow->GetMenuBar()->Check(IDM_INTERPRETER, using_interp); - } - - SConfig::GetInstance().iCPUCore = cpu_cores[selection].CPUid; + SConfig::GetInstance().iCPUCore = cpu_cores.at(event.GetSelection()).CPUid; } void GeneralConfigPane::OnAnalyticsCheckBoxChanged(wxCommandEvent& event) -- cgit v1.2.3