|
Krita Source Code Documentation
|
#include <kis_action_registry.h>
Inheritance diagram for KisActionRegistry:Classes | |
| struct | ActionCategory |
Signals | |
| void | shortcutsUpdated () |
Public Member Functions | |
| ActionInfoItem & | actionInfo (const QString &name) |
| void | applyShortcutScheme (const KConfigBase *config=0) |
| ActionCategory | fetchActionCategory (const QString &name) const |
| QString | getActionProperty (const QString &name, const QString &property) |
| bool | hasAction (const QString &name) const |
| KisActionRegistry () | |
| void | loadActionFiles () |
| void | loadCustomShortcuts () |
| void | loadCustomShortcuts (QString filename=QStringLiteral("kritashortcutsrc")) |
| void | loadShortcutScheme (const QString &schemeName) |
| loadShortcutScheme | |
| QAction * | makeQAction (const QString &name, QObject *parent=0) |
| void | notifySettingsUpdated () |
| Private (KisActionRegistry *_q) | |
| bool | propertizeAction (const QString &name, QAction *a) |
| QList< QString > | registeredShortcutIds () const |
| bool | sanityCheckPropertized (const QString &name) |
| void | settingsPageSaved () |
| void | updateShortcut (const QString &name, QAction *ac) |
| ~KisActionRegistry () | |
Static Public Member Functions | |
| static KisActionRegistry * | instance () |
Public Attributes | |
| QMap< QString, ActionInfoItem > | actionInfoList |
| KisActionRegistry * | q |
| QSet< QString > | sanityPropertizedShortcuts |
Private Attributes | |
| const QScopedPointer< Private > | d |
Private Attributes inherited from Private | |
| KisCanvas2 * | canvas |
| int | displayedFrame |
| int | intendedFrame |
Additional Inherited Members | |
Private Member Functions inherited from Private | |
| Private (KisCanvas2 *c) | |
KisActionRegistry is intended to manage the global action configuration data for Krita. The data come from four sources:
This class can be used as a factory by calling makeQAction. It can be used to add standard properties such as default shortcuts and default tooltip to an existing action with propertizeAction. If you have a custom action class which needs to add other properties, you can use propertizeAction to add any sort of data you wish to the .action configuration file.
This class is also in charge of displaying the shortcut configuration dialog. The interplay between this class, KisKActionCollection, KisShortcutsEditor and so on can be complex, and is sometimes synchronized by file I/O by reading and writing the configuration files mentioned above.
It is a global static. Grab an instance().
Definition at line 146 of file kis_action_registry.cpp.
| KisActionRegistry::KisActionRegistry | ( | ) |
Constructor. Please don't touch!
Definition at line 186 of file kis_action_registry.cpp.
References loadCustomShortcuts(), loadShortcutScheme(), and KisKShortcutSchemesHelper::schemeFileLocations().
| KisActionRegistry::~KisActionRegistry | ( | ) |
Definition at line 199 of file kis_action_registry.cpp.
|
inline |
Definition at line 158 of file kis_action_registry.cpp.
References dbgAction.
| void KisActionRegistry::applyShortcutScheme | ( | const KConfigBase * | config = 0 | ) |
Definition at line 261 of file kis_action_registry.cpp.
References d, and loadCustomShortcuts().
| KisActionRegistry::ActionCategory KisActionRegistry::fetchActionCategory | ( | const QString & | name | ) | const |
Definition at line 203 of file kis_action_registry.cpp.
References d.
| QString KisActionRegistry::getActionProperty | ( | const QString & | name, |
| const QString & | property ) |
property for an action name.Allow flexible info structure for KisActions, etc.
Definition at line 356 of file kis_action_registry.cpp.
| bool KisActionRegistry::hasAction | ( | const QString & | name | ) | const |
Definition at line 180 of file kis_action_registry.cpp.
References d.
|
static |
Definition at line 172 of file kis_action_registry.cpp.
References dbgRegistry.
| void KisActionRegistry::loadActionFiles | ( | ) |
| void KisActionRegistry::loadCustomShortcuts | ( | ) |
Reload custom shortcuts from kritashortcutsrc
Definition at line 216 of file kis_action_registry.cpp.
References d.
| void KisActionRegistry::loadCustomShortcuts | ( | QString | filename = QStringLiteral("kritashortcutsrc") | ) |
| void KisActionRegistry::loadShortcutScheme | ( | const QString & | schemeName | ) |
loadShortcutScheme
| schemeName |
Definition at line 221 of file kis_action_registry.cpp.
References applyShortcutScheme(), and KisKShortcutSchemesHelper::schemeFileLocations().
| QAction * KisActionRegistry::makeQAction | ( | const QString & | name, |
| QObject * | parent = 0 ) |
Produces a new QAction based on the .action data files.
N.B. this action will not be saved in the registry.
Definition at line 238 of file kis_action_registry.cpp.
References d, and propertizeAction().
| void KisActionRegistry::notifySettingsUpdated | ( | ) |
Call after settings are changed.
Definition at line 211 of file kis_action_registry.cpp.
References d.
|
inline |
Definition at line 150 of file kis_action_registry.cpp.
| bool KisActionRegistry::propertizeAction | ( | const QString & | name, |
| QAction * | a ) |
Fills the standard QAction properties of an action.
Definition at line 312 of file kis_action_registry.cpp.
References d, KisIconUtils::loadIcon(), updateShortcut(), and warnAction.
| QList< QString > KisActionRegistry::registeredShortcutIds | ( | ) | const |
Definition at line 307 of file kis_action_registry.cpp.
References d.
| bool KisActionRegistry::sanityCheckPropertized | ( | const QString & | name | ) |
Definition at line 302 of file kis_action_registry.cpp.
References d.
| void KisActionRegistry::settingsPageSaved | ( | ) |
Called when "OK" button is pressed in settings dialog.
Definition at line 251 of file kis_action_registry.cpp.
References loadCustomShortcuts(), and shortcutsUpdated().
|
signal |
| void KisActionRegistry::updateShortcut | ( | const QString & | name, |
| QAction * | ac ) |
Definition at line 282 of file kis_action_registry.cpp.
References d.
| QMap<QString, ActionInfoItem> KisActionRegistry::actionInfoList |
Definition at line 153 of file kis_action_registry.cpp.
|
private |
Definition at line 136 of file kis_action_registry.h.
| KisActionRegistry* KisActionRegistry::q |
Definition at line 165 of file kis_action_registry.cpp.
| QSet<QString> KisActionRegistry::sanityPropertizedShortcuts |
Definition at line 166 of file kis_action_registry.cpp.