mirror of
https://github.com/cookiengineer/audacity
synced 2025-04-30 15:49:41 +02:00
Remove use of GetActiveProject in MacroCommandsDialog...
... instead pass into it the project pointer already given to ctor of MacrosWindow
This commit is contained in:
parent
e2539be53b
commit
f85f4db704
@ -61,11 +61,12 @@ BEGIN_EVENT_TABLE(MacroCommandDialog, wxDialogWrapper)
|
||||
EVT_LIST_ITEM_SELECTED(CommandsListID, MacroCommandDialog::OnItemSelected)
|
||||
END_EVENT_TABLE();
|
||||
|
||||
MacroCommandDialog::MacroCommandDialog(wxWindow * parent, wxWindowID id):
|
||||
MacroCommandDialog::MacroCommandDialog(
|
||||
wxWindow * parent, wxWindowID id, AudacityProject &project):
|
||||
wxDialogWrapper(parent, id, XO("Select Command"),
|
||||
wxDefaultPosition, wxDefaultSize,
|
||||
wxCAPTION | wxRESIZE_BORDER)
|
||||
, mCatalog( GetActiveProject() )
|
||||
, mCatalog( &project )
|
||||
{
|
||||
SetLabel(XO("Select Command")); // Provide visual label
|
||||
SetName(XO("Select Command")); // Provide audible label
|
||||
|
@ -21,12 +21,13 @@ class wxTextCtrl;
|
||||
class wxListCtrl;
|
||||
class wxListEvent;
|
||||
class wxButton;
|
||||
class AudacityProject;
|
||||
class ShuttleGui;
|
||||
|
||||
class MacroCommandDialog final : public wxDialogWrapper {
|
||||
public:
|
||||
// constructors and destructors
|
||||
MacroCommandDialog(wxWindow *parent, wxWindowID id);
|
||||
MacroCommandDialog(wxWindow *parent, wxWindowID id, AudacityProject &project);
|
||||
void SetCommandAndParams(const CommandID &Command, const wxString &Params);
|
||||
public:
|
||||
CommandID mSelectedCommand;
|
||||
|
@ -523,6 +523,7 @@ enum {
|
||||
MacrosWindow::MacrosWindow(
|
||||
wxWindow * parent, AudacityProject &project, bool bExpanded):
|
||||
ApplyMacroDialog(parent, project, true)
|
||||
, mProject{ project }
|
||||
{
|
||||
mbExpanded = bExpanded;
|
||||
auto Title = WindowTitle();
|
||||
@ -1063,7 +1064,7 @@ void MacrosWindow::InsertCommandAt(int item)
|
||||
return;
|
||||
}
|
||||
|
||||
MacroCommandDialog d(this, wxID_ANY);
|
||||
MacroCommandDialog d(this, wxID_ANY, mProject);
|
||||
|
||||
if (!d.ShowModal()) {
|
||||
Raise();
|
||||
|
@ -121,6 +121,8 @@ private:
|
||||
void InsertCommandAt(int item);
|
||||
bool SaveChanges();
|
||||
|
||||
AudacityProject &mProject;
|
||||
|
||||
wxButton *mRemove;
|
||||
wxButton *mRename;
|
||||
wxButton *mRestore;
|
||||
|
Loading…
x
Reference in New Issue
Block a user