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" ) }
81 if( s_AppNames.count( appName ) )
82 return s_AppNames[ appName ];
93 void HOTKEY_STORE::Init( std::vector<TOOL_MANAGER*> aToolManagerList,
bool aIncludeReadOnlyCmds )
99 std::map<std::string, HOTKEY> masterMap;
103 for(
const std::pair<const std::string, TOOL_ACTION*>& entry : toolMgr->GetActions() )
106 if( entry.second->GetLabel().IsEmpty() )
111 if( entry.second->GetName() ==
"pcbnew.Control.zoneDisplayOutlines" 112 || entry.second->GetName() ==
"pcbnew.Control.zoneDisplayTesselation" )
118 HOTKEY& hotkey = masterMap[ entry.first ];
119 hotkey.
m_Actions.push_back( entry.second );
130 for(
const std::pair<const std::string, HOTKEY>& entry : masterMap )
132 TOOL_ACTION* entryAction = entry.second.m_Actions[ 0 ];
133 wxString entryApp =
GetAppName( entryAction );
135 if( !currentSection || entryApp != currentApp )
138 currentApp = entryApp;
142 if( aIncludeReadOnlyCmds && currentApp ==
"common" )
152 if( aIncludeReadOnlyCmds )
174 for(
HOTKEY& hotkey : section.m_HotKeys )
187 for(
HOTKEY& hotkey : section.m_HotKeys )
197 for(
HOTKEY& hotkey : section.m_HotKeys )
218 if( !( section.m_SectionName == sectionName || section.m_SectionName == commonName ) )
221 for(
HOTKEY& hotkey : section.m_HotKeys )
237 *aConflict = &hotkey;
void SaveAllHotkeys()
Persist all changes to hotkeys in the store to the underlying data structures.
std::vector< HOTKEY > m_HotKeys
HOTKEY_STORE()
Construct a HOTKEY_STORE from a list of hotkey sections.
bool m_ExtraZoneDisplayModes
When true, adds zone-diaplay-modes for stroking the zone fracture boundaries and the zone triangulati...
std::vector< TOOL_MANAGER * > m_toolManagers
static PSEUDO_ACTION * g_gesturePseudoActions[]
static wxString GetAppName(TOOL_ACTION *aAction)
void ResetAllHotkeysToDefault()
Reset every hotkey in the store to the default values.
Base window classes and related definitions.
bool CheckKeyConflicts(TOOL_ACTION *aAction, long aKey, HOTKEY **aConflict)
Check whether the given key conflicts with anything in this store.
std::vector< TOOL_ACTION * > m_Actions
static PSEUDO_ACTION * g_standardPlatformCommands[]
std::vector< HOTKEY_SECTION > & GetSections()
Get the list of sections managed by this store.
std::vector< HOTKEY_SECTION > m_hk_sections
void ResetAllHotkeysToOriginal()
Resets every hotkey to the original values.
static const ADVANCED_CFG & GetCfg()
Get the singleton instance's config, which is shared by all consumers.
void Init(std::vector< TOOL_MANAGER * > aToolManagerList, bool aIncludeReadOnlyCmds)
#define PSEUDO_WXK_DBLCLICK
PSEUDO_ACTION(const wxString &aLabel, int aHotKey)
static wxString GetSectionName(TOOL_ACTION *aAction)