mirror of
https://github.com/cookiengineer/audacity
synced 2025-06-16 16:10:06 +02:00
Change CommandManager terminology: "Numeric id" not just "Id" ...
... because I will use CommandId for string identifiers instead, and those are the really persistent identification
This commit is contained in:
parent
11c8377460
commit
19bf094893
@ -577,7 +577,7 @@ void CommandManager::PurgeData()
|
|||||||
|
|
||||||
mCommandNameHash.clear();
|
mCommandNameHash.clear();
|
||||||
mCommandKeyHash.clear();
|
mCommandKeyHash.clear();
|
||||||
mCommandIDHash.clear();
|
mCommandNumericIDHash.clear();
|
||||||
|
|
||||||
mCurrentMenuName = COMMAND;
|
mCurrentMenuName = COMMAND;
|
||||||
mCurrentID = 17000;
|
mCurrentID = 17000;
|
||||||
@ -1064,7 +1064,7 @@ CommandListEntry *CommandManager::NewIdentifier(const CommandID & nameIn,
|
|||||||
|
|
||||||
// New variable
|
// New variable
|
||||||
CommandListEntry *entry = &*mCommandList.back();
|
CommandListEntry *entry = &*mCommandList.back();
|
||||||
mCommandIDHash[entry->id] = entry;
|
mCommandNumericIDHash[entry->id] = entry;
|
||||||
|
|
||||||
#if defined(__WXDEBUG__)
|
#if defined(__WXDEBUG__)
|
||||||
prev = mCommandNameHash[entry->name];
|
prev = mCommandNameHash[entry->name];
|
||||||
@ -1192,7 +1192,7 @@ void CommandManager::Enable(CommandListEntry *entry, bool enabled)
|
|||||||
|
|
||||||
// This menu item is not necessarily in the same menu, because
|
// This menu item is not necessarily in the same menu, because
|
||||||
// multi-items can be spread across multiple sub menus
|
// multi-items can be spread across multiple sub menus
|
||||||
CommandListEntry *multiEntry = mCommandIDHash[ID];
|
CommandListEntry *multiEntry = mCommandNumericIDHash[ID];
|
||||||
if (multiEntry) {
|
if (multiEntry) {
|
||||||
wxMenuItem *item = multiEntry->menu->FindItem(ID);
|
wxMenuItem *item = multiEntry->menu->FindItem(ID);
|
||||||
|
|
||||||
@ -1554,7 +1554,7 @@ bool CommandManager::HandleCommandEntry(const CommandListEntry * entry,
|
|||||||
#include "../prefs/KeyConfigPrefs.h"
|
#include "../prefs/KeyConfigPrefs.h"
|
||||||
bool CommandManager::HandleMenuID(int id, CommandFlag flags, CommandMask mask)
|
bool CommandManager::HandleMenuID(int id, CommandFlag flags, CommandMask mask)
|
||||||
{
|
{
|
||||||
CommandListEntry *entry = mCommandIDHash[id];
|
CommandListEntry *entry = mCommandNumericIDHash[id];
|
||||||
|
|
||||||
#ifdef EXPERIMENTAL_EASY_CHANGE_KEY_BINDINGS
|
#ifdef EXPERIMENTAL_EASY_CHANGE_KEY_BINDINGS
|
||||||
if (::wxGetMouseState().ShiftDown()) {
|
if (::wxGetMouseState().ShiftDown()) {
|
||||||
@ -1728,9 +1728,9 @@ void CommandManager::GetAllCommandData(
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
CommandID CommandManager::GetNameFromID(int id)
|
CommandID CommandManager::GetNameFromNumericID(int id)
|
||||||
{
|
{
|
||||||
CommandListEntry *entry = mCommandIDHash[id];
|
CommandListEntry *entry = mCommandNumericIDHash[id];
|
||||||
if (!entry)
|
if (!entry)
|
||||||
return {};
|
return {};
|
||||||
return entry->name;
|
return entry->name;
|
||||||
|
@ -95,7 +95,7 @@ using CommandList = std::vector<std::unique_ptr<CommandListEntry>>;
|
|||||||
|
|
||||||
using CommandKeyHash = std::unordered_map<NormalizedKeyString, CommandListEntry*>;
|
using CommandKeyHash = std::unordered_map<NormalizedKeyString, CommandListEntry*>;
|
||||||
using CommandNameHash = std::unordered_map<wxString, CommandListEntry*>;
|
using CommandNameHash = std::unordered_map<wxString, CommandListEntry*>;
|
||||||
using CommandIDHash = std::unordered_map<int, CommandListEntry*>;
|
using CommandNumericIDHash = std::unordered_map<int, CommandListEntry*>;
|
||||||
|
|
||||||
class AudacityProject;
|
class AudacityProject;
|
||||||
class CommandContext;
|
class CommandContext;
|
||||||
@ -253,7 +253,9 @@ class AUDACITY_DLL_API CommandManager final : public XMLTagHandler
|
|||||||
#endif
|
#endif
|
||||||
bool includeMultis);
|
bool includeMultis);
|
||||||
|
|
||||||
CommandID GetNameFromID( int id );
|
// Each command is assigned a numerical ID for use in wxMenu and wxEvent,
|
||||||
|
// which need not be the same across platforms or sessions
|
||||||
|
CommandID GetNameFromNumericID( int id );
|
||||||
|
|
||||||
wxString GetLabelFromName(const CommandID &name);
|
wxString GetLabelFromName(const CommandID &name);
|
||||||
wxString GetPrefixedLabelFromName(const CommandID &name);
|
wxString GetPrefixedLabelFromName(const CommandID &name);
|
||||||
@ -372,7 +374,7 @@ private:
|
|||||||
CommandList mCommandList;
|
CommandList mCommandList;
|
||||||
CommandNameHash mCommandNameHash;
|
CommandNameHash mCommandNameHash;
|
||||||
CommandKeyHash mCommandKeyHash;
|
CommandKeyHash mCommandKeyHash;
|
||||||
CommandIDHash mCommandIDHash;
|
CommandNumericIDHash mCommandNumericIDHash;
|
||||||
int mCurrentID;
|
int mCurrentID;
|
||||||
int mXMLKeysRead;
|
int mXMLKeysRead;
|
||||||
|
|
||||||
|
@ -653,7 +653,7 @@ void GetInfoCommand::ExploreMenu( const CommandContext &context, wxMenu * pMenu,
|
|||||||
for (size_t lndx = 0; lndx < lcnt; lndx++) {
|
for (size_t lndx = 0; lndx < lcnt; lndx++) {
|
||||||
item = list.Item(lndx)->GetData();
|
item = list.Item(lndx)->GetData();
|
||||||
Label = item->GetItemLabelText();
|
Label = item->GetItemLabelText();
|
||||||
Name = pMan->GetNameFromID( item->GetId() );
|
Name = pMan->GetNameFromNumericID( item->GetId() );
|
||||||
Accel = item->GetItemLabel();
|
Accel = item->GetItemLabel();
|
||||||
if( Accel.Contains("\t") )
|
if( Accel.Contains("\t") )
|
||||||
Accel = Accel.AfterLast('\t');
|
Accel = Accel.AfterLast('\t');
|
||||||
|
Loading…
x
Reference in New Issue
Block a user