KiCad PCB EDA Suite
|
A class that contains a set of hotkeys, arranged into "sections" and provides some book-keeping functions for them. More...
#include <hotkey_store.h>
Public Member Functions | |
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. | |
void | SaveAllHotkeys () |
Persist all changes to hotkeys in the store to the underlying data structures. | |
void | ResetAllHotkeysToDefault () |
Reset every hotkey in the store to the default values. | |
void | ResetAllHotkeysToOriginal () |
Resets every hotkey to the original values. | |
bool | CheckKeyConflicts (TOOL_ACTION *aAction, long aKey, HOTKEY **aConflict) |
Check whether the given key conflicts with anything in this store. | |
Static Public Member Functions | |
static wxString | GetAppName (TOOL_ACTION *aAction) |
static wxString | GetSectionName (TOOL_ACTION *aAction) |
Private Attributes | |
std::vector< TOOL_MANAGER * > | m_toolManagers |
std::vector< HOTKEY_SECTION > | m_hk_sections |
A class that contains a set of hotkeys, arranged into "sections" and provides some book-keeping functions for them.
Definition at line 65 of file hotkey_store.h.
HOTKEY_STORE::HOTKEY_STORE | ( | ) |
Construct a HOTKEY_STORE from a list of hotkey sections.
aHotkeys | the hotkey configs that will be managed by this store. |
Definition at line 93 of file hotkey_store.cpp.
bool HOTKEY_STORE::CheckKeyConflicts | ( | TOOL_ACTION * | aAction, |
long | aKey, | ||
HOTKEY ** | aConflict | ||
) |
Check whether the given key conflicts with anything in this store.
aAction | - the action the key is proposed to be assigned to. Only conflicts within the same section will be flagged. |
aKey | - key to check |
aConflict | - outparam getting the section this one conflicts with |
Definition at line 212 of file hotkey_store.cpp.
References AS_CONTEXT, AS_GLOBAL, TOOL_ACTION::GetScope(), GetSectionName(), TOOL_ACTION::GetToolName(), HOTKEY::m_Actions, HOTKEY::m_EditKeycode, HOTKEY::m_EditKeycodeAlt, and m_hk_sections.
Referenced by WIDGET_HOTKEY_LIST::resolveKeyConflicts().
|
static |
Definition at line 65 of file hotkey_store.cpp.
References TOOL_ACTION::GetName(), and name.
Referenced by GetSectionName(), and Init().
|
static |
Definition at line 72 of file hotkey_store.cpp.
References _, and GetAppName().
Referenced by CheckKeyConflicts(), Init(), and WIDGET_HOTKEY_LIST::resolveKeyConflicts().
std::vector< HOTKEY_SECTION > & HOTKEY_STORE::GetSections | ( | ) |
Get the list of sections managed by this store.
Definition at line 167 of file hotkey_store.cpp.
References m_hk_sections.
Referenced by PANEL_HOTKEYS_EDITOR::dumpHotkeys(), PANEL_HOTKEYS_EDITOR::ImportHotKeys(), and WIDGET_HOTKEY_LIST::updateShownItems().
void HOTKEY_STORE::Init | ( | std::vector< TOOL_ACTION * > | aActionsList, |
bool | aIncludeReadOnlyCmds | ||
) |
Definition at line 98 of file hotkey_store.cpp.
References _, g_gesturePseudoActions, g_standardPlatformCommands, GetAppName(), ADVANCED_CFG::GetCfg(), GetSectionName(), HOTKEY::m_Actions, HOTKEY::m_EditKeycode, HOTKEY::m_EditKeycodeAlt, m_hk_sections, HOTKEY_SECTION::m_HotKeys, and HOTKEY_SECTION::m_SectionName.
Referenced by PANEL_HOTKEYS_EDITOR::TransferDataToWindow().
void HOTKEY_STORE::ResetAllHotkeysToDefault | ( | ) |
Reset every hotkey in the store to the default values.
Definition at line 186 of file hotkey_store.cpp.
References HOTKEY::m_Actions, HOTKEY::m_EditKeycode, HOTKEY::m_EditKeycodeAlt, and m_hk_sections.
Referenced by WIDGET_HOTKEY_LIST::ResetAllHotkeys().
void HOTKEY_STORE::ResetAllHotkeysToOriginal | ( | ) |
Resets every hotkey to the original values.
Definition at line 199 of file hotkey_store.cpp.
References HOTKEY::m_Actions, HOTKEY::m_EditKeycode, HOTKEY::m_EditKeycodeAlt, and m_hk_sections.
Referenced by WIDGET_HOTKEY_LIST::ResetAllHotkeys().
void HOTKEY_STORE::SaveAllHotkeys | ( | ) |
Persist all changes to hotkeys in the store to the underlying data structures.
Definition at line 173 of file hotkey_store.cpp.
References HOTKEY::m_Actions, HOTKEY::m_EditKeycode, HOTKEY::m_EditKeycodeAlt, m_hk_sections, and TOOL_ACTION::SetHotKey().
Referenced by WIDGET_HOTKEY_LIST::TransferDataFromControl().
|
private |
Definition at line 114 of file hotkey_store.h.
Referenced by CheckKeyConflicts(), GetSections(), Init(), ResetAllHotkeysToDefault(), ResetAllHotkeysToOriginal(), and SaveAllHotkeys().
|
private |
Definition at line 113 of file hotkey_store.h.