mirror of
https://github.com/cookiengineer/audacity
synced 2025-12-13 08:06:32 +01:00
Organise the occult commands in the Preferences Key View.
This commit is contained in:
@@ -419,7 +419,8 @@ CommandManager::CommandManager():
|
||||
mCurrentID(17000),
|
||||
mCurrentMenuName(COMMAND),
|
||||
mDefaultFlags(AlwaysEnabledFlag),
|
||||
mDefaultMask(AlwaysEnabledFlag)
|
||||
mDefaultMask(AlwaysEnabledFlag),
|
||||
bMakingOccultCommands( false )
|
||||
{
|
||||
mbSeparatorAllowed = false;
|
||||
}
|
||||
@@ -903,6 +904,7 @@ CommandListEntry *CommandManager::NewIdentifier(const wxString & name,
|
||||
entry->skipKeydown = (accel.Find(wxT("\tskipKeydown")) != wxNOT_FOUND);
|
||||
entry->wantKeyup = (accel.Find(wxT("\twantKeyup")) != wxNOT_FOUND) || entry->skipKeydown;
|
||||
entry->isGlobal = false;
|
||||
entry->isOccult = bMakingOccultCommands;
|
||||
|
||||
// For key bindings for commands with a list, such as effects,
|
||||
// the name in prefs is the category name plus the effect name.
|
||||
@@ -1030,6 +1032,8 @@ void CommandManager::EnableUsingFlags(CommandFlag flags, CommandMask mask)
|
||||
for(const auto &entry : mCommandList) {
|
||||
if (entry->multi && entry->index != 0)
|
||||
continue;
|
||||
if( entry->isOccult )
|
||||
continue;
|
||||
|
||||
auto combinedMask = (mask & entry->mask);
|
||||
if (combinedMask) {
|
||||
@@ -1466,6 +1470,11 @@ void CommandManager::SetDefaultFlags(CommandFlag flags, CommandMask mask)
|
||||
mDefaultMask = mask;
|
||||
}
|
||||
|
||||
void CommandManager::SetOccultCommands( bool bOccult)
|
||||
{
|
||||
bMakingOccultCommands = bOccult;
|
||||
}
|
||||
|
||||
void CommandManager::SetCommandFlags(const wxString &name,
|
||||
CommandFlag flags, CommandMask mask)
|
||||
{
|
||||
|
||||
@@ -72,6 +72,7 @@ struct CommandListEntry
|
||||
bool skipKeydown;
|
||||
bool wantKeyup;
|
||||
bool isGlobal;
|
||||
bool isOccult;
|
||||
CommandFlag flags;
|
||||
CommandMask mask;
|
||||
};
|
||||
@@ -186,6 +187,9 @@ class AUDACITY_DLL_API CommandManager final : public XMLTagHandler
|
||||
CommandFlag GetDefaultFlags() const { return mDefaultFlags; }
|
||||
CommandMask GetDefaultMask() const { return mDefaultMask; }
|
||||
|
||||
void SetOccultCommands( bool bOccult);
|
||||
|
||||
|
||||
void SetCommandFlags(const wxString &name, CommandFlag flags, CommandMask mask);
|
||||
void SetCommandFlags(const wxChar **names,
|
||||
CommandFlag flags, CommandMask mask);
|
||||
@@ -328,6 +332,7 @@ private:
|
||||
|
||||
CommandFlag mDefaultFlags;
|
||||
CommandMask mDefaultMask;
|
||||
bool bMakingOccultCommands;
|
||||
};
|
||||
|
||||
#endif
|
||||
|
||||
@@ -293,7 +293,7 @@ void ExploreMenu( wxMenu * pMenu, int Id, int depth ){
|
||||
if (item->IsCheck() && item->IsChecked())
|
||||
flags +=2;
|
||||
|
||||
wxLogDebug("T.Add( %2i, %2i, 0, new wxString(\"%s<>%s\") );", depth, flags, Label,Accel );
|
||||
wxLogDebug("T.Add( %2i, %2i, 0, \"%s<>%s\" );", depth, flags, Label,Accel );
|
||||
if (item->IsSubMenu()) {
|
||||
pMenu = item->GetSubMenu();
|
||||
ExploreMenu( pMenu, item->GetId(), depth+1 );
|
||||
@@ -315,7 +315,7 @@ void ScreenshotCommand::CaptureMenus(wxMenuBar*pBar, const wxString &fileName)
|
||||
for(i=0;i<cnt;i++)
|
||||
{
|
||||
Label = pBar->GetMenuLabelText( i );
|
||||
wxLogDebug( "\nT.Add( 0, 0, 0, new wxString(\"%s<>\") );", Label);
|
||||
wxLogDebug( "\nT.Add( 0, 0, 0, \"%s<>\" );", Label);
|
||||
ExploreMenu( pBar->GetMenu( i ), pBar->GetId(), 1 );
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user