mirror of
https://github.com/cookiengineer/audacity
synced 2026-04-26 07:53:42 +02:00
MacroCommandDialog remembers reference to project
This commit is contained in:
@@ -66,7 +66,7 @@ MacroCommandDialog::MacroCommandDialog(
|
|||||||
wxDialogWrapper(parent, id, XO("Select Command"),
|
wxDialogWrapper(parent, id, XO("Select Command"),
|
||||||
wxDefaultPosition, wxDefaultSize,
|
wxDefaultPosition, wxDefaultSize,
|
||||||
wxCAPTION | wxRESIZE_BORDER)
|
wxCAPTION | wxRESIZE_BORDER)
|
||||||
, mCatalog( &project )
|
, mCatalog{ &project }
|
||||||
{
|
{
|
||||||
SetLabel(XO("Select Command")); // Provide visual label
|
SetLabel(XO("Select Command")); // Provide visual label
|
||||||
SetName(XO("Select Command")); // Provide audible label
|
SetName(XO("Select Command")); // Provide audible label
|
||||||
|
|||||||
@@ -86,9 +86,9 @@ ApplyMacroDialog::ApplyMacroDialog(
|
|||||||
wxDefaultPosition, wxDefaultSize,
|
wxDefaultPosition, wxDefaultSize,
|
||||||
wxDEFAULT_DIALOG_STYLE | wxRESIZE_BORDER)
|
wxDEFAULT_DIALOG_STYLE | wxRESIZE_BORDER)
|
||||||
, mMacroCommands{ project }
|
, mMacroCommands{ project }
|
||||||
, mCatalog( GetActiveProject() )
|
, mProject{ project }
|
||||||
|
, mCatalog( &project )
|
||||||
{
|
{
|
||||||
//AudacityProject * p = GetActiveProject();
|
|
||||||
mAbort = false;
|
mAbort = false;
|
||||||
mbExpanded = false;
|
mbExpanded = false;
|
||||||
if( bInherited )
|
if( bInherited )
|
||||||
@@ -332,7 +332,7 @@ void ApplyMacroDialog::OnApplyToFiles(wxCommandEvent & WXUNUSED(event))
|
|||||||
gPrefs->Write(wxT("/Batch/ActiveMacro"), name);
|
gPrefs->Write(wxT("/Batch/ActiveMacro"), name);
|
||||||
gPrefs->Flush();
|
gPrefs->Flush();
|
||||||
|
|
||||||
AudacityProject *project = GetActiveProject();
|
AudacityProject *project = &mProject;
|
||||||
if (!TrackList::Get( *project ).empty()) {
|
if (!TrackList::Get( *project ).empty()) {
|
||||||
AudacityMessageBox(
|
AudacityMessageBox(
|
||||||
XO("Please save and close the current project first.") );
|
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()
|
void MacrosWindow::UpdateMenus()
|
||||||
{
|
{
|
||||||
// OK even on mac, as dialog is modal.
|
// OK even on mac, as dialog is modal.
|
||||||
auto p = GetActiveProject();
|
auto p = &mProject;
|
||||||
MenuManager::Get(*p).RebuildMenuBar(*p);
|
MenuManager::Get(*p).RebuildMenuBar(*p);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -63,6 +63,7 @@ class ApplyMacroDialog : public wxDialogWrapper {
|
|||||||
wxString mMacroBeingRenamed;
|
wxString mMacroBeingRenamed;
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
|
AudacityProject &mProject;
|
||||||
const MacroCommandsCatalog mCatalog;
|
const MacroCommandsCatalog mCatalog;
|
||||||
|
|
||||||
DECLARE_EVENT_TABLE()
|
DECLARE_EVENT_TABLE()
|
||||||
|
|||||||
Reference in New Issue
Block a user