|
Krita Source Code Documentation
|
Widget for configuration of KAccel and KGlobalAccel. More...
#include <KisShortcutsEditor.h>
Inheritance diagram for KisShortcutsEditor:Public Types | |
| enum | ActionType { WidgetAction = Qt::WidgetShortcut , WindowAction = Qt::WindowShortcut , ApplicationAction = Qt::ApplicationShortcut , GlobalAction = 4 , AllActions = 0xffffffff } |
| enum | LetterShortcuts { LetterShortcutsDisallowed = 0 , LetterShortcutsAllowed } |
Public Slots | |
| void | allDefault () |
| void | printShortcuts () const |
| void | resizeColumns () |
| void | searchUpdated (QString s) |
| void | slotScrollerStateChanged (QScroller::State state) |
Signals | |
| void | keyChange () |
Public Member Functions | |
| ActionTypes | actionTypes () const |
| void | addCollection (KisKActionCollection *, const QString &title=QString()) |
| void | clearCollections () |
| void | clearConfiguration () |
| void | clearSearch () |
| void | commit () |
| void | exportConfiguration (KConfigBase *config) const |
| void | importConfiguration (KConfigBase *config, bool isScheme) |
| bool | isModified () const |
| KisShortcutsEditor (QWidget *parent, ActionTypes actionTypes=AllActions, LetterShortcuts allowLetterShortcuts=LetterShortcutsAllowed) | |
| void | save () |
| void | saveShortcuts (KConfigGroup *config=0) const |
| void | setActionTypes (ActionTypes actionTypes) |
| void | undo () |
| ~KisShortcutsEditor () override | |
| Destructor. | |
Properties | |
| ActionTypes | actionTypes |
Private Attributes | |
| KisShortcutsEditorPrivate *const | d |
Friends | |
| class | KisShortcutsDialog |
| class | KisShortcutsEditorPrivate |
Widget for configuration of KAccel and KGlobalAccel.
WARNING: KisShortcutsEditor expects that the list of existing shortcuts is already free of conflicts. If it is not, nothing will crash, but your users won't like the resulting behavior.
TODO: Find the right place to check for conflicts.
Configure dictionaries of key/action associations for KActions, including global shortcuts.
The class takes care of all aspects of configuration, including handling key conflicts internally. Connect to the allDefault() slot if you want to set all configurable shortcuts to their default values.
Definition at line 55 of file KisShortcutsEditor.h.
Definition at line 69 of file KisShortcutsEditor.h.
Definition at line 83 of file KisShortcutsEditor.h.
|
explicit |
This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.
Creates a key chooser without a starting action collection.
| parent | parent widget |
| actionTypes | types of actions to display in this widget. |
| allowLetterShortcuts | set to LetterShortcutsDisallowed if unmodified alphanumeric keys ('A', '1', etc.) are not permissible shortcuts. |
Definition at line 48 of file KisShortcutsEditor.cpp.
|
override |
| KisShortcutsEditor::ActionTypes KisShortcutsEditor::actionTypes | ( | ) | const |
Definition at line 297 of file KisShortcutsEditor.cpp.
References KisShortcutsEditorPrivate::actionTypes, and d.
| void KisShortcutsEditor::addCollection | ( | KisKActionCollection * | collection, |
| const QString & | title = QString() ) |
Note: the reason this is so damn complicated is because it's supposed to support having multiple applications running inside of each other through KisParts. That means we have to be able to separate sections within each configuration file.
Insert an action collection, i.e. add all its actions to the ones already associated with the KisShortcutsEditor object.
| collection | the action collection. |
| title | subtree title of this collection of shortcut. |
Forward this action collection to the delegate which will do conflict checking. This replaces existing collections in the delegate.
Definition at line 88 of file KisShortcutsEditor.cpp.
References KisShortcutsEditorPrivate::Action, KisShortcutsEditorPrivate::actionCollections, KisKActionCategory::actions(), KisKActionCollection::actions(), KisShortcutsEditorPrivate::addAction(), KisKActionCollection::categories(), KisKActionCollection::componentDisplayName(), d, KisShortcutsEditorPrivate::delegate, KisShortcutsEditorPrivate::findOrMakeItem(), KisKActionCollection::isEmpty(), Name, KisShortcutsEditorPrivate::Program, resizeColumns(), KisShortcutsEditorPrivate::Root, KisShortcutsEditorDelegate::setCheckActionCollections(), KisKActionCategory::text, and KisShortcutsEditorPrivate::ui.
|
slot |
Set all shortcuts to their default values (bindings).
Definition at line 276 of file KisShortcutsEditor.cpp.
References KisShortcutsEditorPrivate::allDefault(), and d.
| void KisShortcutsEditor::clearCollections | ( | ) |
Removes all action collections from the editor
Definition at line 74 of file KisShortcutsEditor.cpp.
References KisShortcutsEditorPrivate::actionCollections, d, KisShortcutsEditorPrivate::delegate, resizeColumns(), and KisShortcutsEditorPrivate::ui.
| void KisShortcutsEditor::clearConfiguration | ( | ) |
Removes all configured shortcuts.
Definition at line 169 of file KisShortcutsEditor.cpp.
References KisShortcutsEditorPrivate::clearConfiguration(), and d.
| void KisShortcutsEditor::clearSearch | ( | ) |
Clears search area
Definition at line 82 of file KisShortcutsEditor.cpp.
References d, and KisShortcutsEditorPrivate::ui.
| void KisShortcutsEditor::commit | ( | ) |
Update the dialog entries without saving.
Definition at line 251 of file KisShortcutsEditor.cpp.
References d, and KisShortcutsEditorPrivate::ui.
| void KisShortcutsEditor::exportConfiguration | ( | KConfigBase * | config | ) | const |
Write the current shortcuts to a new scheme to configuration file
| config | Config object to save to. |
Definition at line 204 of file KisShortcutsEditor.cpp.
References KisShortcutsEditorPrivate::actionCollections, KisShortcutsEditorPrivate::actionTypes, d, KisActionRegistry::instance(), KisActionRegistry::notifySettingsUpdated(), and KisKActionCollection::writeSettings().
| void KisShortcutsEditor::importConfiguration | ( | KConfigBase * | config, |
| bool | isScheme ) |
Import a shortcut configuration file.
| config | Config object to load from. |
| isScheme | true for shortcut scheme, false for custom shortcuts |
Definition at line 174 of file KisShortcutsEditor.cpp.
References alternateSequence(), KisActionRegistry::applyShortcutScheme(), KisShortcutsEditorPrivate::changeKeyShortcut(), d, KisShortcutsEditorItem::data(), Id, KisActionRegistry::instance(), LocalAlternate, LocalPrimary, primarySequence(), and KisShortcutsEditorPrivate::ui.
| bool KisShortcutsEditor::isModified | ( | ) | const |
true if there are unsaved changes. Definition at line 60 of file KisShortcutsEditor.cpp.
References d, KisShortcutsEditorItem::isModified(), and KisShortcutsEditorPrivate::ui.
|
signal |
Emitted when an action's shortcut has been changed.
|
slot |
Opens a printing dialog to print all the shortcuts
Definition at line 281 of file KisShortcutsEditor.cpp.
References d, and KisShortcutsEditorPrivate::printShortcuts().
|
slot |
Resize columns to width required
Definition at line 241 of file KisShortcutsEditor.cpp.
References d, and KisShortcutsEditorPrivate::ui.
| void KisShortcutsEditor::save | ( | ) |
Save the changes.
Before saving the changes are committed. This saves the actions to disk. Any KisKActionCollection objects with the xmlFile() value set will be written to an XML file. All other will be written to the application's rc file.
Definition at line 260 of file KisShortcutsEditor.cpp.
References commit(), and saveShortcuts().
| void KisShortcutsEditor::saveShortcuts | ( | KConfigGroup * | config = 0 | ) | const |
Write the current custom shortcut settings to the config object.
| config | Config object to save to. Default is kritashortcutsrc. |
Definition at line 221 of file KisShortcutsEditor.cpp.
References KisShortcutsEditorPrivate::actionCollections, d, KisActionRegistry::instance(), KisActionRegistry::notifySettingsUpdated(), and KisKActionCollection::writeSettings().
|
slot |
Expand or collapse the tree view when the search text changes
Definition at line 286 of file KisShortcutsEditor.cpp.
References d, and KisShortcutsEditorPrivate::ui.
| void KisShortcutsEditor::setActionTypes | ( | ActionTypes | actionTypes | ) |
Sets the types of actions to display in this widget.
| actionTypes | New types of actions |
Definition at line 302 of file KisShortcutsEditor.cpp.
References actionTypes, d, and KisShortcutsEditorPrivate::setActionTypes().
|
inlineslot |
Definition at line 230 of file KisShortcutsEditor.h.
References KisKineticScroller::updateCursor().
| void KisShortcutsEditor::undo | ( | ) |
Undo all change made since the last commit().
Definition at line 266 of file KisShortcutsEditor.cpp.
References d, and KisShortcutsEditorPrivate::ui.
|
friend |
Definition at line 236 of file KisShortcutsEditor.h.
|
friend |
Definition at line 237 of file KisShortcutsEditor.h.
|
private |
Definition at line 238 of file KisShortcutsEditor.h.
|
readwrite |
Definition at line 58 of file KisShortcutsEditor.h.