1
0
mirror of https://github.com/cookiengineer/audacity synced 2025-10-26 23:33:49 +01:00

MacroCommandDialog remembers reference to project

This commit is contained in:
Paul Licameli
2019-05-22 07:07:57 -04:00
parent c39718fa1f
commit a769cdfe1d
3 changed files with 6 additions and 5 deletions

View File

@@ -86,9 +86,9 @@ ApplyMacroDialog::ApplyMacroDialog(
wxDefaultPosition, wxDefaultSize,
wxDEFAULT_DIALOG_STYLE | wxRESIZE_BORDER)
, mMacroCommands{ project }
, mCatalog( GetActiveProject() )
, mProject{ project }
, mCatalog( &project )
{
//AudacityProject * p = GetActiveProject();
mAbort = false;
mbExpanded = false;
if( bInherited )
@@ -332,7 +332,7 @@ void ApplyMacroDialog::OnApplyToFiles(wxCommandEvent & WXUNUSED(event))
gPrefs->Write(wxT("/Batch/ActiveMacro"), name);
gPrefs->Flush();
AudacityProject *project = GetActiveProject();
AudacityProject *project = &mProject;
if (!TrackList::Get( *project ).empty()) {
AudacityMessageBox(
XO("Please save and close the current project first.") );
@@ -730,7 +730,7 @@ void MacrosWindow::AddItem(const CommandID &Action, const wxString &Params)
void MacrosWindow::UpdateMenus()
{
// OK even on mac, as dialog is modal.
auto p = GetActiveProject();
auto p = &mProject;
MenuManager::Get(*p).RebuildMenuBar(*p);
}