Merge pull request #13866 from JoshuaVandaele/reset-button-third-attempt

AdvancedPane: Add a button to restore default settings
This commit is contained in:
JMC47 authored and GitHub committed 2025-10-28 18:56:03 -04:00
commit 1ed86e1b16
28 files changed
+526 -439

No files matched your search

+23
View File
@@ -102,6 +102,29 @@ void SConfig::LoadSettings()
Config::Load();
}
void SConfig::ResetAllSettings()
{
Config::ConfigChangeCallbackGuard config_guard;
File::Delete(File::GetUserPath(F_DOLPHINCONFIG_IDX));
File::Delete(File::GetUserPath(F_GFXCONFIG_IDX));
File::Delete(File::GetUserPath(F_LOGGERCONFIG_IDX));
File::Delete(File::GetUserPath(F_DUALSHOCKUDPCLIENTCONFIG_IDX));
File::Delete(File::GetUserPath(F_FREELOOKCONFIG_IDX));
File::Delete(File::GetUserPath(F_RETROACHIEVEMENTSCONFIG_IDX));
File::Delete(File::GetUserPath(F_WIISYSCONF_IDX));
for (Config::LayerType layer_type : Config::SEARCH_ORDER)
{
const std::shared_ptr<Config::Layer> layer = Config::GetLayer(layer_type);
if (!layer)
continue;
layer->DeleteAllKeys();
}
Config::OnConfigChanged();
}
const std::string SConfig::GetGameID() const
{
std::lock_guard<std::recursive_mutex> lock(m_metadata_lock);
+2
View File
@@ -110,6 +110,8 @@ struct SConfig
// Load settings
void LoadSettings();
static void ResetAllSettings();
// Return the permanent and somewhat globally used instance of this struct
static SConfig& GetInstance() { return (*m_Instance); }
static void Init();