mirror of
https://github.com/dolphin-emu/dolphin.git
synced 2025-07-22 13:49:53 -06:00
Qt: Rename GraphicsInteger to ConfigInteger
GraphicsInteger is used by the panes in the Graphics config window to create spin boxes that change their associated config setting, and update their own state when something else changes the config setting. Despite its current name nothing about this class is particular to the Graphics window, so renaming it to ConfigInteger better reflects its purpose. This should also make it less confusing when ConfigIntegers are added to other config windows.
This commit is contained in:
@ -17,7 +17,7 @@
|
||||
|
||||
#include "DolphinQt/Config/ConfigControls/ConfigBool.h"
|
||||
#include "DolphinQt/Config/ConfigControls/ConfigChoice.h"
|
||||
#include "DolphinQt/Config/Graphics/GraphicsInteger.h"
|
||||
#include "DolphinQt/Config/ConfigControls/ConfigInteger.h"
|
||||
#include "DolphinQt/Config/Graphics/GraphicsWindow.h"
|
||||
#include "DolphinQt/Config/ToolTipControls/ToolTipCheckBox.h"
|
||||
#include "DolphinQt/QtUtils/SignalBlocking.h"
|
||||
@ -57,7 +57,7 @@ void AdvancedWidget::CreateWidgets()
|
||||
m_show_graphs = new ConfigBool(tr("Show Performance Graphs"), Config::GFX_SHOW_GRAPHS);
|
||||
m_show_speed = new ConfigBool(tr("Show % Speed"), Config::GFX_SHOW_SPEED);
|
||||
m_show_speed_colors = new ConfigBool(tr("Show Speed Colors"), Config::GFX_SHOW_SPEED_COLORS);
|
||||
m_perf_samp_window = new GraphicsInteger(0, 10000, Config::GFX_PERF_SAMP_WINDOW, 100);
|
||||
m_perf_samp_window = new ConfigInteger(0, 10000, Config::GFX_PERF_SAMP_WINDOW, 100);
|
||||
m_perf_samp_window->SetTitle(tr("Performance Sample Window (ms)"));
|
||||
m_log_render_time =
|
||||
new ConfigBool(tr("Log Render Time to File"), Config::GFX_LOG_RENDER_TIME_TO_FILE);
|
||||
@ -134,8 +134,8 @@ void AdvancedWidget::CreateWidgets()
|
||||
m_use_fullres_framedumps = new ConfigBool(tr("Dump at Internal Resolution"),
|
||||
Config::GFX_INTERNAL_RESOLUTION_FRAME_DUMPS);
|
||||
m_dump_use_ffv1 = new ConfigBool(tr("Use Lossless Codec (FFV1)"), Config::GFX_USE_FFV1);
|
||||
m_dump_bitrate = new GraphicsInteger(0, 1000000, Config::GFX_BITRATE_KBPS, 1000);
|
||||
m_png_compression_level = new GraphicsInteger(0, 9, Config::GFX_PNG_COMPRESSION_LEVEL);
|
||||
m_dump_bitrate = new ConfigInteger(0, 1000000, Config::GFX_BITRATE_KBPS, 1000);
|
||||
m_png_compression_level = new ConfigInteger(0, 9, Config::GFX_PNG_COMPRESSION_LEVEL);
|
||||
|
||||
dump_layout->addWidget(m_use_fullres_framedumps, 0, 0);
|
||||
#if defined(HAVE_FFMPEG)
|
||||
|
@ -7,7 +7,7 @@
|
||||
|
||||
class ConfigBool;
|
||||
class ConfigChoice;
|
||||
class GraphicsInteger;
|
||||
class ConfigInteger;
|
||||
class GraphicsWindow;
|
||||
class QCheckBox;
|
||||
class QComboBox;
|
||||
@ -42,7 +42,7 @@ private:
|
||||
ConfigBool* m_show_graphs;
|
||||
ConfigBool* m_show_speed;
|
||||
ConfigBool* m_show_speed_colors;
|
||||
GraphicsInteger* m_perf_samp_window;
|
||||
ConfigInteger* m_perf_samp_window;
|
||||
ConfigBool* m_log_render_time;
|
||||
|
||||
// Utility
|
||||
@ -61,8 +61,8 @@ private:
|
||||
// Frame dumping
|
||||
ConfigBool* m_dump_use_ffv1;
|
||||
ConfigBool* m_use_fullres_framedumps;
|
||||
GraphicsInteger* m_dump_bitrate;
|
||||
GraphicsInteger* m_png_compression_level;
|
||||
ConfigInteger* m_dump_bitrate;
|
||||
ConfigInteger* m_png_compression_level;
|
||||
|
||||
// Misc
|
||||
ConfigBool* m_enable_cropping;
|
||||
|
@ -1,36 +0,0 @@
|
||||
// Copyright 2019 Dolphin Emulator Project
|
||||
// SPDX-License-Identifier: GPL-2.0-or-later
|
||||
|
||||
#include "DolphinQt/Config/Graphics/GraphicsInteger.h"
|
||||
|
||||
#include <QSignalBlocker>
|
||||
|
||||
#include "Common/Config/Config.h"
|
||||
|
||||
#include "DolphinQt/Settings.h"
|
||||
|
||||
GraphicsInteger::GraphicsInteger(int minimum, int maximum, const Config::Info<int>& setting,
|
||||
int step)
|
||||
: ToolTipSpinBox(), m_setting(setting)
|
||||
{
|
||||
setMinimum(minimum);
|
||||
setMaximum(maximum);
|
||||
setSingleStep(step);
|
||||
|
||||
setValue(Config::Get(setting));
|
||||
|
||||
connect(this, qOverload<int>(&GraphicsInteger::valueChanged), this, &GraphicsInteger::Update);
|
||||
connect(&Settings::Instance(), &Settings::ConfigChanged, this, [this] {
|
||||
QFont bf = font();
|
||||
bf.setBold(Config::GetActiveLayerForConfig(m_setting) != Config::LayerType::Base);
|
||||
setFont(bf);
|
||||
|
||||
const QSignalBlocker blocker(this);
|
||||
setValue(Config::Get(m_setting));
|
||||
});
|
||||
}
|
||||
|
||||
void GraphicsInteger::Update(int value)
|
||||
{
|
||||
Config::SetBaseOrCurrent(m_setting, value);
|
||||
}
|
@ -1,23 +0,0 @@
|
||||
// Copyright 2019 Dolphin Emulator Project
|
||||
// SPDX-License-Identifier: GPL-2.0-or-later
|
||||
|
||||
#pragma once
|
||||
|
||||
#include "DolphinQt/Config/ToolTipControls/ToolTipSpinBox.h"
|
||||
|
||||
namespace Config
|
||||
{
|
||||
template <typename T>
|
||||
class Info;
|
||||
}
|
||||
|
||||
class GraphicsInteger : public ToolTipSpinBox
|
||||
{
|
||||
Q_OBJECT
|
||||
public:
|
||||
GraphicsInteger(int minimum, int maximum, const Config::Info<int>& setting, int step = 1);
|
||||
void Update(int value);
|
||||
|
||||
private:
|
||||
const Config::Info<int>& m_setting;
|
||||
};
|
Reference in New Issue
Block a user