diff --git a/src/citra_qt/configuration/configure_general.cpp b/src/citra_qt/configuration/configure_general.cpp index 3153ff8c88..cd47b135e0 100644 --- a/src/citra_qt/configuration/configure_general.cpp +++ b/src/citra_qt/configuration/configure_general.cpp @@ -2,6 +2,7 @@ // Licensed under GPLv2 or any later version // Refer to the license.txt file included. +#include #include "citra_qt/configuration/configure_general.h" #include "citra_qt/ui_settings.h" #include "core/core.h" @@ -15,6 +16,8 @@ ConfigureGeneral::ConfigureGeneral(QWidget* parent) this->setConfiguration(); ui->updateBox->setVisible(UISettings::values.updater_found); + connect(ui->button_reset_defaults, &QPushButton::clicked, this, + &ConfigureGeneral::ResetDefaults); } ConfigureGeneral::~ConfigureGeneral() = default; @@ -33,6 +36,19 @@ void ConfigureGeneral::PopulateHotkeyList(const HotkeyRegistry& registry) { ui->hotkeysDialog->Populate(registry); } +void ConfigureGeneral::ResetDefaults() { + QMessageBox::StandardButton answer = QMessageBox::question( + this, tr("Citra"), + tr("Are you sure you want to reset your settings and close Citra?"), + QMessageBox::Yes | QMessageBox::No, QMessageBox::No); + + if (answer == QMessageBox::No) + return; + + FileUtil::Delete(FileUtil::GetUserPath(FileUtil::UserPath::ConfigDir) + "qt-config.ini"); + std::exit(0); +} + void ConfigureGeneral::applyConfiguration() { UISettings::values.confirm_before_closing = ui->toggle_check_exit->isChecked(); diff --git a/src/citra_qt/configuration/configure_general.h b/src/citra_qt/configuration/configure_general.h index 9e67589bfa..ff99c95103 100644 --- a/src/citra_qt/configuration/configure_general.h +++ b/src/citra_qt/configuration/configure_general.h @@ -21,6 +21,7 @@ public: ~ConfigureGeneral(); void PopulateHotkeyList(const HotkeyRegistry& registry); + void ResetDefaults(); void applyConfiguration(); void retranslateUi(); diff --git a/src/citra_qt/configuration/configure_general.ui b/src/citra_qt/configuration/configure_general.ui index 103ac54d3d..5979dd95b8 100644 --- a/src/citra_qt/configuration/configure_general.ui +++ b/src/citra_qt/configuration/configure_general.ui @@ -147,6 +147,13 @@ + + + + Reset All Settings + + +