mirror of
https://github.com/shadps4-emu/shadPS4.git
synced 2025-07-26 03:55:37 +00:00
more settings
This commit is contained in:
parent
e3319a5471
commit
4b63f9ea23
@ -50,7 +50,6 @@ static bool isMotionControlsEnabled = true;
|
|||||||
static bool isDebugDump = false;
|
static bool isDebugDump = false;
|
||||||
static bool isShaderDebug = false;
|
static bool isShaderDebug = false;
|
||||||
static bool isShowSplash = false;
|
static bool isShowSplash = false;
|
||||||
static bool isAutoUpdate = false;
|
|
||||||
static bool isAlwaysShowChangelog = false;
|
static bool isAlwaysShowChangelog = false;
|
||||||
static std::string isSideTrophy = "right";
|
static std::string isSideTrophy = "right";
|
||||||
static bool isNullGpu = false;
|
static bool isNullGpu = false;
|
||||||
@ -243,10 +242,6 @@ bool showSplash() {
|
|||||||
return isShowSplash;
|
return isShowSplash;
|
||||||
}
|
}
|
||||||
|
|
||||||
bool autoUpdate() {
|
|
||||||
return isAutoUpdate;
|
|
||||||
}
|
|
||||||
|
|
||||||
bool alwaysShowChangelog() {
|
bool alwaysShowChangelog() {
|
||||||
return isAlwaysShowChangelog;
|
return isAlwaysShowChangelog;
|
||||||
}
|
}
|
||||||
@ -351,10 +346,6 @@ void setShowSplash(bool enable) {
|
|||||||
isShowSplash = enable;
|
isShowSplash = enable;
|
||||||
}
|
}
|
||||||
|
|
||||||
void setAutoUpdate(bool enable) {
|
|
||||||
isAutoUpdate = enable;
|
|
||||||
}
|
|
||||||
|
|
||||||
void setAlwaysShowChangelog(bool enable) {
|
void setAlwaysShowChangelog(bool enable) {
|
||||||
isAlwaysShowChangelog = enable;
|
isAlwaysShowChangelog = enable;
|
||||||
}
|
}
|
||||||
@ -629,7 +620,6 @@ void load(const std::filesystem::path& path) {
|
|||||||
updateChannel = toml::find_or<std::string>(general, "updateChannel", "Nightly");
|
updateChannel = toml::find_or<std::string>(general, "updateChannel", "Nightly");
|
||||||
}
|
}
|
||||||
isShowSplash = toml::find_or<bool>(general, "showSplash", true);
|
isShowSplash = toml::find_or<bool>(general, "showSplash", true);
|
||||||
isAutoUpdate = toml::find_or<bool>(general, "autoUpdate", false);
|
|
||||||
isAlwaysShowChangelog = toml::find_or<bool>(general, "alwaysShowChangelog", false);
|
isAlwaysShowChangelog = toml::find_or<bool>(general, "alwaysShowChangelog", false);
|
||||||
isSideTrophy = toml::find_or<std::string>(general, "sideTrophy", "right");
|
isSideTrophy = toml::find_or<std::string>(general, "sideTrophy", "right");
|
||||||
compatibilityData = toml::find_or<bool>(general, "compatibilityEnabled", false);
|
compatibilityData = toml::find_or<bool>(general, "compatibilityEnabled", false);
|
||||||
@ -809,7 +799,6 @@ void save(const std::filesystem::path& path) {
|
|||||||
data["General"]["updateChannel"] = updateChannel;
|
data["General"]["updateChannel"] = updateChannel;
|
||||||
data["General"]["chooseHomeTab"] = chooseHomeTab;
|
data["General"]["chooseHomeTab"] = chooseHomeTab;
|
||||||
data["General"]["showSplash"] = isShowSplash;
|
data["General"]["showSplash"] = isShowSplash;
|
||||||
data["General"]["autoUpdate"] = isAutoUpdate;
|
|
||||||
data["General"]["alwaysShowChangelog"] = isAlwaysShowChangelog;
|
data["General"]["alwaysShowChangelog"] = isAlwaysShowChangelog;
|
||||||
data["General"]["sideTrophy"] = isSideTrophy;
|
data["General"]["sideTrophy"] = isSideTrophy;
|
||||||
data["General"]["compatibilityEnabled"] = compatibilityData;
|
data["General"]["compatibilityEnabled"] = compatibilityData;
|
||||||
@ -953,7 +942,6 @@ void setDefaultValues() {
|
|||||||
isDebugDump = false;
|
isDebugDump = false;
|
||||||
isShaderDebug = false;
|
isShaderDebug = false;
|
||||||
isShowSplash = false;
|
isShowSplash = false;
|
||||||
isAutoUpdate = false;
|
|
||||||
isAlwaysShowChangelog = false;
|
isAlwaysShowChangelog = false;
|
||||||
isSideTrophy = "right";
|
isSideTrophy = "right";
|
||||||
isNullGpu = false;
|
isNullGpu = false;
|
||||||
|
@ -62,7 +62,6 @@ bool allowHDR();
|
|||||||
bool debugDump();
|
bool debugDump();
|
||||||
bool collectShadersForDebug();
|
bool collectShadersForDebug();
|
||||||
bool showSplash();
|
bool showSplash();
|
||||||
bool autoUpdate();
|
|
||||||
bool alwaysShowChangelog();
|
bool alwaysShowChangelog();
|
||||||
std::string sideTrophy();
|
std::string sideTrophy();
|
||||||
bool nullGpu();
|
bool nullGpu();
|
||||||
@ -76,7 +75,6 @@ u32 vblankDiv();
|
|||||||
void setDebugDump(bool enable);
|
void setDebugDump(bool enable);
|
||||||
void setCollectShaderForDebug(bool enable);
|
void setCollectShaderForDebug(bool enable);
|
||||||
void setShowSplash(bool enable);
|
void setShowSplash(bool enable);
|
||||||
void setAutoUpdate(bool enable);
|
|
||||||
void setAlwaysShowChangelog(bool enable);
|
void setAlwaysShowChangelog(bool enable);
|
||||||
void setSideTrophy(std::string side);
|
void setSideTrophy(std::string side);
|
||||||
void setNullGpu(bool enable);
|
void setNullGpu(bool enable);
|
||||||
|
@ -28,8 +28,10 @@
|
|||||||
|
|
||||||
using namespace Common::FS;
|
using namespace Common::FS;
|
||||||
|
|
||||||
CheckUpdate::CheckUpdate(const bool showMessage, QWidget* parent)
|
CheckUpdate::CheckUpdate(std::shared_ptr<gui_settings> gui_settings, const bool showMessage,
|
||||||
: QDialog(parent), networkManager(new QNetworkAccessManager(this)) {
|
QWidget* parent)
|
||||||
|
: QDialog(parent), m_gui_settings(std::move(gui_settings)),
|
||||||
|
networkManager(new QNetworkAccessManager(this)) {
|
||||||
setWindowTitle(tr("Auto Updater"));
|
setWindowTitle(tr("Auto Updater"));
|
||||||
setFixedSize(0, 0);
|
setFixedSize(0, 0);
|
||||||
CheckForUpdates(showMessage);
|
CheckForUpdates(showMessage);
|
||||||
@ -290,14 +292,14 @@ void CheckUpdate::setupUI(const QString& downloadUrl, const QString& latestDate,
|
|||||||
|
|
||||||
connect(noButton, &QPushButton::clicked, this, [this]() { close(); });
|
connect(noButton, &QPushButton::clicked, this, [this]() { close(); });
|
||||||
|
|
||||||
autoUpdateCheckBox->setChecked(Config::autoUpdate());
|
autoUpdateCheckBox->setChecked(m_gui_settings->GetValue(gui::gen_checkForUpdates).toBool());
|
||||||
#if (QT_VERSION < QT_VERSION_CHECK(6, 7, 0))
|
#if (QT_VERSION < QT_VERSION_CHECK(6, 7, 0))
|
||||||
connect(autoUpdateCheckBox, &QCheckBox::stateChanged, this, [](int state) {
|
connect(autoUpdateCheckBox, &QCheckBox::stateChanged, this, [this](int state) {
|
||||||
#else
|
#else
|
||||||
connect(autoUpdateCheckBox, &QCheckBox::checkStateChanged, this, [](Qt::CheckState state) {
|
connect(autoUpdateCheckBox, &QCheckBox::checkStateChanged, this, [this](Qt::CheckState state) {
|
||||||
#endif
|
#endif
|
||||||
const auto user_dir = Common::FS::GetUserPath(Common::FS::PathType::UserDir);
|
const auto user_dir = Common::FS::GetUserPath(Common::FS::PathType::UserDir);
|
||||||
Config::setAutoUpdate(state == Qt::Checked);
|
m_gui_settings->SetValue(gui::gen_checkForUpdates, (state == Qt::Checked));
|
||||||
Config::save(user_dir / "config.toml");
|
Config::save(user_dir / "config.toml");
|
||||||
});
|
});
|
||||||
|
|
||||||
|
@ -8,12 +8,14 @@
|
|||||||
#include <QDialog>
|
#include <QDialog>
|
||||||
#include <QNetworkAccessManager>
|
#include <QNetworkAccessManager>
|
||||||
#include <QPushButton>
|
#include <QPushButton>
|
||||||
|
#include "gui_settings.h"
|
||||||
|
|
||||||
class CheckUpdate : public QDialog {
|
class CheckUpdate : public QDialog {
|
||||||
Q_OBJECT
|
Q_OBJECT
|
||||||
|
|
||||||
public:
|
public:
|
||||||
explicit CheckUpdate(const bool showMessage, QWidget* parent = nullptr);
|
explicit CheckUpdate(std::shared_ptr<gui_settings> gui_settings, const bool showMessage,
|
||||||
|
QWidget* parent = nullptr);
|
||||||
~CheckUpdate();
|
~CheckUpdate();
|
||||||
|
|
||||||
private slots:
|
private slots:
|
||||||
@ -35,6 +37,7 @@ private:
|
|||||||
QString updateDownloadUrl;
|
QString updateDownloadUrl;
|
||||||
|
|
||||||
QNetworkAccessManager* networkManager;
|
QNetworkAccessManager* networkManager;
|
||||||
|
std::shared_ptr<gui_settings> m_gui_settings;
|
||||||
};
|
};
|
||||||
|
|
||||||
#endif // CHECKUPDATE_H
|
#endif // CHECKUPDATE_H
|
||||||
|
@ -8,10 +8,14 @@
|
|||||||
|
|
||||||
namespace gui {
|
namespace gui {
|
||||||
// categories
|
// categories
|
||||||
|
const QString general = "general";
|
||||||
const QString main_window = "main_window";
|
const QString main_window = "main_window";
|
||||||
const QString game_list = "game_list";
|
const QString game_list = "game_list";
|
||||||
const QString game_grid = "game_grid";
|
const QString game_grid = "game_grid";
|
||||||
|
|
||||||
|
// general
|
||||||
|
const gui_value gen_checkForUpdates = gui_value(general, "showLabelsUnderIcons", false);
|
||||||
|
|
||||||
// main window settings
|
// main window settings
|
||||||
const gui_value mw_geometry = gui_value(main_window, "geometry", QByteArray());
|
const gui_value mw_geometry = gui_value(main_window, "geometry", QByteArray());
|
||||||
const gui_value mw_showLabelsUnderIcons = gui_value(main_window, "showLabelsUnderIcons", true);
|
const gui_value mw_showLabelsUnderIcons = gui_value(main_window, "showLabelsUnderIcons", true);
|
||||||
|
@ -367,11 +367,11 @@ void MainWindow::LoadGameLists() {
|
|||||||
#ifdef ENABLE_UPDATER
|
#ifdef ENABLE_UPDATER
|
||||||
void MainWindow::CheckUpdateMain(bool checkSave) {
|
void MainWindow::CheckUpdateMain(bool checkSave) {
|
||||||
if (checkSave) {
|
if (checkSave) {
|
||||||
if (!Config::autoUpdate()) {
|
if (!m_gui_settings->GetValue(gui::gen_checkForUpdates).toBool()) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
auto checkUpdate = new CheckUpdate(false);
|
auto checkUpdate = new CheckUpdate(m_gui_settings, false);
|
||||||
checkUpdate->exec();
|
checkUpdate->exec();
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
@ -495,7 +495,7 @@ void MainWindow::CreateConnects() {
|
|||||||
|
|
||||||
#ifdef ENABLE_UPDATER
|
#ifdef ENABLE_UPDATER
|
||||||
connect(ui->updaterAct, &QAction::triggered, this, [this]() {
|
connect(ui->updaterAct, &QAction::triggered, this, [this]() {
|
||||||
auto checkUpdate = new CheckUpdate(true);
|
auto checkUpdate = new CheckUpdate(m_gui_settings, true);
|
||||||
checkUpdate->exec();
|
checkUpdate->exec();
|
||||||
});
|
});
|
||||||
#endif
|
#endif
|
||||||
|
@ -177,14 +177,16 @@ SettingsDialog::SettingsDialog(std::shared_ptr<gui_settings> gui_settings,
|
|||||||
{
|
{
|
||||||
#ifdef ENABLE_UPDATER
|
#ifdef ENABLE_UPDATER
|
||||||
#if (QT_VERSION < QT_VERSION_CHECK(6, 7, 0))
|
#if (QT_VERSION < QT_VERSION_CHECK(6, 7, 0))
|
||||||
connect(ui->updateCheckBox, &QCheckBox::stateChanged, this,
|
connect(ui->updateCheckBox, &QCheckBox::stateChanged, this, [this](int state) {
|
||||||
[](int state) { Config::setAutoUpdate(state == Qt::Checked); });
|
m_gui_settings->SetValue(gui::gen_checkForUpdates, state == Qt::Checked);
|
||||||
|
});
|
||||||
|
|
||||||
connect(ui->changelogCheckBox, &QCheckBox::stateChanged, this,
|
connect(ui->changelogCheckBox, &QCheckBox::stateChanged, this,
|
||||||
[](int state) { Config::setAlwaysShowChangelog(state == Qt::Checked); });
|
[](int state) { Config::setAlwaysShowChangelog(state == Qt::Checked); });
|
||||||
#else
|
#else
|
||||||
connect(ui->updateCheckBox, &QCheckBox::checkStateChanged, this,
|
connect(ui->updateCheckBox, &QCheckBox::checkStateChanged, this, [this](Qt::CheckState state) {
|
||||||
[](Qt::CheckState state) { Config::setAutoUpdate(state == Qt::Checked); });
|
m_gui_settings->SetValue(gui::gen_checkForUpdates, state == Qt::Checked);
|
||||||
|
});
|
||||||
|
|
||||||
connect(ui->changelogCheckBox, &QCheckBox::checkStateChanged, this,
|
connect(ui->changelogCheckBox, &QCheckBox::checkStateChanged, this,
|
||||||
[](Qt::CheckState state) { Config::setAlwaysShowChangelog(state == Qt::Checked); });
|
[](Qt::CheckState state) { Config::setAlwaysShowChangelog(state == Qt::Checked); });
|
||||||
@ -197,8 +199,8 @@ SettingsDialog::SettingsDialog(std::shared_ptr<gui_settings> gui_settings,
|
|||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
connect(ui->checkUpdateButton, &QPushButton::clicked, this, []() {
|
connect(ui->checkUpdateButton, &QPushButton::clicked, this, [this]() {
|
||||||
auto checkUpdate = new CheckUpdate(true);
|
auto checkUpdate = new CheckUpdate(m_gui_settings,true);
|
||||||
checkUpdate->exec();
|
checkUpdate->exec();
|
||||||
});
|
});
|
||||||
#else
|
#else
|
||||||
@ -788,7 +790,7 @@ void SettingsDialog::UpdateSettings() {
|
|||||||
Config::setVkCrashDiagnosticEnabled(ui->crashDiagnosticsCheckBox->isChecked());
|
Config::setVkCrashDiagnosticEnabled(ui->crashDiagnosticsCheckBox->isChecked());
|
||||||
Config::setCollectShaderForDebug(ui->collectShaderCheckBox->isChecked());
|
Config::setCollectShaderForDebug(ui->collectShaderCheckBox->isChecked());
|
||||||
Config::setCopyGPUCmdBuffers(ui->copyGPUBuffersCheckBox->isChecked());
|
Config::setCopyGPUCmdBuffers(ui->copyGPUBuffersCheckBox->isChecked());
|
||||||
Config::setAutoUpdate(ui->updateCheckBox->isChecked());
|
m_gui_settings->SetValue(gui::gen_checkForUpdates, ui->updateCheckBox->isChecked());
|
||||||
Config::setAlwaysShowChangelog(ui->changelogCheckBox->isChecked());
|
Config::setAlwaysShowChangelog(ui->changelogCheckBox->isChecked());
|
||||||
Config::setUpdateChannel(channelMap.value(ui->updateComboBox->currentText()).toStdString());
|
Config::setUpdateChannel(channelMap.value(ui->updateComboBox->currentText()).toStdString());
|
||||||
Config::setChooseHomeTab(
|
Config::setChooseHomeTab(
|
||||||
@ -873,4 +875,5 @@ void SettingsDialog::setDefaultValues() {
|
|||||||
m_gui_settings->SetValue(gui::gl_backgroundImageOpacity, 50);
|
m_gui_settings->SetValue(gui::gl_backgroundImageOpacity, 50);
|
||||||
m_gui_settings->SetValue(gui::gl_playBackgroundMusic, false);
|
m_gui_settings->SetValue(gui::gl_playBackgroundMusic, false);
|
||||||
m_gui_settings->SetValue(gui::gl_backgroundMusicVolume, 50);
|
m_gui_settings->SetValue(gui::gl_backgroundMusicVolume, 50);
|
||||||
|
m_gui_settings->SetValue(gui::gen_checkForUpdates, false);
|
||||||
}
|
}
|
Loading…
Reference in New Issue
Block a user