mirror of
https://github.com/cookiengineer/audacity
synced 2025-11-14 17:14:07 +01:00
Bug 363 - (Part I) Provide a Reset Preferences command inside Audacity
This is the beginning of a configuration reset mechanism within Audacity.
This commit is contained in:
@@ -306,6 +306,18 @@ namespace HelpActions {
|
||||
|
||||
struct Handler : CommandHandlerObject {
|
||||
|
||||
void OnResetConfig(const CommandContext &context)
|
||||
{
|
||||
auto &project = context.project;
|
||||
wxString dir = gPrefs->Read(wxT("/Directories/TempDir"));
|
||||
gPrefs->DeleteAll();
|
||||
gPrefs->Write(wxT("/Directories/TempDir"), dir);
|
||||
// Code needed here to re-instate default menus.
|
||||
gPrefs->Flush();
|
||||
DoReloadPreferences(project);
|
||||
}
|
||||
|
||||
|
||||
void OnQuickFix(const CommandContext &context)
|
||||
{
|
||||
auto &project = context.project;
|
||||
@@ -506,14 +518,17 @@ BaseItemSharedPtr HelpMenu()
|
||||
AlwaysEnabledFlag ),
|
||||
// DA: Emphasise it is the Audacity Manual (No separate DA manual).
|
||||
Command( wxT("Manual"), XXO("Audacity &Manual"), FN(OnManual),
|
||||
AlwaysEnabledFlag )
|
||||
AlwaysEnabledFlag ),
|
||||
|
||||
#else
|
||||
Command( wxT("QuickHelp"), XXO("&Quick Help..."), FN(OnQuickHelp),
|
||||
AlwaysEnabledFlag ),
|
||||
Command( wxT("Manual"), XXO("&Manual..."), FN(OnManual),
|
||||
AlwaysEnabledFlag )
|
||||
AlwaysEnabledFlag ),
|
||||
#endif
|
||||
Command( wxT("ConfigReset"), XXO("Reset Configuration"),
|
||||
FN(OnResetConfig),
|
||||
AudioIONotBusyFlag() )
|
||||
),
|
||||
|
||||
#ifdef __WXMAC__
|
||||
|
||||
Reference in New Issue
Block a user