Debian Codegraph @

Source/Core/DolphinQt/Config/ConfigControls/ConfigRadio.cpp

raw symbols SCIP
1 // Copyright 2018 Dolphin Emulator Project
2 // SPDX-License-Identifier: GPL-2.0-or-later
3
4 #include "DolphinQt/Config/ConfigControls/ConfigRadio.h"
5
6 ConfigRadioInt::ConfigRadioInt(const QString& label, const Config::Info<int>& setting, int value,
7 Config::Layer* layer)
8 : ConfigControl(label, setting.GetLocation(), layer), m_setting(setting), m_value(value)
9 {
10 setChecked(ReadValue(setting) == value);
11
12 connect(this, &QRadioButton::toggled, this, &ConfigRadioInt::Update);
13 }
14
15 void ConfigRadioInt::Update()
16 {
17 if (isChecked())
18 {
19 SaveValue(m_setting, m_value);
20
21 emit OnSelected(m_value);
22 }
23 else
24 {
25 emit OnDeselected(m_value);
26 }
27 }
28
29 void ConfigRadioInt::OnConfigChanged()
30 {
31 setChecked(ReadValue(m_setting) == m_value);
32 }