1
0
mirror of https://github.com/cookiengineer/audacity synced 2025-08-01 16:39:30 +02:00

Add File->Reset Menu Item (#ifdeffed out)

An compile-time optional menu item for checking the ResetProjectToEmpty() functionality.
This commit is contained in:
James Crook 2018-08-05 19:25:11 +01:00
parent 9357c90b43
commit 71005cf125
2 changed files with 18 additions and 0 deletions

View File

@ -332,6 +332,13 @@ void AudacityProject::CreateMenusAndCommands()
AudioIONotBusyFlag,
AudioIONotBusyFlag);
#ifdef EXPERIMENTAL_RESET
// Empty the current project and forget its name and path.
c->AddItem(wxT("Reset"), XXO("&Reset..."), FN(OnReset), wxT(""),
AudioIONotBusyFlag,
AudioIONotBusyFlag);
#endif
/////////////////////////////////////////////////////////////////////////////
CreateRecentFilesMenu(c);
@ -4752,6 +4759,16 @@ void AudacityProject::OnOpen(const CommandContext &WXUNUSED(context) )
OpenFiles(this);
}
// JKC: This is like OnClose, except it emptys the project in place,
// rather than createing a new empty project (with new toolbars etc).
// It does not test for unsaved changes.
// It is not in the menus by default. Its main purpose is/was for
// developers checking functionality of ResetProjectToEmpty().
void AudacityProject::OnReset(const CommandContext &WXUNUSED(context))
{
ResetProjectToEmpty();
}
void AudacityProject::OnClose(const CommandContext &WXUNUSED(context) )
{
mMenuClose = true;

View File

@ -217,6 +217,7 @@ void OnMacBringAllToFront(const CommandContext &context );
void OnNew(const CommandContext &context );
void OnOpen(const CommandContext &context );
void OnReset(const CommandContext &context);
void OnClose(const CommandContext &context );
void OnSave(const CommandContext &context );
void OnSaveAs(const CommandContext &context );