Changeset View
Changeset View
Standalone View
Standalone View
krita/ui/kis_action.cpp
Show All 13 Lines | |||||
14 | * You should have received a copy of the GNU General Public License | 14 | * You should have received a copy of the GNU General Public License | ||
15 | * along with this program; if not, write to the Free Software | 15 | * along with this program; if not, write to the Free Software | ||
16 | * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. | 16 | * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. | ||
17 | */ | 17 | */ | ||
18 | 18 | | |||
19 | 19 | | |||
20 | #include "kis_action.h" | 20 | #include "kis_action.h" | ||
21 | #include "kis_action_manager.h" | 21 | #include "kis_action_manager.h" | ||
22 | #include "kis_action_registry.h" | ||||
22 | #include <QEvent> | 23 | #include <QEvent> | ||
23 | 24 | | |||
24 | class Q_DECL_HIDDEN KisAction::Private { | 25 | class Q_DECL_HIDDEN KisAction::Private { | ||
25 | 26 | | |||
26 | public: | 27 | public: | ||
27 | Private() : flags(NONE), conditions(NO_CONDITION), actionManager(0) {} | 28 | Private() : flags(NONE), conditions(NO_CONDITION), actionManager(0) {} | ||
28 | 29 | | |||
29 | ActivationFlags flags; | 30 | ActivationFlags flags; | ||
Show All 27 Lines | 55 | { | |||
57 | connect(this, SIGNAL(changed()), SLOT(slotChanged())); | 58 | connect(this, SIGNAL(changed()), SLOT(slotChanged())); | ||
58 | } | 59 | } | ||
59 | 60 | | |||
60 | KisAction::~KisAction() | 61 | KisAction::~KisAction() | ||
61 | { | 62 | { | ||
62 | delete d; | 63 | delete d; | ||
63 | } | 64 | } | ||
64 | 65 | | |||
66 | KisAction *makeKisAction(QString name, QObject *parent) | ||||
67 | { | ||||
68 | KisAction* a = new KisAction(parent); | ||||
69 | KisActionRegistry::instance()->propertizeAction(name, a); | ||||
70 | KisActionRegistry::instance()->addAction(name, a); | ||||
71 | | ||||
72 | // TODO: Add other static data (activationFlags, etc.) using getActionXml() | ||||
73 | | ||||
74 | return a; | ||||
75 | } | ||||
76 | | ||||
65 | 77 | | |||
66 | // Using a dynamic QObject property is done for compatibility with KAction and | 78 | // Using a dynamic QObject property is done for compatibility with KAction and | ||
67 | // XmlGui. We may merge KisAction into the XmlGui code to make this unnecessary, | 79 | // XmlGui. We may merge KisAction into the XmlGui code to make this unnecessary, | ||
68 | // but that is probably a lot of work for little benefit. We currently store a | 80 | // but that is probably a lot of work for little benefit. We currently store a | ||
69 | // single default shortcut, but the old system used a list (to store default | 81 | // single default shortcut, but the old system used a list (to store default | ||
70 | // primary/alternate shortcuts for local and global settings) so we marshal it | 82 | // primary/alternate shortcuts for local and global settings) so we marshal it | ||
71 | // for compatibility. | 83 | // for compatibility. | ||
72 | void KisAction::setDefaultShortcut(const QKeySequence &shortcut) | 84 | void KisAction::setDefaultShortcut(const QKeySequence &shortcut) | ||
▲ Show 20 Lines • Show All 73 Lines • Show Last 20 Lines |