From fa83a3a114484850f296f25aed3f48e16769b3c0 Mon Sep 17 00:00:00 2001 From: Jordan Woyak Date: Sat, 8 Feb 2020 13:04:25 -0600 Subject: [PATCH] DolphinQt: Expose "DisableScreenSaver" setting in the UI. --- Source/Core/DolphinQt/Settings/InterfacePane.cpp | 5 +++++ Source/Core/DolphinQt/Settings/InterfacePane.h | 1 + 2 files changed, 6 insertions(+) diff --git a/Source/Core/DolphinQt/Settings/InterfacePane.cpp b/Source/Core/DolphinQt/Settings/InterfacePane.cpp index 4b629686d2..145d532213 100644 --- a/Source/Core/DolphinQt/Settings/InterfacePane.cpp +++ b/Source/Core/DolphinQt/Settings/InterfacePane.cpp @@ -148,12 +148,14 @@ void InterfacePane::CreateUI() new QCheckBox(tr("Download Game Covers from GameTDB.com for Use in Grid Mode")); m_checkbox_show_debugging_ui = new QCheckBox(tr("Show Debugging UI")); m_checkbox_focused_hotkeys = new QCheckBox(tr("Hotkeys Require Window Focus")); + m_checkbox_disable_screensaver = new QCheckBox(tr("Inhibit Screensaver During Emulation")); groupbox_layout->addWidget(m_checkbox_use_builtin_title_database); groupbox_layout->addWidget(m_checkbox_use_userstyle); groupbox_layout->addWidget(m_checkbox_use_covers); groupbox_layout->addWidget(m_checkbox_show_debugging_ui); groupbox_layout->addWidget(m_checkbox_focused_hotkeys); + groupbox_layout->addWidget(m_checkbox_disable_screensaver); } void InterfacePane::CreateInGame() @@ -185,6 +187,7 @@ void InterfacePane::ConnectLayout() connect(m_checkbox_use_builtin_title_database, &QCheckBox::toggled, this, &InterfacePane::OnSaveConfig); connect(m_checkbox_use_covers, &QCheckBox::toggled, this, &InterfacePane::OnSaveConfig); + connect(m_checkbox_disable_screensaver, &QCheckBox::toggled, this, &InterfacePane::OnSaveConfig); connect(m_checkbox_show_debugging_ui, &QCheckBox::toggled, this, &InterfacePane::OnSaveConfig); connect(m_checkbox_focused_hotkeys, &QCheckBox::toggled, this, &InterfacePane::OnSaveConfig); connect(m_combobox_theme, qOverload(&QComboBox::currentIndexChanged), this, @@ -237,6 +240,7 @@ void InterfacePane::LoadConfig() m_checkbox_use_covers->setChecked(Config::Get(Config::MAIN_USE_GAME_COVERS)); m_checkbox_focused_hotkeys->setChecked(Config::Get(Config::MAIN_FOCUSED_HOTKEYS)); m_checkbox_hide_mouse->setChecked(Settings::Instance().GetHideCursor()); + m_checkbox_disable_screensaver->setChecked(Config::Get(Config::MAIN_DISABLE_SCREENSAVER)); } void InterfacePane::OnSaveConfig() @@ -280,6 +284,7 @@ void InterfacePane::OnSaveConfig() } Config::SetBase(Config::MAIN_FOCUSED_HOTKEYS, m_checkbox_focused_hotkeys->isChecked()); + Config::SetBase(Config::MAIN_DISABLE_SCREENSAVER, m_checkbox_disable_screensaver->isChecked()); settings.SaveSettings(); } diff --git a/Source/Core/DolphinQt/Settings/InterfacePane.h b/Source/Core/DolphinQt/Settings/InterfacePane.h index 22e07da7ca..d135de5992 100644 --- a/Source/Core/DolphinQt/Settings/InterfacePane.h +++ b/Source/Core/DolphinQt/Settings/InterfacePane.h @@ -37,6 +37,7 @@ private: QCheckBox* m_checkbox_show_debugging_ui; QCheckBox* m_checkbox_focused_hotkeys; QCheckBox* m_checkbox_use_covers; + QCheckBox* m_checkbox_disable_screensaver; QCheckBox* m_checkbox_confirm_on_stop; QCheckBox* m_checkbox_use_panic_handlers;