1
0
mirror of https://github.com/cookiengineer/audacity synced 2026-01-11 07:05:47 +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.

View File

@@ -13,7 +13,7 @@ Filename: "{app}\unins*.*";
[Setup]
; compiler-related directives
OutputBaseFilename=audacity-win-2.0
OutputBaseFilename=audacity-win-2.0.1
WizardImageFile=audacity_InnoWizardImage.bmp
WizardSmallImageFile=audacity_InnoWizardSmallImage.bmp
@@ -47,7 +47,6 @@ MinVersion=4.0,5.0
; costmetic-related directives
SetupIconFile=audacity.ico
[Languages]
Name: "english"; MessagesFile: "compiler:Default.isl"
Name: "basque"; MessagesFile: "compiler:Languages\Basque.isl"
@@ -62,20 +61,23 @@ Name: "german"; MessagesFile: "compiler:Languages\German.isl"
Name: "hebrew"; MessagesFile: "compiler:Languages\Hebrew.isl"
Name: "hungarian"; MessagesFile: "compiler:Languages\Hungarian.isl"
Name: "italian"; MessagesFile: "compiler:Languages\Italian.isl"
Name: "japanese"; MessagesFile: "compiler:Languages\Japanese.isl"
Name: "norwegian"; MessagesFile: "compiler:Languages\Norwegian.isl"
Name: "polish"; MessagesFile: "compiler:Languages\Polish.isl"
Name: "portuguese"; MessagesFile: "compiler:Languages\Portuguese.isl"
Name: "russian"; MessagesFile: "compiler:Languages\Russian.isl"
Name: "SerbianCyrillic"; MessagesFile: "compiler:Languages\SerbianCyrillic.isl"
Name: "slovak"; MessagesFile: "compiler:Languages\Slovak.isl"
Name: "slovenian"; MessagesFile: "compiler:Languages\Slovenian.isl"
Name: "spanish"; MessagesFile: "compiler:Languages\Spanish.isl"
Name: "ukrainian"; MessagesFile: "compiler:Languages\Ukrainian.isl"
[Tasks]
Name: desktopicon; Description: "Create a &desktop icon"; GroupDescription: "Additional icons:"
Name: resetPrefs; Description: "Reset Preferences"; Flags: unchecked
; No longer allow user to choose whether to associate AUP file type with Audacity.
; Name: associate_aup; Description: "&Associate Audacity project files"; GroupDescription: "Other tasks:"; Flags: checkedonce
[Files]
; Don't display in separate window, rather as InfoAfterFile. Source: "..\README.txt"; DestDir: "{app}"; Flags: ignoreversion isreadme
Source: "..\README.txt"; DestDir: "{app}"; Flags: ignoreversion
@@ -112,11 +114,18 @@ Source: "..\win\unicode release\modules\*"; DestDir: "{app}\Modules\"; Flags: ig
Source: "..\win\unicode release\nyquist\*"; DestDir: "{app}\Nyquist\"; Flags: ignoreversion recursesubdirs
Source: "..\win\unicode release\plug-ins\*"; DestDir: "{app}\Plug-Ins\"; Excludes: "analyze.ny"; Flags: ignoreversion
; File that acts as a markers to reset prefs.
; Needs the 'Permissions' so that Audacity can delete it
Source: "resetPrefs.txt"; DestDir: "{app}"; Permissions: users-modify; Tasks: resetPrefs
[Icons]
Name: "{commonprograms}\Audacity"; Filename: "{app}\audacity.exe"
Name: "{userdesktop}\Audacity"; Filename: "{app}\audacity.exe"; Tasks: desktopicon
[InstallDelete]
; Get rid of previous 'reset prefs' file, in case somebody want to reinstall without the reset option after they installed with it
Type: files; Name: "{app}\resetPrefs.txt"
; Get rid of Audacity 1.0.0 stuff that's no longer used.
Type: files; Name: "{app}\audacity-help.htb"
Type: files; Name: "{app}\audacity-1.2-help.htb"