summaryrefslogtreecommitdiff
path: root/Source/Core/DolphinQt2/Config/Graphics/GraphicsRadio.cpp
diff options
context:
space:
mode:
authorPierre Bourdon <delroth@gmail.com>2018-03-26 02:16:58 +0200
committerGitHub <noreply@github.com>2018-03-26 02:16:58 +0200
commit69addc680dfdd6ace6ebbf2b50c7e8c4ece6f26c (patch)
tree1cbf78b64fbf293ede3a9bd47e586a0d4bb03a6b /Source/Core/DolphinQt2/Config/Graphics/GraphicsRadio.cpp
parent5c83e18fbd3606587e71a7f1cc54e4cf6473609f (diff)
parent2f1a7cbee1ffecdd25ebc206ceab55ef934b7256 (diff)
Merge pull request #6443 from stenzek/skip-ubershader-mode
Implement "Skip" ubershader mode
Diffstat (limited to 'Source/Core/DolphinQt2/Config/Graphics/GraphicsRadio.cpp')
-rw-r--r--Source/Core/DolphinQt2/Config/Graphics/GraphicsRadio.cpp24
1 files changed, 24 insertions, 0 deletions
diff --git a/Source/Core/DolphinQt2/Config/Graphics/GraphicsRadio.cpp b/Source/Core/DolphinQt2/Config/Graphics/GraphicsRadio.cpp
new file mode 100644
index 0000000000..c8f87a548b
--- /dev/null
+++ b/Source/Core/DolphinQt2/Config/Graphics/GraphicsRadio.cpp
@@ -0,0 +1,24 @@
+// Copyright 2018 Dolphin Emulator Project
+// Licensed under GPLv2+
+// Refer to the license.txt file included.
+
+#include "DolphinQt2/Config/Graphics/GraphicsRadio.h"
+
+#include "Common/Config/Config.h"
+#include "DolphinQt2/Settings.h"
+
+GraphicsRadioInt::GraphicsRadioInt(const QString& label, const Config::ConfigInfo<int>& setting,
+ int value)
+ : QRadioButton(label), m_setting(setting), m_value(value)
+{
+ setChecked(Config::Get(m_setting) == m_value);
+ connect(this, &QRadioButton::toggled, this, &GraphicsRadioInt::Update);
+}
+
+void GraphicsRadioInt::Update()
+{
+ if (!isChecked())
+ return;
+
+ Config::SetBaseOrCurrent(m_setting, m_value);
+}