AdvancedPane: Add a button to restore default settings
This commit is contained in:
11 files changed
+139
-34
No files matched your search
@@ -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);
|
||||
|
||||
@@ -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();
|
||||
|
||||
Reference in new issue
Block a user