mirror of
https://github.com/yuzu-emu/yuzu.git
synced 2024-08-21 17:23:24 +02:00
configuration: Initial work to reset all settings
This commit does not compile. Initial work to add and connect a Reset to Defaults button to the configure_general tab. Co-authored-by: german77 <juangerman-13@hotmail.com>
This commit is contained in:
parent
65b389da70
commit
8aeb425669
@ -1632,6 +1632,12 @@ void Config::Save() {
|
|||||||
SaveValues();
|
SaveValues();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void Config::ResetDefaults() {
|
||||||
|
FS::Delete(qt_config_loc);
|
||||||
|
FS::CreateFullPath(qt_config_loc);
|
||||||
|
Reload();
|
||||||
|
}
|
||||||
|
|
||||||
void Config::ReadControlPlayerValue(std::size_t player_index) {
|
void Config::ReadControlPlayerValue(std::size_t player_index) {
|
||||||
qt_config->beginGroup(QStringLiteral("Controls"));
|
qt_config->beginGroup(QStringLiteral("Controls"));
|
||||||
ReadPlayerValue(player_index);
|
ReadPlayerValue(player_index);
|
||||||
|
@ -28,6 +28,7 @@ public:
|
|||||||
|
|
||||||
void Reload();
|
void Reload();
|
||||||
void Save();
|
void Save();
|
||||||
|
void ResetDefaults();
|
||||||
|
|
||||||
void ReadControlPlayerValue(std::size_t player_index);
|
void ReadControlPlayerValue(std::size_t player_index);
|
||||||
void SaveControlPlayerValue(std::size_t player_index);
|
void SaveControlPlayerValue(std::size_t player_index);
|
||||||
|
@ -4,11 +4,13 @@
|
|||||||
|
|
||||||
#include <QCheckBox>
|
#include <QCheckBox>
|
||||||
#include <QSpinBox>
|
#include <QSpinBox>
|
||||||
|
#include <QMessageBox>
|
||||||
#include "common/settings.h"
|
#include "common/settings.h"
|
||||||
#include "core/core.h"
|
#include "core/core.h"
|
||||||
#include "ui_configure_general.h"
|
#include "ui_configure_general.h"
|
||||||
#include "yuzu/configuration/configuration_shared.h"
|
#include "yuzu/configuration/configuration_shared.h"
|
||||||
#include "yuzu/configuration/configure_general.h"
|
#include "yuzu/configuration/configure_general.h"
|
||||||
|
#include "yuzu/configuration/config.h"
|
||||||
#include "yuzu/uisettings.h"
|
#include "yuzu/uisettings.h"
|
||||||
|
|
||||||
ConfigureGeneral::ConfigureGeneral(QWidget* parent)
|
ConfigureGeneral::ConfigureGeneral(QWidget* parent)
|
||||||
@ -23,6 +25,9 @@ ConfigureGeneral::ConfigureGeneral(QWidget* parent)
|
|||||||
connect(ui->toggle_frame_limit, &QCheckBox::clicked, ui->frame_limit,
|
connect(ui->toggle_frame_limit, &QCheckBox::clicked, ui->frame_limit,
|
||||||
[this]() { ui->frame_limit->setEnabled(ui->toggle_frame_limit->isChecked()); });
|
[this]() { ui->frame_limit->setEnabled(ui->toggle_frame_limit->isChecked()); });
|
||||||
}
|
}
|
||||||
|
|
||||||
|
connect(ui->button_reset_defaults, &QPushButton::clicked, this,
|
||||||
|
&ConfigureGeneral::ResetDefaults);
|
||||||
}
|
}
|
||||||
|
|
||||||
ConfigureGeneral::~ConfigureGeneral() = default;
|
ConfigureGeneral::~ConfigureGeneral() = default;
|
||||||
@ -49,6 +54,15 @@ void ConfigureGeneral::SetConfiguration() {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void ConfigureGeneral::ResetDefaults() {
|
||||||
|
QMessageBox::StandardButton answer = QMessageBox::question(
|
||||||
|
this, tr("yuzu"), tr("Are you sure you want to <b>reset your settings</b>?"),
|
||||||
|
QMessageBox::Yes | QMessageBox::No, QMessageBox::No);
|
||||||
|
if (answer == QMessageBox::No)
|
||||||
|
return;
|
||||||
|
UISettings::values.
|
||||||
|
}
|
||||||
|
|
||||||
void ConfigureGeneral::ApplyConfiguration() {
|
void ConfigureGeneral::ApplyConfiguration() {
|
||||||
ConfigurationShared::ApplyPerGameSetting(&Settings::values.use_multi_core, ui->use_multi_core,
|
ConfigurationShared::ApplyPerGameSetting(&Settings::values.use_multi_core, ui->use_multi_core,
|
||||||
use_multi_core);
|
use_multi_core);
|
||||||
|
@ -24,6 +24,7 @@ public:
|
|||||||
explicit ConfigureGeneral(QWidget* parent = nullptr);
|
explicit ConfigureGeneral(QWidget* parent = nullptr);
|
||||||
~ConfigureGeneral() override;
|
~ConfigureGeneral() override;
|
||||||
|
|
||||||
|
void ResetDefaults();
|
||||||
void ApplyConfiguration();
|
void ApplyConfiguration();
|
||||||
|
|
||||||
private:
|
private:
|
||||||
|
@ -91,6 +91,13 @@
|
|||||||
</layout>
|
</layout>
|
||||||
</widget>
|
</widget>
|
||||||
</item>
|
</item>
|
||||||
|
<item alignment="Qt::AlignRight">
|
||||||
|
<widget class="QPushButton" name="button_reset_defaults">
|
||||||
|
<property name="text">
|
||||||
|
<string>Reset All Settings</string>
|
||||||
|
</property>
|
||||||
|
</widget>
|
||||||
|
</item>
|
||||||
<item>
|
<item>
|
||||||
<spacer name="verticalSpacer">
|
<spacer name="verticalSpacer">
|
||||||
<property name="orientation">
|
<property name="orientation">
|
||||||
|
@ -2593,7 +2593,11 @@ void GMainWindow::OnConfigure() {
|
|||||||
configure_dialog.ApplyConfiguration();
|
configure_dialog.ApplyConfiguration();
|
||||||
controller_dialog->refreshConfiguration();
|
controller_dialog->refreshConfiguration();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
configure_dialog.ApplyConfiguration();
|
||||||
|
controller_dialog->refreshConfiguration();
|
||||||
InitializeHotkeys();
|
InitializeHotkeys();
|
||||||
|
|
||||||
if (UISettings::values.theme != old_theme) {
|
if (UISettings::values.theme != old_theme) {
|
||||||
UpdateUITheme();
|
UpdateUITheme();
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user