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

Clarifying name change in CommandManager & simplify PluginMenus...

... The purpose of the boolean field in command entries was to exclude certain
menu commands from being steps in macros, because they require user interaction.

Effects are never meant to be excluded, even though they normally have dialogs,
but in the context of macro execution, the parameters are supplied by other
means.
This commit is contained in:
Paul Licameli
2019-12-12 13:37:33 -05:00
parent db96d1ab10
commit 5cbafc6086
5 changed files with 33 additions and 53 deletions

View File

@@ -79,7 +79,7 @@ struct CommandListEntry
bool isGlobal;
bool isOccult;
bool isEffect;
bool hasDialog;
bool excludeFromMacros;
CommandFlag flags;
bool useStrictFlags{ false };
};
@@ -184,7 +184,7 @@ class AUDACITY_DLL_API CommandManager final
void AddItem(const CommandID &name,
const wxChar *label_in,
bool hasDialog,
bool excludeFromMacros,
CommandHandlerFinder finder,
CommandFunctorPointer callback,
CommandFlag flags,
@@ -247,7 +247,7 @@ class AUDACITY_DLL_API CommandManager final
void GetCategories(wxArrayString &cats);
void GetAllCommandNames(CommandIDs &names, bool includeMultis) const;
void GetAllCommandLabels(
wxArrayString &labels, std::vector<bool> &vHasDialog,
wxArrayString &labels, std::vector<bool> &vExcludeFromMacros,
bool includeMultis) const;
void GetAllCommandData(
CommandIDs &names,
@@ -302,7 +302,7 @@ private:
int NextIdentifier(int ID);
CommandListEntry *NewIdentifier(const CommandID & name,
const wxString & label,
bool hasDialog,
bool excludeFromMacros,
wxMenu *menu,
CommandHandlerFinder finder,
CommandFunctorPointer callback,
@@ -313,7 +313,7 @@ private:
void AddGlobalCommand(const CommandID &name,
const wxChar *label,
bool hasDialog,
bool excludeFromMacros,
CommandHandlerFinder finder,
CommandFunctorPointer callback,
const Options &options = {});
@@ -490,7 +490,7 @@ namespace MenuTable {
struct CommandItem final : BaseItem {
CommandItem(const CommandID &name_,
const wxString &label_in_,
bool hasDialog_,
bool excludeFromMacros_,
CommandHandlerFinder finder_,
CommandFunctorPointer callback_,
CommandFlag flags_,
@@ -499,7 +499,7 @@ namespace MenuTable {
const CommandID name;
const wxString label_in;
bool hasDialog;
bool excludeFromMacros;
CommandHandlerFinder finder;
CommandFunctorPointer callback;
CommandFlag flags;
@@ -588,12 +588,12 @@ namespace MenuTable {
{ return std::make_unique<SeparatorItem>(); }
inline std::unique_ptr<CommandItem> Command(
const CommandID &name, const wxString &label_in, bool hasDialog,
const CommandID &name, const wxString &label_in, bool excludeFromMacros,
CommandHandlerFinder finder, CommandFunctorPointer callback,
CommandFlag flags, const CommandManager::Options &options = {})
{
return std::make_unique<CommandItem>(
name, label_in, hasDialog, finder, callback, flags, options
name, label_in, excludeFromMacros, finder, callback, flags, options
);
}