From 5181ff36ff5a8a4c1e54a000b26197fccd17dcb1 Mon Sep 17 00:00:00 2001 From: georgemoralis Date: Thu, 12 Jun 2025 09:31:25 +0300 Subject: [PATCH] more setting --- src/common/config.cpp | 11 ----------- src/common/config.h | 2 -- src/qt_gui/check_update.cpp | 2 +- src/qt_gui/gui_settings.h | 1 + src/qt_gui/settings_dialog.cpp | 11 +++++++---- 5 files changed, 9 insertions(+), 18 deletions(-) diff --git a/src/common/config.cpp b/src/common/config.cpp index 2b48a1bc0..fa0217646 100644 --- a/src/common/config.cpp +++ b/src/common/config.cpp @@ -50,7 +50,6 @@ static bool isMotionControlsEnabled = true; static bool isDebugDump = false; static bool isShaderDebug = false; static bool isShowSplash = false; -static bool isAlwaysShowChangelog = false; static std::string isSideTrophy = "right"; static bool isNullGpu = false; static bool shouldCopyGPUBuffers = false; @@ -243,10 +242,6 @@ bool showSplash() { return isShowSplash; } -bool alwaysShowChangelog() { - return isAlwaysShowChangelog; -} - std::string sideTrophy() { return isSideTrophy; } @@ -347,9 +342,6 @@ void setShowSplash(bool enable) { isShowSplash = enable; } -void setAlwaysShowChangelog(bool enable) { - isAlwaysShowChangelog = enable; -} void setSideTrophy(std::string side) { isSideTrophy = side; @@ -630,7 +622,6 @@ void load(const std::filesystem::path& path) { updateChannel = toml::find_or(general, "updateChannel", "Nightly"); } isShowSplash = toml::find_or(general, "showSplash", true); - isAlwaysShowChangelog = toml::find_or(general, "alwaysShowChangelog", false); isSideTrophy = toml::find_or(general, "sideTrophy", "right"); compatibilityData = toml::find_or(general, "compatibilityEnabled", false); checkCompatibilityOnStartup = @@ -810,7 +801,6 @@ void save(const std::filesystem::path& path) { data["General"]["updateChannel"] = updateChannel; data["General"]["chooseHomeTab"] = chooseHomeTab; data["General"]["showSplash"] = isShowSplash; - data["General"]["alwaysShowChangelog"] = isAlwaysShowChangelog; data["General"]["sideTrophy"] = isSideTrophy; data["General"]["compatibilityEnabled"] = compatibilityData; data["General"]["checkCompatibilityOnStartup"] = checkCompatibilityOnStartup; @@ -954,7 +944,6 @@ void setDefaultValues() { isDebugDump = false; isShaderDebug = false; isShowSplash = false; - isAlwaysShowChangelog = false; isSideTrophy = "right"; isNullGpu = false; shouldDumpShaders = false; diff --git a/src/common/config.h b/src/common/config.h index e5f4e0e48..56117ca67 100644 --- a/src/common/config.h +++ b/src/common/config.h @@ -63,7 +63,6 @@ bool allowHDR(); bool debugDump(); bool collectShadersForDebug(); bool showSplash(); -bool alwaysShowChangelog(); std::string sideTrophy(); bool nullGpu(); bool copyGPUCmdBuffers(); @@ -76,7 +75,6 @@ u32 vblankDiv(); void setDebugDump(bool enable); void setCollectShaderForDebug(bool enable); void setShowSplash(bool enable); -void setAlwaysShowChangelog(bool enable); void setSideTrophy(std::string side); void setNullGpu(bool enable); void setAllowHDR(bool enable); diff --git a/src/qt_gui/check_update.cpp b/src/qt_gui/check_update.cpp index 90a5ab560..9dd2ade55 100644 --- a/src/qt_gui/check_update.cpp +++ b/src/qt_gui/check_update.cpp @@ -275,7 +275,7 @@ void CheckUpdate::setupUI(const QString& downloadUrl, const QString& latestDate, } }); - if (Config::alwaysShowChangelog()) { + if (m_gui_settings->GetValue(gui::gen_showChangeLog).toBool()) { requestChangelog(currentRev, latestRev, downloadUrl, latestDate, currentDate); textField->setVisible(true); toggleButton->setText(tr("Hide Changelog")); diff --git a/src/qt_gui/gui_settings.h b/src/qt_gui/gui_settings.h index b8c05bcc0..1cd345ae3 100644 --- a/src/qt_gui/gui_settings.h +++ b/src/qt_gui/gui_settings.h @@ -15,6 +15,7 @@ const QString game_grid = "game_grid"; // general const gui_value gen_checkForUpdates = gui_value(general, "checkForUpdates", false); +const gui_value gen_showChangeLog = gui_value(general, "showChangeLog", false); // main window settings const gui_value mw_geometry = gui_value(main_window, "geometry", QByteArray()); diff --git a/src/qt_gui/settings_dialog.cpp b/src/qt_gui/settings_dialog.cpp index f7252b028..7ce03119f 100644 --- a/src/qt_gui/settings_dialog.cpp +++ b/src/qt_gui/settings_dialog.cpp @@ -181,8 +181,8 @@ SettingsDialog::SettingsDialog(std::shared_ptr gui_settings, m_gui_settings->SetValue(gui::gen_checkForUpdates, state == Qt::Checked); }); - connect(ui->changelogCheckBox, &QCheckBox::stateChanged, this, - [](int state) { Config::setAlwaysShowChangelog(state == Qt::Checked); }); + connect(ui->changelogCheckBox, &QCheckBox::stateChanged, this, [this](int state) { m_gui_settings->SetValue(gui::gen_showChangeLog,state == Qt::Checked); + }); #else connect(ui->updateCheckBox, &QCheckBox::checkStateChanged, this, [this](Qt::CheckState state) { @@ -190,7 +190,9 @@ SettingsDialog::SettingsDialog(std::shared_ptr gui_settings, }); connect(ui->changelogCheckBox, &QCheckBox::checkStateChanged, this, - [](Qt::CheckState state) { Config::setAlwaysShowChangelog(state == Qt::Checked); }); + [this](Qt::CheckState state) { + m_gui_settings->SetValue(gui::gen_showChangeLog, state == Qt::Checked); + }); #endif connect(ui->updateComboBox, &QComboBox::currentTextChanged, this, @@ -792,7 +794,7 @@ void SettingsDialog::UpdateSettings() { Config::setCollectShaderForDebug(ui->collectShaderCheckBox->isChecked()); Config::setCopyGPUCmdBuffers(ui->copyGPUBuffersCheckBox->isChecked()); m_gui_settings->SetValue(gui::gen_checkForUpdates, ui->updateCheckBox->isChecked()); - Config::setAlwaysShowChangelog(ui->changelogCheckBox->isChecked()); + m_gui_settings->SetValue(gui::gen_showChangeLog,ui->changelogCheckBox->isChecked()); Config::setUpdateChannel(channelMap.value(ui->updateComboBox->currentText()).toStdString()); Config::setChooseHomeTab( chooseHomeTabMap.value(ui->chooseHomeTabComboBox->currentText()).toStdString()); @@ -877,4 +879,5 @@ void SettingsDialog::setDefaultValues() { m_gui_settings->SetValue(gui::gl_playBackgroundMusic, false); m_gui_settings->SetValue(gui::gl_backgroundMusicVolume, 50); m_gui_settings->SetValue(gui::gen_checkForUpdates, false); + m_gui_settings->SetValue(gui::gen_showChangeLog, false); } \ No newline at end of file