mirror of
https://github.com/cookiengineer/audacity
synced 2025-12-13 08:06:32 +01:00
Reduce number of shortcuts provided by default.
The full list of shortcuts, the maxList, is still available, and can be set in KeyboardPreferences.
This commit is contained in:
@@ -425,6 +425,9 @@ CommandManager::CommandManager():
|
||||
bMakingOccultCommands( false )
|
||||
{
|
||||
mbSeparatorAllowed = false;
|
||||
SetMaxList();
|
||||
|
||||
|
||||
}
|
||||
|
||||
///
|
||||
@@ -436,6 +439,75 @@ CommandManager::~CommandManager()
|
||||
PurgeData();
|
||||
}
|
||||
|
||||
// CommandManager needs to know which defaults are standard and which are in the
|
||||
// full (max) list.
|
||||
void CommandManager::SetMaxList()
|
||||
{
|
||||
|
||||
// This list is a DUPLICATE of the list in
|
||||
// KeyConfigPrefs::OnImportDefaults(wxCommandEvent & event)
|
||||
|
||||
// TODO: At a later date get rid of the maxList entirely and
|
||||
// instead use flags in the menu entrys to indicate whether the default
|
||||
// shortcut is standard or full.
|
||||
|
||||
mMaxListOnly.Clear();
|
||||
// These short cuts are for the max list only....
|
||||
//mMaxListOnly.Add( "Ctrl+I" );
|
||||
mMaxListOnly.Add( "Ctrl+Alt+I" );
|
||||
mMaxListOnly.Add( "Ctrl+J" );
|
||||
mMaxListOnly.Add( "Ctrl+Alt+J" );
|
||||
mMaxListOnly.Add( "Ctrl+Alt+V" );
|
||||
mMaxListOnly.Add( "Alt+X" );
|
||||
mMaxListOnly.Add( "Alt+K" );
|
||||
mMaxListOnly.Add( "Shift+Alt+X" );
|
||||
mMaxListOnly.Add( "Shift+Alt+K" );
|
||||
mMaxListOnly.Add( "Alt+L" );
|
||||
mMaxListOnly.Add( "Shift+Alt+C" );
|
||||
mMaxListOnly.Add( "Alt+I" );
|
||||
mMaxListOnly.Add( "Alt+J" );
|
||||
mMaxListOnly.Add( "Shift+Alt+J" );
|
||||
mMaxListOnly.Add( "Ctrl+Shift+A" );
|
||||
mMaxListOnly.Add( "Q" );
|
||||
mMaxListOnly.Add( "Shift+J" );
|
||||
mMaxListOnly.Add( "Shift+K" );
|
||||
//mMaxListOnly.Add( "Shift+Home" );
|
||||
//mMaxListOnly.Add( "Shift+End" );
|
||||
mMaxListOnly.Add( "Ctrl+[" );
|
||||
mMaxListOnly.Add( "Ctrl+]" );
|
||||
mMaxListOnly.Add( "1" );
|
||||
mMaxListOnly.Add( "Shift+F5" );
|
||||
mMaxListOnly.Add( "Shift+F6" );
|
||||
mMaxListOnly.Add( "Shift+F7" );
|
||||
mMaxListOnly.Add( "Shift+F8" );
|
||||
mMaxListOnly.Add( "Ctrl+Shift+F5" );
|
||||
mMaxListOnly.Add( "Ctrl+Shift+F7" );
|
||||
mMaxListOnly.Add( "Ctrl+Shift+N" );
|
||||
mMaxListOnly.Add( "Ctrl+Shift+M" );
|
||||
mMaxListOnly.Add( "Ctrl+Home" );
|
||||
mMaxListOnly.Add( "Ctrl+End" );
|
||||
mMaxListOnly.Add( "Shift+C" );
|
||||
mMaxListOnly.Add( "Alt+Shift+Up" );
|
||||
mMaxListOnly.Add( "Alt+Shift+Down" );
|
||||
mMaxListOnly.Add( "Shift+P" );
|
||||
mMaxListOnly.Add( "Alt+Shift+Left" );
|
||||
mMaxListOnly.Add( "Alt+Shift+Right" );
|
||||
mMaxListOnly.Add( "Ctrl+Shift+T" );
|
||||
//mMaxListOnly.Add( "Command+M" );
|
||||
//mMaxListOnly.Add( "Option+Command+M" );
|
||||
mMaxListOnly.Add( "Shift+H" );
|
||||
mMaxListOnly.Add( "Shift+O" );
|
||||
mMaxListOnly.Add( "Shift+I" );
|
||||
mMaxListOnly.Add( "Shift+N" );
|
||||
mMaxListOnly.Add( "D" );
|
||||
mMaxListOnly.Add( "A" );
|
||||
mMaxListOnly.Add( "Alt+Shift+F6" );
|
||||
mMaxListOnly.Add( "Alt+F6" );
|
||||
|
||||
mMaxListOnly.Sort();
|
||||
}
|
||||
|
||||
|
||||
void CommandManager::PurgeData()
|
||||
{
|
||||
// mCommandList contains pointers to CommandListEntrys
|
||||
@@ -908,6 +980,14 @@ CommandListEntry *CommandManager::NewIdentifier(const wxString & name,
|
||||
entry->isGlobal = false;
|
||||
entry->isOccult = bMakingOccultCommands;
|
||||
|
||||
// Exclude accelerators that are in the MaxList.
|
||||
// Note that the default is unaffected, intentionally so.
|
||||
// There are effectively two levels of default, the full (max) list
|
||||
// and the normal reduced list.
|
||||
if( mMaxListOnly.Index( entry->key ) !=-1)
|
||||
entry->key = wxT("");
|
||||
|
||||
|
||||
// For key bindings for commands with a list, such as effects,
|
||||
// the name in prefs is the category name plus the effect name.
|
||||
if (multi) {
|
||||
|
||||
@@ -105,6 +105,7 @@ class AUDACITY_DLL_API CommandManager final : public XMLTagHandler
|
||||
CommandManager(const CommandManager&) PROHIBITED;
|
||||
CommandManager &operator= (const CommandManager&) PROHIBITED;
|
||||
|
||||
void SetMaxList();
|
||||
void PurgeData();
|
||||
|
||||
//
|
||||
@@ -316,6 +317,9 @@ protected:
|
||||
XMLTagHandler *HandleXMLChild(const wxChar *tag) override;
|
||||
|
||||
private:
|
||||
// mMaxList only holds shortcuts that should not be added (by default).
|
||||
wxSortedArrayString mMaxListOnly;
|
||||
|
||||
MenuBarList mMenuBarList;
|
||||
SubMenuList mSubMenuList;
|
||||
CommandList mCommandList;
|
||||
|
||||
Reference in New Issue
Block a user