Changeset View
Changeset View
Standalone View
Standalone View
krita/plugins/extensions/imagesize/imagesize.cc
Show All 35 Lines | |||||
36 | #include <kis_selection_mask.h> | 36 | #include <kis_selection_mask.h> | ||
37 | #include <kis_selection.h> | 37 | #include <kis_selection.h> | ||
38 | 38 | | |||
39 | #include "dlg_imagesize.h" | 39 | #include "dlg_imagesize.h" | ||
40 | #include "dlg_canvassize.h" | 40 | #include "dlg_canvassize.h" | ||
41 | #include "dlg_layersize.h" | 41 | #include "dlg_layersize.h" | ||
42 | #include "kis_filter_strategy.h" | 42 | #include "kis_filter_strategy.h" | ||
43 | #include "kis_action.h" | 43 | #include "kis_action.h" | ||
44 | #include "kis_action_manager.h" | ||||
44 | 45 | | |||
45 | K_PLUGIN_FACTORY_WITH_JSON(ImageSizeFactory, "kritaimagesize.json", registerPlugin<ImageSize>();) | 46 | K_PLUGIN_FACTORY_WITH_JSON(ImageSizeFactory, "kritaimagesize.json", registerPlugin<ImageSize>();) | ||
46 | 47 | | |||
47 | ImageSize::ImageSize(QObject *parent, const QVariantList &) | 48 | ImageSize::ImageSize(QObject *parent, const QVariantList &) | ||
48 | : KisViewPlugin(parent) | 49 | : KisViewPlugin(parent) | ||
49 | { | 50 | { | ||
50 | KisAction *action = new KisAction(i18n("Scale Image To New Size..."), this); | 51 | KisAction *action = createAction("imagesize"); | ||
51 | action->setActivationFlags(KisAction::ACTIVE_NODE); | 52 | action->setActivationFlags(KisAction::ACTIVE_NODE); | ||
52 | addAction("imagesize", action); | | |||
53 | action->setDefaultShortcut(QKeySequence(Qt::CTRL + Qt::ALT + Qt::Key_I)); | | |||
54 | connect(action, SIGNAL(triggered()), this, SLOT(slotImageSize())); | 53 | connect(action, SIGNAL(triggered()), this, SLOT(slotImageSize())); | ||
55 | 54 | | |||
56 | action = new KisAction(i18n("Resize Canvas..."), this); | 55 | action = createAction("canvassize"); | ||
57 | action->setActivationFlags(KisAction::ACTIVE_NODE); | 56 | action->setActivationFlags(KisAction::ACTIVE_NODE); | ||
58 | addAction("canvassize", action); | | |||
59 | action->setDefaultShortcut(QKeySequence(Qt::CTRL + Qt::ALT + Qt::Key_C)); | | |||
60 | connect(action, SIGNAL(triggered()), this, SLOT(slotCanvasSize())); | 57 | connect(action, SIGNAL(triggered()), this, SLOT(slotCanvasSize())); | ||
61 | 58 | | |||
62 | action = new KisAction(i18n("Scale &Layer to new Size..."), this); | 59 | action = createAction("layersize"); | ||
63 | action->setActivationFlags(KisAction::ACTIVE_LAYER); | 60 | action->setActivationFlags(KisAction::ACTIVE_LAYER); | ||
64 | action->setActivationConditions(KisAction::ACTIVE_NODE_EDITABLE); | 61 | action->setActivationConditions(KisAction::ACTIVE_NODE_EDITABLE); | ||
65 | addAction("layersize", action); | | |||
66 | connect(action, SIGNAL(triggered()), this, SLOT(slotLayerSize())); | 62 | connect(action, SIGNAL(triggered()), this, SLOT(slotLayerSize())); | ||
67 | 63 | | |||
68 | action = new KisAction(i18n("&Scale..."), this); | 64 | action = createAction("selectionscale"); | ||
69 | action->setActivationFlags(KisAction::PIXELS_SELECTED); | 65 | action->setActivationFlags(KisAction::PIXELS_SELECTED); | ||
70 | action->setActivationConditions(KisAction::SELECTION_EDITABLE); | 66 | action->setActivationConditions(KisAction::SELECTION_EDITABLE); | ||
71 | addAction("selectionscale", action); | | |||
72 | Q_CHECK_PTR(action); | 67 | Q_CHECK_PTR(action); | ||
73 | connect(action, SIGNAL(triggered()), this, SLOT(slotSelectionScale())); | 68 | connect(action, SIGNAL(triggered()), this, SLOT(slotSelectionScale())); | ||
74 | } | 69 | } | ||
75 | 70 | | |||
76 | ImageSize::~ImageSize() | 71 | ImageSize::~ImageSize() | ||
77 | { | 72 | { | ||
78 | } | 73 | } | ||
79 | 74 | | |||
▲ Show 20 Lines • Show All 97 Lines • Show Last 20 Lines |