1
0
mirror of https://github.com/cookiengineer/audacity synced 2025-05-01 16:19:43 +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);
if (mMacroCommands.IsFixed(mActiveMacro)) {
if (mMacroCommands.IsFixed(macro)) {
wxBell();
event.Veto();
}
if( mMacroBeingRenamed.IsEmpty())
mMacroBeingRenamed = macro;
}
///
void MacrosWindow::OnMacrosEndEdit(wxListEvent &event)
{
if (event.IsEditCancelled()) {
mMacroBeingRenamed = "";
return;
}
if( mMacroBeingRenamed.IsEmpty())
return;
wxString newname = event.GetLabel();
mMacroCommands.RenameMacro(mActiveMacro, newname);
mActiveMacro = newname;
mMacroCommands.RenameMacro(mMacroBeingRenamed, newname);
if( mMacroBeingRenamed == mActiveMacro )
mActiveMacro = newname;
mMacroBeingRenamed="";
PopulateMacros();
UpdateMenus();
event.Veto();
}
///

View File

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