1
0
mirror of https://github.com/cookiengineer/audacity synced 2025-06-16 08:09:32 +02:00

Bug 2119 - Linux: Incorrect behaviors in "Manage Macro"

This commit is contained in:
James Crook 2019-07-16 10:17:55 +01:00
parent 2852d07a1e
commit fb11eeaedd
2 changed files with 14 additions and 5 deletions

View File

@ -922,26 +922,34 @@ void MacrosWindow::OnMacrosBeginEdit(wxListEvent &event)
wxString macro = mMacros->GetItemText(itemNo); wxString macro = mMacros->GetItemText(itemNo);
if (mMacroCommands.IsFixed(mActiveMacro)) { if (mMacroCommands.IsFixed(macro)) {
wxBell(); wxBell();
event.Veto(); event.Veto();
} }
if( mMacroBeingRenamed.IsEmpty())
mMacroBeingRenamed = macro;
} }
/// ///
void MacrosWindow::OnMacrosEndEdit(wxListEvent &event) void MacrosWindow::OnMacrosEndEdit(wxListEvent &event)
{ {
if (event.IsEditCancelled()) { if (event.IsEditCancelled()) {
mMacroBeingRenamed = "";
return; return;
} }
if( mMacroBeingRenamed.IsEmpty())
return;
wxString newname = event.GetLabel(); wxString newname = event.GetLabel();
mMacroCommands.RenameMacro(mActiveMacro, newname); mMacroCommands.RenameMacro(mMacroBeingRenamed, newname);
if( mMacroBeingRenamed == mActiveMacro )
mActiveMacro = newname; mActiveMacro = newname;
mMacroBeingRenamed="";
PopulateMacros(); PopulateMacros();
UpdateMenus();
event.Veto();
} }
/// ///

View File

@ -58,6 +58,7 @@ class ApplyMacroDialog : public wxDialogWrapper {
bool mAbort; bool mAbort;
bool mbExpanded; bool mbExpanded;
wxString mActiveMacro; wxString mActiveMacro;
wxString mMacroBeingRenamed;
protected: protected:
const MacroCommandsCatalog mCatalog; const MacroCommandsCatalog mCatalog;