Allow non-runtime editable settings on general settings tab`

This commit is contained in:
kleidis 2024-10-11 18:53:50 +02:00 committed by OpenSauce04
parent af4a60c979
commit 8126151871
4 changed files with 6 additions and 6 deletions

View File

@ -28,7 +28,7 @@ ConfigureDialog::ConfigureDialog(QWidget* parent, HotkeyRegistry& registry_, Cor
bool enable_web_config) bool enable_web_config)
: QDialog(parent), ui{std::make_unique<Ui::ConfigureDialog>()}, registry{registry_}, : QDialog(parent), ui{std::make_unique<Ui::ConfigureDialog>()}, registry{registry_},
system{system_}, is_powered_on{system.IsPoweredOn()}, system{system_}, is_powered_on{system.IsPoweredOn()},
general_tab{std::make_unique<ConfigureGeneral>(this)}, general_tab{std::make_unique<ConfigureGeneral>(is_powered_on, this)},
system_tab{std::make_unique<ConfigureSystem>(system, this)}, system_tab{std::make_unique<ConfigureSystem>(system, this)},
input_tab{std::make_unique<ConfigureInput>(system, this)}, input_tab{std::make_unique<ConfigureInput>(system, this)},
hotkeys_tab{std::make_unique<ConfigureHotkeys>(this)}, hotkeys_tab{std::make_unique<ConfigureHotkeys>(this)},

View File

@ -24,9 +24,8 @@ static constexpr int SettingsToSlider(int value) {
return (value - 5) / 5; return (value - 5) / 5;
} }
ConfigureGeneral::ConfigureGeneral(QWidget* parent) ConfigureGeneral::ConfigureGeneral(bool is_powered_on, QWidget* parent)
: QWidget(parent), ui(std::make_unique<Ui::ConfigureGeneral>()) { : QWidget(parent), ui(std::make_unique<Ui::ConfigureGeneral>()), is_powered_on{is_powered_on} {
ui->setupUi(this); ui->setupUi(this);
connect(ui->turbo_speed_slider, &QSlider::valueChanged, this, [&](int value) { connect(ui->turbo_speed_slider, &QSlider::valueChanged, this, [&](int value) {

View File

@ -17,7 +17,7 @@ class ConfigureGeneral : public QWidget {
Q_OBJECT Q_OBJECT
public: public:
explicit ConfigureGeneral(QWidget* parent = nullptr); explicit ConfigureGeneral(bool is_powered_on, QWidget* parent = nullptr);
~ConfigureGeneral() override; ~ConfigureGeneral() override;
void ResetDefaults(); void ResetDefaults();
@ -29,4 +29,5 @@ public:
private: private:
std::unique_ptr<Ui::ConfigureGeneral> ui; std::unique_ptr<Ui::ConfigureGeneral> ui;
bool is_powered_on;
}; };

View File

@ -35,7 +35,7 @@ ConfigurePerGame::ConfigurePerGame(QWidget* parent, u64 title_id_, const QString
const bool is_powered_on = system.IsPoweredOn(); const bool is_powered_on = system.IsPoweredOn();
audio_tab = std::make_unique<ConfigureAudio>(is_powered_on, this); audio_tab = std::make_unique<ConfigureAudio>(is_powered_on, this);
general_tab = std::make_unique<ConfigureGeneral>(this); general_tab = std::make_unique<ConfigureGeneral>(is_powered_on, this);
enhancements_tab = std::make_unique<ConfigureEnhancements>(this); enhancements_tab = std::make_unique<ConfigureEnhancements>(this);
layout_tab = std::make_unique<ConfigureLayout>(this); layout_tab = std::make_unique<ConfigureLayout>(this);
graphics_tab = graphics_tab =