Commit 700dd821 authored by Boudewijn Rempt's avatar Boudewijn Rempt

Port krita to QAction and QKeySequence

parent a859c7d3
......@@ -139,8 +139,8 @@ public:
ViewModeSynchronisationObject* syncObject;
QTimer* centerer;
KAction* toDesktop;
KAction* toSketch;
QAction * toDesktop;
QAction * toSketch;
QToolButton* switcher;
void initSketchView(QObject* parent)
......@@ -186,7 +186,7 @@ public:
}
}
toDesktop = new KAction(q);
toDesktop = new QAction(q);
toDesktop->setEnabled(false);
toDesktop->setText(tr("Switch to Desktop"));
// useful for monkey-testing to crash...
......@@ -212,7 +212,7 @@ public:
desktopWindow = new KisMainWindow();
toSketch = new KAction(desktopWindow);
toSketch = new QAction(desktopWindow);
toSketch->setEnabled(false);
toSketch->setText(tr("Switch to Sketch"));
toSketch->setIcon(QIcon::fromTheme("system-reboot"));
......
......@@ -59,7 +59,7 @@ struct Q_DECL_HIDDEN KisBaseProcessor::Private {
KoID id;
KoID category; // The category in the filter menu this filter fits
QString entry; // the i18n'ed accelerated menu text
KShortcut shortcut;
QKeySequence shortcut;
bool supportsPainting;
bool supportsAdjustmentLayers;
bool supportsThreading;
......@@ -138,12 +138,12 @@ QString KisBaseProcessor::menuEntry() const
return d->entry;
}
KShortcut KisBaseProcessor::shortcut() const
QKeySequence KisBaseProcessor::shortcut() const
{
return d->shortcut;
}
void KisBaseProcessor::setShortcut(const KShortcut & shortcut)
void KisBaseProcessor::setShortcut(const QKeySequence & shortcut)
{
d->shortcut = shortcut;
}
......
......@@ -23,7 +23,7 @@
#include <QString>
#include <klocalizedstring.h>
#include <kshortcut.h>
#include <QKeySequence>
#include "KoID.h"
#include "KoColorSpace.h"
......@@ -101,7 +101,7 @@ public:
*
* @return the shortcut
*/
KShortcut shortcut() const;
QKeySequence shortcut() const;
/**
* Create the configuration widget for this processor.
......@@ -152,7 +152,7 @@ protected:
/**
* Set the default shortcut for activation of this filter.
*/
void setShortcut(const KShortcut & shortcut);
void setShortcut(const QKeySequence & shortcut);
protected:
......
......@@ -28,7 +28,7 @@
#include <kconfig.h>
#include <kconfiggroup.h>
#include <kglobal.h>
#include <kaction.h>
#include <QAction>
#include <kactioncollection.h>
#include "KisViewManager.h"
......@@ -68,15 +68,15 @@ KisColorSelectorContainer::KisColorSelectorContainer(QWidget *parent) :
connect(this, SIGNAL(settingsChanged()), m_minimalShadeSelector, SLOT(updateSettings()));
m_colorSelAction = new KAction("Show color selector", this);
m_colorSelAction = new QAction("Show color selector", this);
m_colorSelAction->setShortcut(QKeySequence(Qt::SHIFT + Qt::Key_I));
connect(m_colorSelAction, SIGNAL(triggered()), m_colorSelector, SLOT(showPopup()), Qt::UniqueConnection);
m_mypaintAction = new KAction("Show MyPaint shade selector", this);
m_mypaintAction = new QAction("Show MyPaint shade selector", this);
m_mypaintAction->setShortcut(QKeySequence(Qt::SHIFT + Qt::Key_M));
connect(m_mypaintAction, SIGNAL(triggered()), m_myPaintShadeSelector, SLOT(showPopup()), Qt::UniqueConnection);
m_minimalAction = new KAction("Show minimal shade selector", this);
m_minimalAction = new QAction("Show minimal shade selector", this);
m_minimalAction->setShortcut(QKeySequence(Qt::SHIFT + Qt::Key_N));
connect(m_minimalAction, SIGNAL(triggered()), m_minimalShadeSelector, SLOT(showPopup()), Qt::UniqueConnection);
......
......@@ -26,7 +26,7 @@ class KisColorSelector;
class KisMyPaintShadeSelector;
class KisMinimalShadeSelector;
class QBoxLayout;
class KAction;
class QAction;
class KisColorSelectorContainer : public QWidget
{
......@@ -59,9 +59,9 @@ private:
QBoxLayout* m_widgetLayout;
KAction* m_colorSelAction;
KAction* m_mypaintAction;
KAction* m_minimalAction;
QAction * m_colorSelAction;
QAction * m_mypaintAction;
QAction * m_minimalAction;
QPointer<KisCanvas2> m_canvas;
};
......
......@@ -25,7 +25,7 @@
#include <kconfiggroup.h>
#include <kglobal.h>
#include <kaction.h>
#include <QAction>
#include <kactioncollection.h>
#include "kis_canvas2.h"
......@@ -91,12 +91,12 @@ KisColorSelectorNgDockerWidget::KisColorSelectorNgDockerWidget(QWidget *parent)
emit settingsChanged();
m_colorHistoryAction = new KAction("Show color history", this);
m_colorHistoryAction = new QAction("Show color history", this);
m_colorHistoryAction->setShortcut(QKeySequence(tr("H")));
connect(m_colorHistoryAction, SIGNAL(triggered()), m_colorHistoryWidget, SLOT(showPopup()), Qt::UniqueConnection);
m_commonColorsAction = new KAction("Show common colors", this);
m_commonColorsAction = new QAction("Show common colors", this);
m_commonColorsAction->setShortcut(QKeySequence(tr("U")));
connect(m_commonColorsAction, SIGNAL(triggered()), m_commonColorsWidget, SLOT(showPopup()), Qt::UniqueConnection);
......
......@@ -23,7 +23,7 @@
#include <QPointer>
#include <kis_canvas2.h>
class KAction;
class QAction;
class KisCommonColors;
class KisColorHistory;
......@@ -54,8 +54,8 @@ private:
KisColorHistory* m_colorHistoryWidget;
KisCommonColors* m_commonColorsWidget;
KAction* m_colorHistoryAction;
KAction* m_commonColorsAction;
QAction * m_colorHistoryAction;
QAction * m_commonColorsAction;
QHBoxLayout* m_verticalColorPatchesLayout; // vertical color patches should be added here
QVBoxLayout* m_horizontalColorPatchesLayout;//horizontal ----------"----------------------
......
......@@ -26,7 +26,7 @@
KisColorBalanceFilter::KisColorBalanceFilter()
: KisColorTransformationFilter(id(), categoryAdjust(), i18n("&Color Balance.."))
{
setShortcut(KShortcut(QKeySequence(Qt::CTRL + Qt::Key_B)));
setShortcut(QKeySequence(Qt::CTRL + Qt::Key_B));
setSupportsPainting(true);
}
......
......@@ -56,7 +56,7 @@
KisDesaturateFilter::KisDesaturateFilter()
: KisColorTransformationFilter(id(), categoryAdjust(), i18n("&Desaturate"))
{
setShortcut(KShortcut(QKeySequence(Qt::CTRL + Qt::SHIFT + Qt::Key_U)));
setShortcut(QKeySequence(Qt::CTRL + Qt::SHIFT + Qt::Key_U));
setSupportsPainting(true);
}
......
......@@ -27,7 +27,7 @@
KisHSVAdjustmentFilter::KisHSVAdjustmentFilter()
: KisColorTransformationFilter(id(), categoryAdjust(), i18n("&HSV Adjustment..."))
{
setShortcut(KShortcut(QKeySequence(Qt::CTRL + Qt::Key_U)));
setShortcut(QKeySequence(Qt::CTRL + Qt::Key_U));
setSupportsPainting(true);
}
......
......@@ -50,7 +50,7 @@ KritaExample::~KritaExample()
KisFilterInvert::KisFilterInvert() : KisColorTransformationFilter(id(), categoryAdjust(), i18n("&Invert"))
{
setShortcut(KShortcut(QKeySequence(Qt::CTRL + Qt::Key_I)));
setShortcut(QKeySequence(Qt::CTRL + Qt::Key_I));
setColorSpaceIndependence(FULLY_INDEPENDENT);
setSupportsPainting(true);
setShowConfigurationWidget(false);
......
......@@ -46,7 +46,7 @@
KisLevelFilter::KisLevelFilter()
: KisColorTransformationFilter(id(), categoryAdjust(), i18n("&Levels..."))
{
setShortcut(KShortcut(QKeySequence(Qt::CTRL + Qt::Key_L)));
setShortcut(QKeySequence(Qt::CTRL + Qt::Key_L));
setSupportsPainting(false);
setColorSpaceIndependence(TO_LAB16);
}
......
......@@ -25,7 +25,7 @@
#include <QComboBox>
#include <klocalizedstring.h>
#include <kaction.h>
#include <QAction>
#include <kactioncollection.h>
#include <kglobal.h>
......@@ -47,11 +47,11 @@ void KisToolBrush::addSmoothingAction(int enumId, const QString &id, const QStri
* should be unique, so let's be careful with them
*/
if (!globalCollection->action(id)) {
KAction *action = new KAction(name, globalCollection);
QAction *action = new QAction(name, globalCollection);
globalCollection->addAction(id, action);
}
KAction *action = dynamic_cast<KAction*>(globalCollection->action(id));
QAction *action = dynamic_cast<QAction*>(globalCollection->action(id));
addAction(id, action);
connect(action, SIGNAL(triggered()), &m_signalMapper, SLOT(map()));
......@@ -431,9 +431,9 @@ QWidget * KisToolBrush::createOptionWidget()
m_sliderMagnetism->setValue(m_magnetism * MAXIMUM_MAGNETISM);
connect(m_sliderMagnetism, SIGNAL(valueChanged(int)), SLOT(slotSetMagnetism(int)));
KAction *toggleaction = new KAction(i18n("Toggle Assistant"), this);
QAction *toggleaction = new QAction(i18n("Toggle Assistant"), this);
addAction("toggle_assistant", toggleaction);
toggleaction->setShortcut(KShortcut(Qt::ControlModifier + Qt::ShiftModifier + Qt::Key_L));
toggleaction->setShortcut(QKeySequence(Qt::ControlModifier + Qt::ShiftModifier + Qt::Key_L));
connect(toggleaction, SIGNAL(triggered(bool)), m_chkAssistant, SLOT(toggle()));
addOptionWidgetOption(m_sliderMagnetism, assistantWidget);
......
......@@ -27,7 +27,7 @@
#include <flake/kis_node_shape.h>
#include <KoIcon.h>
#include <kshortcut.h>
#include <QKeySequence>
#include <kconfig.h>
#include <kconfiggroup.h>
......@@ -147,7 +147,7 @@ public:
// Temporarily
setToolType(TOOL_TYPE_SHAPE);
setIconName(koIconNameCStr("krita_tool_freehand"));
setShortcut(KShortcut(Qt::Key_B));
setShortcut(QKeySequence(Qt::Key_B));
setPriority(0);
setActivationShapeId(KRITA_TOOL_ACTIVATION_ID);
}
......
......@@ -29,7 +29,7 @@
#include "kis_tool.h"
#include <flake/kis_node_shape.h>
#include <KoIcon.h>
#include <kshortcut.h>
#include <QKeySequence>
class KoResource;
class KoColorSet;
......@@ -124,7 +124,7 @@ public:
setToolType(TOOL_TYPE_FILL);
setPriority(15);
setIconName(koIconNameCStr("krita_tool_color_picker"));
setShortcut(KShortcut(Qt::Key_P));
setShortcut(QKeySequence(Qt::Key_P));
setActivationShapeId(KRITA_TOOL_ACTIVATION_ID);
}
......
......@@ -24,7 +24,7 @@
#ifndef KIS_TOOL_GRADIENT_H_
#define KIS_TOOL_GRADIENT_H_
#include <kshortcut.h>
#include <QKeySequence>
#include <KoToolFactoryBase.h>
......@@ -114,7 +114,7 @@ public:
setToolTip(i18n("Gradient Tool"));
setToolType(TOOL_TYPE_FILL);
setIconName(koIconNameCStr("krita_tool_gradient"));
setShortcut(KShortcut(Qt::Key_G));
setShortcut(QKeySequence(Qt::Key_G));
setPriority(15);
setActivationShapeId(KRITA_TOOL_ACTIVATION_ID);
}
......
......@@ -26,7 +26,7 @@
#include <kis_tool.h>
#include <flake/kis_node_shape.h>
#include <KoIcon.h>
#include <kshortcut.h>
#include <QKeySequence>
#include <QWidget>
#include <QGroupBox>
#include <QRadioButton>
......@@ -126,7 +126,7 @@ public:
setActivationShapeId(KRITA_TOOL_ACTIVATION_ID);
setPriority(11);
setIconName(koIconNameCStr("krita_tool_move"));
setShortcut( KShortcut(QKeySequence( Qt::Key_T )) );
setShortcut(QKeySequence( Qt::Key_T));
}
virtual ~KisToolMoveFactory() {}
......
......@@ -100,7 +100,7 @@ public:
// Temporarily
setToolType(TOOL_TYPE_SHAPE);
setIconName(koIconNameCStr("krita_tool_multihand"));
setShortcut(KShortcut(Qt::Key_Q));
setShortcut(QKeySequence(Qt::Key_Q));
setPriority(11);
setActivationShapeId(KRITA_TOOL_ACTIVATION_ID);
}
......
......@@ -29,7 +29,7 @@
#include <kis_tool_select_base.h>
#include "kis_selection_tool_config_widget_helper.h"
#include <KoIcon.h>
#include <kshortcut.h>
#include <QKeySequence>
......@@ -75,7 +75,7 @@ public:
setToolType(TOOL_TYPE_SELECTED);
setActivationShapeId(KRITA_TOOL_ACTIVATION_ID);
setIconName(koIconNameCStr("tool_elliptical_selection"));
setShortcut(KShortcut(Qt::Key_J));
setShortcut(QKeySequence(Qt::Key_J));
setPriority(53);
}
......
......@@ -28,7 +28,7 @@
#include <kis_tool_select_base.h>
#include "kis_selection_tool_config_widget_helper.h"
#include <KoIcon.h>
#include <kshortcut.h>
#include <QKeySequence>
class __KisToolSelectRectangularLocal : public KisToolRectangleBase
......@@ -68,7 +68,7 @@ public:
setToolType(TOOL_TYPE_SELECTED);
setActivationShapeId(KRITA_TOOL_ACTIVATION_ID);
setIconName(koIconNameCStr("tool_rect_selection"));
setShortcut(KShortcut(Qt::CTRL + Qt::Key_R));
setShortcut(QKeySequence(Qt::CTRL + Qt::Key_R));
setPriority(52);
}
......
......@@ -29,7 +29,7 @@
#include <kconfig.h>
#include <kconfiggroup.h>
#include <KShortcut>
#include <QKeySequence>
#include <KoToolFactoryBase.h>
#include "kis_tool.h"
#include "flake/kis_node_shape.h"
......@@ -214,7 +214,7 @@ public:
setActivationShapeId(KRITA_TOOL_ACTIVATION_ID);
setPriority(10);
setIconName(koIconNameCStr("tool_crop"));
setShortcut(KShortcut("C"));
setShortcut(QKeySequence("C"));
}
virtual ~KisToolCropFactory() {}
......
......@@ -162,7 +162,7 @@ public:
setToolType(TOOL_TYPE_SHAPE);
setIconName(koIconNameCStr("krita_tool_dyna"));
// TODO
//setShortcut(KShortcut(Qt::Key_F));
//setShortcut(QKeySequence(Qt::Key_F));
setPriority(10);
setActivationShapeId(KRITA_TOOL_ACTIVATION_ID);
}
......
......@@ -31,7 +31,7 @@
#include <QVector3D>
#include <QButtonGroup>
#include <kshortcut.h>
#include <QKeySequence>
#include <KoToolFactoryBase.h>
......@@ -306,7 +306,7 @@ public:
setToolTip(i18n("Transform a layer or a selection"));
setToolType(TOOL_TYPE_TRANSFORM);
setIconName(koIconNameCStr("krita_tool_transform"));
setShortcut(KShortcut( QKeySequence(Qt::CTRL + Qt::Key_T) ));
setShortcut(QKeySequence(Qt::CTRL + Qt::Key_T));
setPriority(11);
setActivationShapeId(KRITA_TOOL_ACTIVATION_ID);
}
......
......@@ -47,7 +47,7 @@
#include <krecentdirs.h>
#include <kactioncollection.h>
#include <kaction.h>
#include <QAction>
#include <kactionmenu.h>
#include <kis_debug.h>
#include <kdiroperator.h>
......@@ -457,7 +457,7 @@ void KisMainWindow::setNoCleanup(bool noCleanup)
KisMainWindow::~KisMainWindow()
{
// foreach(QAction *ac, actionCollection()->actions()) {
// KAction *action = qobject_cast<KAction*>(ac);
// QAction *action = qobject_cast<QAction*>(ac);
// if (action) {
// dbgKrita << "<Action"
// << "name=" << action->objectName()
......@@ -466,8 +466,8 @@ KisMainWindow::~KisMainWindow()
// << "whatsThis=" << action->whatsThis()
// << "toolTip=" << action->toolTip().replace("<html>", "").replace("</html>", "")
// << "iconText=" << action->iconText().replace("&", "&amp;")
// << "shortcut=" << action->shortcut(KAction::ActiveShortcut).toString()
// << "defaultShortcut=" << action->shortcut(KAction::DefaultShortcut).toString()
// << "shortcut=" << action->shortcut(QAction::ActiveShortcut).toString()
// << "defaultShortcut=" << action->shortcut(QAction::DefaultShortcut).toString()
// << "isCheckable=" << QString((action->isChecked() ? "true" : "false"))
// << "statusTip=" << action->statusTip()
// << "/>" ;
......
......@@ -54,7 +54,7 @@
#include <kactioncollection.h>
#include <kconfig.h>
#include <kconfiggroup.h>
#include <kshortcut.h>
#include <QKeySequence>
#include <QDialog>
#include <QGraphicsScene>
......@@ -138,9 +138,9 @@ void KisPart::Private::loadActions()
QString toolTip = i18n(e.attribute("toolTip").toUtf8().constData());
QString statusTip = i18n(e.attribute("statusTip").toUtf8().constData());
QString iconText = i18n(e.attribute("iconText").toUtf8().constData());
KShortcut shortcut = KShortcut(e.attribute("shortcut"));
QKeySequence shortcut = QKeySequence(e.attribute("shortcut"));
bool isCheckable = e.attribute("isCheckable") == "true" ? true : false;
KShortcut defaultShortcut = KShortcut(e.attribute("defaultShortcut"));
QKeySequence defaultShortcut = QKeySequence(e.attribute("defaultShortcut"));
if (name.isEmpty()) {
dbgKrita << text << "has no name! From:" << actionDefinition;
......@@ -152,9 +152,8 @@ void KisPart::Private::loadActions()
action->setToolTip(toolTip);
action->setStatusTip(statusTip);
action->setIconText(iconText);
action->setShortcut(shortcut, KAction::ActiveShortcut);
action->setShortcut(shortcut);
action->setCheckable(isCheckable);
action->setShortcut(defaultShortcut, KAction::DefaultShortcut);
if (!actionCollection->action(name)) {
actionCollection->addAction(name, action);
......
......@@ -27,7 +27,7 @@
#include <kstandardshortcut.h>
KisUndoStackAction::KisUndoStackAction(KUndo2Stack* stack, Type type)
: KAction(stack)
: QAction(stack)
, m_type(type)
{
if (m_type == UNDO) {
......
......@@ -21,11 +21,11 @@
#ifndef KIS_UNDOSTACKACTION_H
#define KIS_UNDOSTACKACTION_H
#include <kaction.h>
#include <QAction>
class KUndo2Stack;
class KisUndoStackAction : public KAction
class KisUndoStackAction : public QAction
{
Q_OBJECT
public:
......
......@@ -377,12 +377,12 @@ KisViewManager* KisView::viewManager() const
}
KAction *KisView::undoAction() const
QAction *KisView::undoAction() const
{
return d->undo;
}
KAction *KisView::redoAction() const
QAction *KisView::redoAction() const
{
return d->redo;
}
......@@ -498,13 +498,13 @@ void KisView::dropEvent(QDropEvent *event)
KMenu popup;
popup.setObjectName("drop_popup");
QAction *insertAsNewLayer = new KAction(i18n("Insert as New Layer"), &popup);
QAction *insertManyLayers = new KAction(i18n("Insert Many Layers"), &popup);
QAction *insertAsNewLayer = new QAction(i18n("Insert as New Layer"), &popup);
QAction *insertManyLayers = new QAction(i18n("Insert Many Layers"), &popup);
QAction *openInNewDocument = new KAction(i18n("Open in New Document"), &popup);
QAction *openManyDocuments = new KAction(i18n("Open Many Documents"), &popup);
QAction *openInNewDocument = new QAction(i18n("Open in New Document"), &popup);
QAction *openManyDocuments = new QAction(i18n("Open Many Documents"), &popup);
QAction *cancel = new KAction(i18n("Cancel"), &popup);
QAction *cancel = new QAction(i18n("Cancel"), &popup);
popup.addAction(insertAsNewLayer);
popup.addAction(openInNewDocument);
......
......@@ -49,7 +49,7 @@ struct KoPageLayout;
class KoCanvasResourceManager;
// KDE classes
class KAction;
class QAction;
class KActionCollection;
// Qt classes
......@@ -75,8 +75,8 @@ public:
KisView(KisDocument *document, KoCanvasResourceManager *resourceManager, KActionCollection *actionCollection, QWidget *parent = 0);
~KisView();
KAction *undoAction() const;
KAction *redoAction() const;
QAction *undoAction() const;
QAction *redoAction() const;
// Temporary while teasing apart view and mainwindow
void setViewManager(KisViewManager *view);
......
......@@ -45,7 +45,7 @@
#include <QPoint>
#include <kactioncollection.h>
#include <kaction.h>
#include <QAction>
#include <klocalizedstring.h>
#include <kmenubar.h>
#include <kmenu.h>
......@@ -731,8 +731,7 @@ void KisViewManager::createActions()
//Workaround, by default has the same shortcut as mirrorCanvas
KisAction *a = dynamic_cast<KisAction*>(actionCollection()->action("format_italic"));
if (a) {
a->setShortcut(QKeySequence(), KAction::DefaultShortcut);
a->setShortcut(QKeySequence(), KAction::ActiveShortcut);
a->setShortcut(QKeySequence());
a->setActivationConditions(KisAction::SELECTION_EDITABLE);
}
......
......@@ -20,7 +20,7 @@
#include "kis_grid_manager.h"
#include <kaction.h>
#include <QAction>
#include <ktoggleaction.h>
#include <kactioncollection.h>
#include <klocalizedstring.h>
......
......@@ -22,7 +22,7 @@
#include "canvas/kis_perspective_grid_manager.h"
#include <kaction.h>
#include <QAction>
#include <klocalizedstring.h>
#include <ktoggleaction.h>
#include <kactioncollection.h>
......@@ -75,7 +75,7 @@ void KisPerspectiveGridManager::setup(KActionCollection * collection)
m_toggleGrid->setCheckedState(KGuiItem(i18n("Hide Perspective Grid")));
m_toggleGrid->setChecked(false);
m_gridClear = new KAction(i18n("Clear Perspective Grid"), this);
m_gridClear = new QAction(i18n("Clear Perspective Grid"), this);
collection->addAction("view_clear_perspective_grid", m_gridClear);
connect(m_gridClear, SIGNAL(triggered()), this, SLOT(clearPerspectiveGrid()));
updateGUI();
......
......@@ -27,7 +27,7 @@
#include <kritaui_export.h>
class KisPerspectiveGridDecoration;
class KAction;
class QAction;
class KActionCollection;
class KToggleAction;
class KisViewManager;
......@@ -65,7 +65,7 @@ private:
QPointer<KisView> m_imageView;
KToggleAction* m_toggleGrid;
KAction* m_gridClear;
QAction * m_gridClear;
};
#endif
......@@ -34,22 +34,26 @@ public:
};
KisAction::KisAction(QObject* parent)
: KAction(parent)
: QWidgetAction(parent)
, d(new Private)
{
connect(this, SIGNAL(changed()), SLOT(slotChanged()));
}
KisAction::KisAction(const QString& text, QObject* parent)
: KAction(text, parent)
: QWidgetAction(parent)
, d(new KisAction::Private)
{
QAction::setText(text);
connect(this, SIGNAL(changed()), SLOT(slotChanged()));
}
KisAction::KisAction(const KIcon& icon, const QString& text, QObject* parent)
: KAction(icon, text, parent)
, d(new Private) {
: QWidgetAction(parent)
, d(new Private)
{
QAction::setIcon(icon);
QAction::setText(text);
connect(this, SIGNAL(changed()), SLOT(slotChanged()));
}
......
......@@ -19,13 +19,13 @@
#ifndef KIS_ACTION_H
#define KIS_ACTION_H
#include <kaction.h>
#include <QWidgetAction>
#include <kritaui_export.h>
#include <kis_debug.h>
#include <kicon.h>
class KisActionManager;
class KRITAUI_EXPORT KisAction : public KAction
class KRITAUI_EXPORT KisAction : public QWidgetAction
{
Q_OBJECT
public:
......
......@@ -234,11 +234,10 @@ KisAction *KisActionManager::createStandardAction(KStandardAction::StandardActio
KisAction *action = new KisAction(KIcon(standardAction->icon()), standardAction->text());
const QList<QKeySequence> defaultShortcuts = standardAction->property("defaultShortcuts").value<QList<QKeySequence> >();
const QKeySequence defaultShortcut = defaultShortcuts.isEmpty() ? QKeySequence() : defaultShortcuts.at(0);
action->setShortcut(defaultShortcut, KAction::DefaultShortcut);
action->setShortcut(standardAction->shortcut(), KAction::ActiveShortcut);
action->setShortcut(standardAction->shortcut());
#ifdef Q_OS_WIN
if (actionType == KStandardAction::SaveAs && defaultShortcuts.isEmpty()) {
action->setShortcut(QKeySequence("CTRL+SHIFT+S"), KAction::DefaultShortcut);
action->setShortcut(QKeySequence("CTRL+SHIFT+S"));
}
#endif
action->setCheckable(standardAction->isCheckable());
......
......@@ -20,7 +20,7 @@
#include "kis_canvas_controls_manager.h"