1
0
mirror of https://github.com/cookiengineer/audacity synced 2025-10-21 14:02:57 +02:00

Use TranslatedInternalString in MacroCommandsCatalog

This commit is contained in:
Paul Licameli
2018-03-15 19:06:30 -04:00
parent 6c8ba8b5bb
commit d258385e3a
5 changed files with 27 additions and 23 deletions

View File

@@ -128,7 +128,7 @@ void MacroCommandDialog::PopulateCommandList()
long ii = 0;
for ( const auto &entry : mCatalog )
// insert the user-facing string
mChoices->InsertItem( ii++, entry.friendly /* .Translation() */ );
mChoices->InsertItem( ii++, entry.name.Translated() );
}
void MacroCommandDialog::ValidateChoices()
@@ -162,18 +162,19 @@ void MacroCommandDialog::OnItemSelected(wxListEvent &event)
const auto &command = mCatalog[ event.GetIndex() ];
EffectManager & em = EffectManager::Get();
PluginID ID = em.GetEffectByIdentifier( command.internal );
PluginID ID = em.GetEffectByIdentifier( command.name.Internal() );
// If ID is empty, then the effect wasn't found, in which case, the user must have
// selected one of the "special" commands.
mEditParams->Enable(!ID.IsEmpty());
mUsePreset->Enable(em.HasPresets(ID));
if ( command.friendly == mCommand->GetValue() )
if ( command.name.Translated() == mCommand->GetValue() )
// This uses the assumption of uniqueness of translated names!
return;
mCommand->SetValue(command.friendly);
mInternalCommandName = command.internal;
mCommand->SetValue(command.name.Translated());
mInternalCommandName = command.name.Internal();
wxString params = MacroCommands::GetCurrentParamsFor(mInternalCommandName);
if (params.IsEmpty())
@@ -221,8 +222,8 @@ void MacroCommandDialog::SetCommandAndParams(const wxString &Command, const wxSt
// -- AVOID THIS!
mCommand->SetValue( Command );
else {
mCommand->SetValue( iter->friendly /* .Translation() */ );
mDetails->SetValue( iter->internal + "\r\n" + iter->category );
mCommand->SetValue( iter->name.Translated() );
mDetails->SetValue( iter->name.Internal() + "\r\n" + iter->category );
mChoices->SetItemState(iter - mCatalog.begin(),
wxLIST_STATE_SELECTED, wxLIST_STATE_SELECTED);