1
0
mirror of https://github.com/cookiengineer/audacity synced 2025-05-02 08:39:46 +02:00

One possible idea for improving shortcuts list. This is NOT final.

Just want to get opinions.
This commit is contained in:
lllucius 2013-09-26 08:18:37 +00:00
parent 4f5de6d5e3
commit ec8e203676
3 changed files with 19 additions and 5 deletions

View File

@ -1150,7 +1150,12 @@ void CommandManager::GetAllCommandLabels(wxArrayString &names,
}
void CommandManager::GetAllCommandData(
wxArrayString &names, wxArrayString &keys, wxArrayString &default_keys, wxArrayString &labels, wxArrayString & categories,
wxArrayString &names,
wxArrayString &keys,
wxArrayString &default_keys,
wxArrayString &labels,
wxArrayString &categories,
wxArrayString &prefixes,
bool includeMultis)
{
unsigned int i;
@ -1163,6 +1168,7 @@ void CommandManager::GetAllCommandData(
default_keys.Add( mCommandList[i]->defaultKey);
labels.Add(mCommandList[i]->label);
categories.Add(mCommandList[i]->labelTop);
prefixes.Add(mCommandList[i]->labelPrefix);
}
else if( includeMultis )
{
@ -1171,6 +1177,7 @@ void CommandManager::GetAllCommandData(
default_keys.Add( mCommandList[i]->defaultKey);
labels.Add(mCommandList[i]->label);
categories.Add(mCommandList[i]->labelTop);
prefixes.Add(mCommandList[i]->labelPrefix);
}
}
}

View File

@ -195,7 +195,7 @@ class AUDACITY_DLL_API CommandManager: public XMLTagHandler
void GetAllCommandLabels(wxArrayString &labels, bool includeMultis);
void GetAllCommandData(
wxArrayString &names, wxArrayString &keys, wxArrayString &default_keys,
wxArrayString &labels, wxArrayString & categories,
wxArrayString &labels, wxArrayString &categories, wxArrayString &prefixes,
bool includeMultis);
wxString GetLabelFromName(wxString name);

View File

@ -184,12 +184,12 @@ void KeyConfigPrefs::PopulateOrExchange(ShuttleGui & S)
void KeyConfigPrefs::CreateList()
{
mList->InsertColumn(CommandColumn, _("Command"), wxLIST_FORMAT_LEFT);
mList->InsertColumn(KeyComboColumn, _("Key Combination"), wxLIST_FORMAT_LEFT);
mList->InsertColumn(KeyComboColumn, _("Combination"), wxLIST_FORMAT_LEFT);
RepopulateBindingsList();
mList->SetColumnWidth(CommandColumn, wxLIST_AUTOSIZE);
mList->SetColumnWidth(KeyComboColumn, 250);
mList->SetColumnWidth(KeyComboColumn, wxLIST_AUTOSIZE);
}
int KeyConfigPrefs::SortItems(long item1, long item2)
@ -242,7 +242,7 @@ void KeyConfigPrefs::RepopulateBindingsList()
mNames.Clear();
mLabels.Clear();
mDefaultKeys.Clear();
wxArrayString Keys,Labels,Categories;
wxArrayString Keys,Labels,Categories,Prefixes;
mManager->GetAllCommandData(
mNames,
@ -250,6 +250,7 @@ void KeyConfigPrefs::RepopulateBindingsList()
mDefaultKeys,
Labels,
Categories,
Prefixes,
// True to include effects (list items), false otherwise.
true
);
@ -287,6 +288,12 @@ void KeyConfigPrefs::RepopulateBindingsList()
}
label = wxMenuItem::GetLabelFromText(label.BeforeFirst(wxT('\t')));
if (!Prefixes[i].IsEmpty()) {
label = wxMenuItem::GetLabelFromText(Prefixes[i]) + wxT(" - ") + label;
}
if (cat == _("All")) {
label = Categories[i] + wxT(" - ") + label;
}
mLabels.Add(label);
// if (cat != _("All") && ! Categories[i].StartsWith(cat)) {