mirror of
https://github.com/cookiengineer/audacity
synced 2025-10-21 14:02:57 +02:00
CommandManager::Options also specified the long name
This commit is contained in:
@@ -434,7 +434,6 @@ CommandManager::CommandManager():
|
||||
bMakingOccultCommands( false )
|
||||
{
|
||||
mbSeparatorAllowed = false;
|
||||
mLongNameForItem = "";
|
||||
SetMaxList();
|
||||
}
|
||||
|
||||
@@ -817,11 +816,10 @@ void CommandManager::AddItem(const wxChar *name,
|
||||
CommandListEntry *entry =
|
||||
NewIdentifier(name,
|
||||
label_in,
|
||||
mLongNameForItem,
|
||||
options.longName,
|
||||
hasDialog,
|
||||
options.accel, CurrentMenu(), finder, callback,
|
||||
{}, 0, 0, options.bIsEffect, cookedParameter);
|
||||
mLongNameForItem = "";
|
||||
int ID = entry->id;
|
||||
wxString label = GetLabelWithDisabledAccel(entry);
|
||||
|
||||
|
@@ -162,6 +162,9 @@ class AUDACITY_DLL_API CommandManager final : public XMLTagHandler
|
||||
// Allow implicit construction from an accelerator string, which is
|
||||
// a very common case
|
||||
Options( const wxChar *accel_ ) : accel{ accel_ } {}
|
||||
// A two-argument constructor for another common case
|
||||
Options( const wxChar *accel_, const wxString &longName_ )
|
||||
: accel{ accel_ }, longName{ longName_ } {}
|
||||
|
||||
Options &&Accel (const wxChar *value) &&
|
||||
{ accel = value; return std::move(*this); }
|
||||
@@ -173,12 +176,15 @@ class AUDACITY_DLL_API CommandManager final : public XMLTagHandler
|
||||
{ parameter = value; return std::move(*this); }
|
||||
Options &&Mask (CommandMask value) &&
|
||||
{ mask = value; return std::move(*this); }
|
||||
Options &&LongName (const wxString &value) &&
|
||||
{ longName = value; return std::move(*this); }
|
||||
|
||||
const wxChar *accel{ wxT("") };
|
||||
int check{ -1 }; // default value means it's not a check item
|
||||
bool bIsEffect{ false };
|
||||
CommandParameter parameter{};
|
||||
CommandMask mask{ NoFlagsSpecified };
|
||||
wxString longName{}; // translated
|
||||
};
|
||||
|
||||
void AddItemList(const wxString & name,
|
||||
@@ -230,10 +236,6 @@ class AUDACITY_DLL_API CommandManager final : public XMLTagHandler
|
||||
|
||||
void SwapMenuBars();
|
||||
void SetOccultCommands( bool bOccult);
|
||||
CommandManager * SetLongName( const wxString & name ){
|
||||
mLongNameForItem = name;
|
||||
return this;
|
||||
}
|
||||
|
||||
|
||||
void SetCommandFlags(const wxString &name, CommandFlag flags, CommandMask mask);
|
||||
@@ -403,8 +405,6 @@ private:
|
||||
std::unique_ptr<wxMenu> uCurrentMenu;
|
||||
wxMenu *mCurrentMenu {};
|
||||
|
||||
wxString mLongNameForItem;
|
||||
|
||||
CommandFlag mDefaultFlags;
|
||||
CommandMask mDefaultMask;
|
||||
bool bMakingOccultCommands;
|
||||
|
Reference in New Issue
Block a user