64 return name.BeforeFirst(
'.' );
70 std::map<wxString, wxString> s_AppNames = {
71 { wxT(
"common" ),
_(
"Common" ) },
72 { wxT(
"kicad" ),
_(
"Project Manager" ) },
73 { wxT(
"eeschema" ),
_(
"Schematic Editor" ) },
74 { wxT(
"pcbnew" ),
_(
"PCB Editor" ) },
75 { wxT(
"plEditor" ),
_(
"Drawing Sheet Editor" ), },
76 { wxT(
"3DViewer" ),
_(
"3D Viewer" ) },
77 { wxT(
"gerbview" ),
_(
"Gerber Viewer" ) }
82 if( s_AppNames.count( appName ) )
83 return s_AppNames[ appName ];
96 std::map<std::string, HOTKEY> masterMap;
101 if( action->GetLabel().IsEmpty() )
106 if( action->GetName() ==
"pcbnew.Control.zoneDisplayOutlines"
107 || action->GetName() ==
"pcbnew.Control.zoneDisplayTesselation" )
113 HOTKEY& hotkey = masterMap[ action->GetName() ];
129 for(
const std::pair<const std::string, HOTKEY>& entry : masterMap )
131 TOOL_ACTION* entryAction = entry.second.m_Actions[ 0 ];
132 wxString entryApp =
GetAppName( entryAction );
134 if( !currentSection || entryApp != currentApp )
137 currentApp = entryApp;
141 if( aIncludeReadOnlyCmds && currentApp ==
"common" )
151 if( aIncludeReadOnlyCmds )
173 for(
HOTKEY& hotkey : section.m_HotKeys )
186 for(
HOTKEY& hotkey : section.m_HotKeys )
199 for(
HOTKEY& hotkey : section.m_HotKeys )
223 if( !( section.m_SectionName == sectionName || section.m_SectionName == commonName ) )
226 for(
HOTKEY& hotkey : section.m_HotKeys )
242 *aConflict = &hotkey;
static const ADVANCED_CFG & GetCfg()
Get the singleton instance's config, which is shared by all consumers.
bool CheckKeyConflicts(TOOL_ACTION *aAction, long aKey, HOTKEY **aConflict)
Check whether the given key conflicts with anything in this store.
void ResetAllHotkeysToOriginal()
Resets every hotkey to the original values.
void ResetAllHotkeysToDefault()
Reset every hotkey in the store to the default values.
HOTKEY_STORE()
Construct a HOTKEY_STORE from a list of hotkey sections.
void Init(std::vector< TOOL_ACTION * > aActionsList, bool aIncludeReadOnlyCmds)
std::vector< HOTKEY_SECTION > & GetSections()
Get the list of sections managed by this store.
std::vector< HOTKEY_SECTION > m_hk_sections
void SaveAllHotkeys()
Persist all changes to hotkeys in the store to the underlying data structures.
static wxString GetSectionName(TOOL_ACTION *aAction)
static wxString GetAppName(TOOL_ACTION *aAction)
PSEUDO_ACTION(const wxString &aLabel, int aHotKey)
Base window classes and related definitions.
static PSEUDO_ACTION * g_gesturePseudoActions[]
static PSEUDO_ACTION * g_standardPlatformCommands[]
#define PSEUDO_WXK_DBLCLICK
std::vector< HOTKEY > m_HotKeys
std::vector< TOOL_ACTION * > m_Actions