Krita Source Code Documentation
Loading...
Searching...
No Matches
KisShortcutsDialog.h
Go to the documentation of this file.
1/* This file is part of the KDE libraries
2 SPDX-FileCopyrightText: 1997 Nicolas Hadacek <hadacek@kde.org>
3 SPDX-FileCopyrightText: 2001 Ellis Whitehead <ellis@kde.org>
4 SPDX-FileCopyrightText: 2006 Hamish Rodda <rodda@kde.org>
5 SPDX-FileCopyrightText: 2007 Roberto Raggi <roberto@kdevelop.org>
6 SPDX-FileCopyrightText: 2007 Andreas Hartmetz <ahartmetz@gmail.com>
7 SPDX-FileCopyrightText: 2008 Michael Jansen <kde@michael-jansen.biz>
8 SPDX-FileCopyrightText: 2015 Michael Abrahams <miabraha@gmail.com>
9
10 SPDX-License-Identifier: LGPL-2.0-or-later
11*/
12
13#ifndef KISSHORTCUTSDIALOG_H
14#define KISSHORTCUTSDIALOG_H
15
16
17#include <KisShortcutsEditor.h>
18
19// Altering this class and some classes it uses was one major impetus behind
20// forking XmlGui. The first major workaround was to allow
21// KisPart::configureShortcuts() to pull up the dialog, and to remote the scheme
22// editor support, since it's incompatible with Krita.
23//
24// The files were forked from KF5 XmlGui version 5.12.0
25// dialogs/KisShortcutsEditorItem.cpp <- kshortcutseditoritem.cpp
26// dialogs/KisShortcutEditWidget.cpp <- kshortcuteditwidget.cpp
27// dialogs/KisShortcutsEditorDelegate.cpp <- kshortcutseditordelegate.cpp
28// dialogs/KisShortcutsDialog.cpp <- kshortcutsdialog.cpp, , kshortcutsdialog_p.cpp
29// dialogs/KisShortcutsDialog.h <- kshortcutsdialog.h
30// dialogs/KisShortcutsDialog_p.h <- kshortcutsdialog_p.h, kshortcutseditor_p.h
31// forms/KisShortcutsDialog.ui <- kshortcutsdialog.ui
32//
33//
34// Changes that have been done to the files:
35// * Adapt of includes
36// * Removing unwanted parts related to schemes
37// * Renamed KShortcutsDialog/Editor to KisShortcutsDialog/Editor
38// * Add export macro
39// * Split apart kshortcutseditor_p
40// * Copied KShortcutsEditorPrivate::itemFromIndex() implementation from
41// KF5 XmlGui's kshortcutseditor.cpp to begin of KisShortcutsEditorItem.cpp
42
85
86class KRITAWIDGETUTILS_EXPORT KisShortcutsDialog : public QWidget
87{
88 Q_OBJECT
89
90public:
103 explicit KisShortcutsDialog(KisShortcutsEditor::ActionTypes types = defaultActionTypes,
104 KisShortcutsEditor::LetterShortcuts allowLetterShortcuts \
106 QWidget *parent = 0);
107
108 ~KisShortcutsDialog() override;
109
117 void addCollection(KisKActionCollection *, const QString &title = QString());
118
122 QList<KisKActionCollection *> actionCollections() const;
123
125 QSize sizeHint() const override;
126
127
131 void save();
132 void allDefault();
133 void undo();
134
138 void importConfiguration(const QString &path);
139
143 void exportConfiguration(const QString &path) const;
144
148 void loadCustomShortcuts(const QString &path);
149
153 void saveCustomShortcuts(const QString &path) const;
154
155private:
156 Q_PRIVATE_SLOT(d, void changeShortcutScheme(const QString &))
157 Q_PRIVATE_SLOT(d, void undo())
158
161
162 Q_DISABLE_COPY(KisShortcutsDialog)
163};
164
165#endif // KISSHORTCUTSDIALOG_H
166
const auto defaultActionTypes
Dialog for configuration of KisKActionCollection and KGlobalAccel.
A container for a set of QAction objects.
class KisShortcutsDialogPrivate *const d
@ WidgetAction
Actions which are triggered by any keypress in a widget which has the action added to it.
@ ApplicationAction
Actions which are triggered by any keypress in the application.
@ WindowAction
Actions which are triggered by any keypress in a window which has the action added to it or its child...
@ LetterShortcutsAllowed
Letter shortcuts are allowed.