mirror of
https://github.com/dolphin-emu/dolphin.git
synced 2025-01-27 08:15:33 +01:00
84a937ae65
Creates a layer outside the game config layer system and passes it to the created gfx widows, so as to not interfere with the global config system. Supports multiple game properties being open at once. Supports editing while a game is playing, but the options only save and update the active game when the window is closed. Right-clicking will remove a property from the game ini.
31 lines
862 B
C++
31 lines
862 B
C++
// Copyright 2017 Dolphin Emulator Project
|
|
// SPDX-License-Identifier: GPL-2.0-or-later
|
|
|
|
#include "DolphinQt/Config/ConfigControls/ConfigBool.h"
|
|
|
|
ConfigBool::ConfigBool(const QString& label, const Config::Info<bool>& setting, bool reverse)
|
|
: ConfigBool(label, setting, nullptr, reverse)
|
|
{
|
|
}
|
|
|
|
ConfigBool::ConfigBool(const QString& label, const Config::Info<bool>& setting,
|
|
Config::Layer* layer, bool reverse)
|
|
: ConfigControl(label, setting.GetLocation(), layer), m_setting(setting), m_reverse(reverse)
|
|
{
|
|
setChecked(ReadValue(setting) ^ reverse);
|
|
|
|
connect(this, &QCheckBox::toggled, this, &ConfigBool::Update);
|
|
}
|
|
|
|
void ConfigBool::Update()
|
|
{
|
|
const bool value = static_cast<bool>(isChecked() ^ m_reverse);
|
|
|
|
SaveValue(m_setting, value);
|
|
}
|
|
|
|
void ConfigBool::OnConfigChanged()
|
|
{
|
|
setChecked(ReadValue(m_setting) ^ m_reverse);
|
|
}
|