1
0
mirror of https://github.com/cookiengineer/audacity synced 2025-12-15 17:11:20 +01:00

Friendlier command names in the Edit Chains dialogs...

... Both the pane that lists the steps of the chain, and the selection dialog
for adding a new step.

NOT translating command names yet, though.
This commit is contained in:
Paul Licameli
2018-01-09 21:49:49 -05:00
parent fa53d521a2
commit 0319d6ea68
6 changed files with 102 additions and 52 deletions

View File

@@ -486,6 +486,8 @@ EditChainsDialog::~EditChainsDialog()
/// Creates the dialog and its contents.
void EditChainsDialog::Populate()
{
mCommandNames = BatchCommands::GetAllCommands();
//------------------------- Main section --------------------
ShuttleGui S(this, eIsCreating);
PopulateOrExchange(S);
@@ -627,11 +629,20 @@ void EditChainsDialog::PopulateList()
/// Add one item into mList
void EditChainsDialog::AddItem(const wxString &Action, const wxString &Params)
{
// Translate internal command name to a friendly form
auto item = make_iterator_range(mCommandNames).index_if(
[&](const CommandName &name){ return Action == name.second; }
);
auto friendlyName = item >= 0
? // wxGetTranslation
( mCommandNames[item].first )
: Action;
int i = mList->GetItemCount();
mList->InsertItem(i, wxT(""));
mList->SetItem(i, ItemNumberColumn, wxString::Format(wxT(" %02i"), i + 1));
mList->SetItem(i, ActionColumn, Action );
mList->SetItem(i, ActionColumn, friendlyName );
mList->SetItem(i, ParamsColumn, Params );
}