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 {
|
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)
|
void OnQuickFix(const CommandContext &context)
|
||||||
{
|
{
|
||||||
auto &project = context.project;
|
auto &project = context.project;
|
||||||
@@ -506,14 +518,17 @@ BaseItemSharedPtr HelpMenu()
|
|||||||
AlwaysEnabledFlag ),
|
AlwaysEnabledFlag ),
|
||||||
// DA: Emphasise it is the Audacity Manual (No separate DA manual).
|
// DA: Emphasise it is the Audacity Manual (No separate DA manual).
|
||||||
Command( wxT("Manual"), XXO("Audacity &Manual"), FN(OnManual),
|
Command( wxT("Manual"), XXO("Audacity &Manual"), FN(OnManual),
|
||||||
AlwaysEnabledFlag )
|
AlwaysEnabledFlag ),
|
||||||
|
|
||||||
#else
|
#else
|
||||||
Command( wxT("QuickHelp"), XXO("&Quick Help..."), FN(OnQuickHelp),
|
Command( wxT("QuickHelp"), XXO("&Quick Help..."), FN(OnQuickHelp),
|
||||||
AlwaysEnabledFlag ),
|
AlwaysEnabledFlag ),
|
||||||
Command( wxT("Manual"), XXO("&Manual..."), FN(OnManual),
|
Command( wxT("Manual"), XXO("&Manual..."), FN(OnManual),
|
||||||
AlwaysEnabledFlag )
|
AlwaysEnabledFlag ),
|
||||||
#endif
|
#endif
|
||||||
|
Command( wxT("ConfigReset"), XXO("Reset Configuration"),
|
||||||
|
FN(OnResetConfig),
|
||||||
|
AudioIONotBusyFlag() )
|
||||||
),
|
),
|
||||||
|
|
||||||
#ifdef __WXMAC__
|
#ifdef __WXMAC__
|
||||||
|
|||||||
Reference in New Issue
Block a user