1
0
mirror of https://github.com/cookiengineer/audacity synced 2026-02-16 07:47:58 +01:00

static CommandManager::Get()...

... not member functions of AudacityProject
This commit is contained in:
Paul Licameli
2019-04-26 17:17:04 -04:00
parent 805af452a4
commit 4ba4d0978b
23 changed files with 94 additions and 82 deletions

View File

@@ -314,14 +314,14 @@ MacroCommandsCatalog::MacroCommandsCatalog( const AudacityProject *project )
}
}
auto mManager = project->GetCommandManager();
auto &manager = CommandManager::Get( *project );
wxArrayString mLabels;
CommandIDs mNames;
std::vector<bool> vHasDialog;
mLabels.clear();
mNames.clear();
mManager->GetAllCommandLabels(mLabels, vHasDialog, true);
mManager->GetAllCommandNames(mNames, true);
manager.GetAllCommandLabels(mLabels, vHasDialog, true);
manager.GetAllCommandNames(mNames, true);
const bool english = wxGetLocale()->GetCanonicalName().StartsWith(wxT("en"));
@@ -774,9 +774,9 @@ bool MacroCommands::ApplyCommand( const wxString &friendlyCommand,
}
AudacityProject *project = GetActiveProject();
CommandManager * pManager = project->GetCommandManager();
auto &manager = CommandManager::Get( *project );
if( pContext ){
if( pManager->HandleTextualCommand( command, *pContext, AlwaysEnabledFlag, AlwaysEnabledFlag ) )
if( manager.HandleTextualCommand( command, *pContext, AlwaysEnabledFlag, AlwaysEnabledFlag ) )
return true;
pContext->Status( wxString::Format(
_("Your batch command of %s was not recognized."), friendlyCommand ));
@@ -785,7 +785,7 @@ bool MacroCommands::ApplyCommand( const wxString &friendlyCommand,
else
{
const CommandContext context( *GetActiveProject() );
if( pManager->HandleTextualCommand( command, context, AlwaysEnabledFlag, AlwaysEnabledFlag ) )
if( manager.HandleTextualCommand( command, context, AlwaysEnabledFlag, AlwaysEnabledFlag ) )
return true;
}