1
0
mirror of https://github.com/cookiengineer/audacity synced 2025-11-05 08:33:53 +01:00

Add the ability to reset the Prefs.

Add japanese, SerbianCyrillic and ukrainian to the installer languages, since we have them in the app.
This commit is contained in:
martynshaw99
2012-03-29 23:53:08 +00:00
parent c742d8de0b
commit 75a27171fa
2 changed files with 37 additions and 3 deletions

View File

@@ -59,6 +59,7 @@
#include <wx/intl.h>
#include <wx/fileconf.h>
#include <wx/filename.h>
#include <wx/stdpaths.h>
#include "FileNames.h"
@@ -147,6 +148,30 @@ void InitPreferences()
wxConfigBase::Set(gPrefs);
static wxString resourcesDir;
resourcesDir = wxStandardPaths::Get().GetResourcesDir();
wxFileName fn;
fn = wxFileName( resourcesDir, wxT("resetPrefs.txt") );
if( fn.FileExists() ) // it will exist if the (win) installer put it there on request
{
// pop up a dialogue
wxString prompt = _("Reset Preferences?\n\nThis is a one-time question, after an 'install' where you asked to have the Preferences reset");
int action = wxMessageBox(prompt, _("Reset Audacity Preferences"),
wxYES_NO, NULL);
if(action == wxYES) // reset
{
gPrefs->DeleteAll();
gPrefs->Write(wxT("/NewPrefsInitialized"), true);
gPrefs->Flush();
}
bool gone = wxRemoveFile(fn.GetFullPath()); // remove resetPrefs.txt
if(!gone)
{
wxString fileName = fn.GetFullPath();
wxMessageBox(_("Failed to remove %s", fileName), _("Failed!"));
}
}
// We introduced new file-based preferences in version 1.3.1; the
// first time this version of Audacity is run we try to migrate
// old preferences.