mirror of
https://github.com/cookiengineer/audacity
synced 2025-09-18 17:10:55 +02:00
Now use that extra information
This commit is contained in:
parent
bb7b77cde0
commit
b75e356df6
@ -315,16 +315,17 @@ MacroCommandsCatalog::MacroCommandsCatalog( const AudacityProject *project )
|
||||
auto mManager = project->GetCommandManager();
|
||||
wxArrayString mLabels;
|
||||
wxArrayString mNames;
|
||||
std::vector<bool> vHasDialog;
|
||||
mLabels.Clear();
|
||||
mNames.Clear();
|
||||
mManager->GetAllCommandLabels(mLabels, true);
|
||||
mManager->GetAllCommandLabels(mLabels, vHasDialog, true);
|
||||
mManager->GetAllCommandNames(mNames, true);
|
||||
|
||||
const bool english = wxGetLocale()->GetCanonicalName().StartsWith(wxT("en"));
|
||||
|
||||
for(size_t i=0; i<mNames.GetCount(); i++) {
|
||||
wxString label = mLabels[i];
|
||||
if( !label.Contains( "..." ) ){
|
||||
if( !vHasDialog[i] ){
|
||||
label.Replace( "&", "" );
|
||||
bool suffix;
|
||||
if (!english)
|
||||
|
@ -979,7 +979,7 @@ CommandListEntry *CommandManager::NewIdentifier(const wxString & name,
|
||||
|
||||
CommandListEntry *CommandManager::NewIdentifier(const wxString & nameIn,
|
||||
const wxString & label,
|
||||
bool WXUNUSED(hasDialog),
|
||||
bool hasDialog,
|
||||
const wxString & accel,
|
||||
wxMenu *menu,
|
||||
CommandHandlerFinder finder,
|
||||
@ -1046,6 +1046,7 @@ CommandListEntry *CommandManager::NewIdentifier(const wxString & nameIn,
|
||||
|
||||
entry->name = name;
|
||||
entry->label = label;
|
||||
entry->hasDialog = hasDialog;
|
||||
entry->key = NormalizedKeyString{ accel.BeforeFirst(wxT('\t')) };
|
||||
entry->defaultKey = entry->key;
|
||||
entry->labelPrefix = labelPrefix;
|
||||
@ -1678,8 +1679,10 @@ void CommandManager::GetAllCommandNames(wxArrayString &names,
|
||||
}
|
||||
|
||||
void CommandManager::GetAllCommandLabels(wxArrayString &names,
|
||||
std::vector<bool> &vHasDialog,
|
||||
bool includeMultis) const
|
||||
{
|
||||
vHasDialog.clear();
|
||||
for(const auto &entry : mCommandList) {
|
||||
// This is fetching commands from the menus, for use as batch commands.
|
||||
// Until we have properly merged EffectManager and CommandManager
|
||||
@ -1688,9 +1691,9 @@ void CommandManager::GetAllCommandLabels(wxArrayString &names,
|
||||
if ( entry->isEffect )
|
||||
continue;
|
||||
if (!entry->multi)
|
||||
names.Add(entry->label);
|
||||
names.Add(entry->label), vHasDialog.push_back(entry->hasDialog);
|
||||
else if( includeMultis )
|
||||
names.Add(entry->label);
|
||||
names.Add(entry->label), vHasDialog.push_back(entry->hasDialog);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -83,6 +83,7 @@ struct CommandListEntry
|
||||
bool isGlobal;
|
||||
bool isOccult;
|
||||
bool isEffect;
|
||||
bool hasDialog;
|
||||
CommandFlag flags;
|
||||
CommandMask mask;
|
||||
};
|
||||
@ -288,7 +289,9 @@ class AUDACITY_DLL_API CommandManager final : public XMLTagHandler
|
||||
|
||||
void GetCategories(wxArrayString &cats);
|
||||
void GetAllCommandNames(wxArrayString &names, bool includeMultis) const;
|
||||
void GetAllCommandLabels(wxArrayString &labels, bool includeMultis) const;
|
||||
void GetAllCommandLabels(
|
||||
wxArrayString &labels, std::vector<bool> &vHasDialog,
|
||||
bool includeMultis) const;
|
||||
void GetAllCommandData(
|
||||
wxArrayString &names,
|
||||
std::vector<NormalizedKeyString> &keys,
|
||||
|
Loading…
x
Reference in New Issue
Block a user