mirror of
https://github.com/hrydgard/ppsspp.git
synced 2025-02-09 07:42:15 +00:00
Add an option to restore PPSSPP's settings to default. Does not restore controller bindings to default.
This commit is contained in:
parent
236fb5f7ef
commit
d113254774
@ -372,3 +372,11 @@ void Config::CleanRecent() {
|
||||
}
|
||||
recentIsos = cleanedRecent;
|
||||
}
|
||||
|
||||
void Config::RestoreDefaults() {
|
||||
if(File::Exists("ppsspp.ini"))
|
||||
File::Delete("ppsspp.ini");
|
||||
recentIsos.clear();
|
||||
currentDirectory = "";
|
||||
Load();
|
||||
}
|
||||
|
@ -165,6 +165,7 @@ public:
|
||||
|
||||
void Load(const char *iniFileName = "ppsspp.ini", const char *controllerIniFilename = "controls.ini");
|
||||
void Save();
|
||||
void RestoreDefaults();
|
||||
|
||||
// Utility functions for "recent" management
|
||||
void AddRecent(const std::string &file);
|
||||
|
@ -525,6 +525,7 @@ void DeveloperToolsScreen::CreateViews() {
|
||||
list->Add(new ItemHeader(g->T("General")));
|
||||
list->Add(new Choice(d->T("System Information")))->OnClick.Handle(this, &DeveloperToolsScreen::OnSysInfo);
|
||||
list->Add(new Choice(d->T("Run CPU Tests")))->OnClick.Handle(this, &DeveloperToolsScreen::OnRunCPUTests);
|
||||
list->Add(new Choice(d->T("Restore PPSSPP Default Settings")))->OnClick.Handle(this, &DeveloperToolsScreen::OnRestoreDefaultSettings);
|
||||
#ifndef __SYMBIAN32__
|
||||
list->Add(new CheckBox(&g_Config.bSoftwareRendering, gs->T("Software Rendering", "Software Rendering (experimental)")));
|
||||
#endif
|
||||
@ -547,6 +548,21 @@ UI::EventReturn DeveloperToolsScreen::OnBack(UI::EventParams &e) {
|
||||
return UI::EVENT_DONE;
|
||||
}
|
||||
|
||||
void DeveloperToolsScreen::CallbackRestoreDefaults(bool yes) {
|
||||
if(yes)
|
||||
g_Config.RestoreDefaults();
|
||||
}
|
||||
|
||||
UI::EventReturn DeveloperToolsScreen::OnRestoreDefaultSettings(UI::EventParams &e) {
|
||||
I18NCategory *d = GetI18NCategory("Dialog");
|
||||
I18NCategory *g = GetI18NCategory("General");
|
||||
screenManager()->push(
|
||||
new PromptScreen(d->T("Are you sure you want to restore all settings(except control mapping) back to their defaults?\nYou can't undo this.\nPlease restart PPSSPP after restoring settings."), g->T("OK"), g->T("Cancel"),
|
||||
std::bind(&DeveloperToolsScreen::CallbackRestoreDefaults, this, placeholder::_1)));
|
||||
|
||||
return UI::EVENT_DONE;
|
||||
}
|
||||
|
||||
UI::EventReturn DeveloperToolsScreen::OnLoggingChanged(UI::EventParams &e) {
|
||||
#ifdef _WIN32
|
||||
PostMessage(MainWindow::hwndMain, MainWindow::WM_USER_LOG_STATUS_CHANGED, 0, 0);
|
||||
|
@ -78,6 +78,7 @@ public:
|
||||
|
||||
protected:
|
||||
virtual void CreateViews();
|
||||
void CallbackRestoreDefaults(bool yes);
|
||||
|
||||
private:
|
||||
UI::EventReturn OnBack(UI::EventParams &e);
|
||||
@ -86,6 +87,7 @@ private:
|
||||
UI::EventReturn OnLoggingChanged(UI::EventParams &e);
|
||||
UI::EventReturn OnLoadLanguageIni(UI::EventParams &e);
|
||||
UI::EventReturn OnSaveLanguageIni(UI::EventParams &e);
|
||||
UI::EventReturn OnRestoreDefaultSettings(UI::EventParams &e);
|
||||
|
||||
// Temporary variable.
|
||||
bool enableLogging_;
|
||||
|
Loading…
x
Reference in New Issue
Block a user