From 0a28f7de13a8f3330d8f9a574149ea131a8ca411 Mon Sep 17 00:00:00 2001 From: Gerik Kubiak Date: Mon, 16 Mar 2015 22:13:27 -0700 Subject: [PATCH] Added checkbox under Config > Interface. --- Source/Core/DolphinWX/ConfigMain.cpp | 8 ++++++++ Source/Core/DolphinWX/ConfigMain.h | 2 ++ 2 files changed, 10 insertions(+) diff --git a/Source/Core/DolphinWX/ConfigMain.cpp b/Source/Core/DolphinWX/ConfigMain.cpp index a6a252dc82..881ac768a0 100644 --- a/Source/Core/DolphinWX/ConfigMain.cpp +++ b/Source/Core/DolphinWX/ConfigMain.cpp @@ -154,6 +154,7 @@ EVT_SLIDER(ID_VOLUME, CConfigMain::AudioSettingsChanged) EVT_CHECKBOX(ID_INTERFACE_CONFIRMSTOP, CConfigMain::DisplaySettingsChanged) EVT_CHECKBOX(ID_INTERFACE_USEPANICHANDLERS, CConfigMain::DisplaySettingsChanged) EVT_CHECKBOX(ID_INTERFACE_ONSCREENDISPLAYMESSAGES, CConfigMain::DisplaySettingsChanged) +EVT_CHECKBOX(ID_INTERFACE_PAUSEONFOCUSLOST, CConfigMain::DisplaySettingsChanged) EVT_CHOICE(ID_INTERFACE_LANG, CConfigMain::DisplaySettingsChanged) EVT_BUTTON(ID_HOTKEY_CONFIG, CConfigMain::DisplaySettingsChanged) @@ -354,6 +355,7 @@ void CConfigMain::InitializeGUIValues() ConfirmStop->SetValue(startup_params.bConfirmStop); UsePanicHandlers->SetValue(startup_params.bUsePanicHandlers); OnScreenDisplayMessages->SetValue(startup_params.bOnScreenDisplayMessages); + PauseOnFocusLost->SetValue(SConfig::GetInstance().m_PauseOnFocusLost); // need redesign for (unsigned int i = 0; i < sizeof(langIds) / sizeof(wxLanguage); i++) { @@ -486,6 +488,7 @@ void CConfigMain::InitializeGUITooltips() ConfirmStop->SetToolTip(_("Show a confirmation box before stopping a game.")); UsePanicHandlers->SetToolTip(_("Show a message box when a potentially serious error has occurred.\nDisabling this may avoid annoying and non-fatal messages, but it may result in major crashes having no explanation at all.")); OnScreenDisplayMessages->SetToolTip(_("Display messages over the emulation screen area.\nThese messages include memory card writes, video backend and CPU information, and JIT cache clearing.")); + PauseOnFocusLost->SetToolTip(_("Pauses the emulator when focus is taken away from the emulation screen.")); InterfaceLang->SetToolTip(_("Change the language of the user interface.\nRequires restart.")); @@ -577,6 +580,7 @@ void CConfigMain::CreateGUIControls() ConfirmStop = new wxCheckBox(DisplayPage, ID_INTERFACE_CONFIRMSTOP, _("Confirm on Stop")); UsePanicHandlers = new wxCheckBox(DisplayPage, ID_INTERFACE_USEPANICHANDLERS, _("Use Panic Handlers")); OnScreenDisplayMessages = new wxCheckBox(DisplayPage, ID_INTERFACE_ONSCREENDISPLAYMESSAGES, _("On-Screen Display Messages")); + PauseOnFocusLost = new wxCheckBox(DisplayPage, ID_INTERFACE_PAUSEONFOCUSLOST, _("Pause on Focus Lost")); wxBoxSizer* sInterface = new wxBoxSizer(wxHORIZONTAL); sInterface->Add(TEXT_BOX(DisplayPage, _("Language:")), 0, wxALIGN_CENTER_VERTICAL | wxALL, 5); @@ -623,6 +627,7 @@ void CConfigMain::CreateGUIControls() sbInterface->Add(ConfirmStop, 0, wxALL, 5); sbInterface->Add(UsePanicHandlers, 0, wxALL, 5); sbInterface->Add(OnScreenDisplayMessages, 0, wxALL, 5); + sbInterface->Add(PauseOnFocusLost, 0, wxALL, 5); sbInterface->Add(scInterface, 0, wxEXPAND | wxALL, 5); sbInterface->Add(sInterface, 0, wxEXPAND | wxALL, 5); sDisplayPage = new wxBoxSizer(wxVERTICAL); @@ -938,6 +943,9 @@ void CConfigMain::DisplaySettingsChanged(wxCommandEvent& event) SConfig::GetInstance().m_LocalCoreStartupParameter.bOnScreenDisplayMessages = OnScreenDisplayMessages->IsChecked(); SetEnableAlert(OnScreenDisplayMessages->IsChecked()); break; + case ID_INTERFACE_PAUSEONFOCUSLOST: + SConfig::GetInstance().m_PauseOnFocusLost = PauseOnFocusLost->IsChecked(); + break; case ID_INTERFACE_LANG: if (SConfig::GetInstance().m_InterfaceLanguage != langIds[InterfaceLang->GetSelection()]) SuccessAlertT("You must restart Dolphin in order for the change to take effect."); diff --git a/Source/Core/DolphinWX/ConfigMain.h b/Source/Core/DolphinWX/ConfigMain.h index f542187ac5..e2c48a7fb2 100644 --- a/Source/Core/DolphinWX/ConfigMain.h +++ b/Source/Core/DolphinWX/ConfigMain.h @@ -99,6 +99,7 @@ private: ID_INTERFACE_CONFIRMSTOP, ID_INTERFACE_USEPANICHANDLERS, ID_INTERFACE_ONSCREENDISPLAYMESSAGES, + ID_INTERFACE_PAUSEONFOCUSLOST, ID_INTERFACE_LANG, ID_HOTKEY_CONFIG, @@ -170,6 +171,7 @@ private: wxCheckBox* ConfirmStop; wxCheckBox* UsePanicHandlers; wxCheckBox* OnScreenDisplayMessages; + wxCheckBox* PauseOnFocusLost; wxChoice* InterfaceLang; wxButton* HotkeyConfig;