1
0
mirror of https://github.com/cookiengineer/audacity synced 2025-11-21 08:27:13 +01:00

Move ResetConfiguration from Help to Tools menu.

Requested by Peter, and I agreed.
This commit is contained in:
James Crook
2020-06-02 18:01:18 +01:00
parent 722da170a1
commit 3a537540cc
2 changed files with 39 additions and 36 deletions

View File

@@ -304,37 +304,6 @@ namespace HelpActions {
struct Handler : CommandHandlerObject {
void OnResetConfig(const CommandContext &context)
{
auto &project = context.project;
wxString dir = gPrefs->Read("/Directories/TempDir");
gPrefs->DeleteAll();
// This stops ReloadPreferences warning about directory change
// on next restart.
gPrefs->Write("/Directories/TempDir", dir);
gPrefs->Write("/GUI/SyncLockTracks", 0);
gPrefs->Write("/SnapTo", 0 );
ProjectSelectionManager::Get( project ).AS_SetSnapTo( 0 );
// There are many more things we could reset here.
// Beeds discussion as to which make sense to.
// Maybe in future versions?
// - Reset Effects
// - Reset Recording and Playback volumes
// - Reset Selection formats (and for spectral too)
// - Reset Play-at-speed speed to x1
// - Reset Selected tool to cursor.
// - Stop playback/recording and unapply pause.
// - Set Zoom sensibly.
//ProjectSelectionManager::Get(project).AS_SetRate(44100.0);
gPrefs->Write("/AudioIO/SoundActivatedRecord", 0);
gPrefs->Flush();
DoReloadPreferences(project);
ToolManager::OnResetToolBars(context);
gPrefs->Flush();
}
void OnQuickFix(const CommandContext &context)
{
auto &project = context.project;
@@ -535,17 +504,14 @@ 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__

View File

@@ -11,6 +11,8 @@
#include "../Project.h"
#include "../ProjectSettings.h"
#include "../ProjectWindow.h"
#include "../ProjectSelectionManager.h"
#include "../toolbars/ToolManager.h"
#include "../Screenshot.h"
#include "../commands/CommandContext.h"
#include "../commands/CommandManager.h"
@@ -19,6 +21,7 @@
#include "../effects/EffectUI.h"
#include "../effects/RealtimeEffectManager.h"
#include "../prefs/EffectsPrefs.h"
#include "../prefs/PrefsDialog.h"
// private helper classes and functions
namespace {
@@ -369,6 +372,36 @@ namespace PluginActions {
struct Handler : CommandHandlerObject {
void OnResetConfig(const CommandContext &context)
{
auto &project = context.project;
wxString dir = gPrefs->Read("/Directories/TempDir");
gPrefs->DeleteAll();
// This stops ReloadPreferences warning about directory change
// on next restart.
gPrefs->Write("/Directories/TempDir", dir);
gPrefs->Write("/GUI/SyncLockTracks", 0);
gPrefs->Write("/SnapTo", 0 );
ProjectSelectionManager::Get( project ).AS_SetSnapTo( 0 );
// There are many more things we could reset here.
// Beeds discussion as to which make sense to.
// Maybe in future versions?
// - Reset Effects
// - Reset Recording and Playback volumes
// - Reset Selection formats (and for spectral too)
// - Reset Play-at-speed speed to x1
// - Reset Selected tool to cursor.
// - Stop playback/recording and unapply pause.
// - Set Zoom sensibly.
//ProjectSelectionManager::Get(project).AS_SetRate(44100.0);
gPrefs->Write("/AudioIO/SoundActivatedRecord", 0);
gPrefs->Flush();
DoReloadPreferences(project);
ToolManager::OnResetToolBars(context);
gPrefs->Flush();
}
void OnManageGenerators(const CommandContext &context)
{
auto &project = context.project;
@@ -840,6 +873,10 @@ BaseItemSharedPtr ToolsMenu()
),
Section( "Other",
Command( wxT("ConfigReset"), XXO("&Reset Configuration"),
FN(OnResetConfig),
AudioIONotBusyFlag() ),
Command( wxT("FancyScreenshot"), XXO("&Screenshot..."),
FN(OnScreenshot), AudioIONotBusyFlag() ),