Changeset View
Changeset View
Standalone View
Standalone View
krita/ui/tool/kis_tool_polyline_base.cpp
Show All 38 Lines | |||||
39 | #define PREVIEW_LINE_WIDTH 1 | 39 | #define PREVIEW_LINE_WIDTH 1 | ||
40 | 40 | | |||
41 | KisToolPolylineBase::KisToolPolylineBase(KoCanvasBase * canvas, KisToolPolylineBase::ToolType type, const QCursor & cursor) | 41 | KisToolPolylineBase::KisToolPolylineBase(KoCanvasBase * canvas, KisToolPolylineBase::ToolType type, const QCursor & cursor) | ||
42 | : KisToolShape(canvas, cursor), | 42 | : KisToolShape(canvas, cursor), | ||
43 | m_dragging(false), | 43 | m_dragging(false), | ||
44 | m_type(type), | 44 | m_type(type), | ||
45 | m_closeSnappingActivated(false) | 45 | m_closeSnappingActivated(false) | ||
46 | { | 46 | { | ||
47 | KisCanvas2 * kiscanvas = dynamic_cast<KisCanvas2*>(this->canvas()); | 47 | QAction *undo_polygon_selection = | ||
48 | KActionCollection *collection = this->canvas()->canvasController()->actionCollection(); | 48 | KisActionRegistry::instance()->makeQAction("undo_polygon_selection", this); | ||
49 | if (kiscanvas && kiscanvas->viewManager()) { | | |||
50 | QAction *undo_polygon_selection = new QAction("Undo Polygon Selection Points",this); | | |||
51 | undo_polygon_selection->setShortcut(QKeySequence(Qt::ShiftModifier + Qt::Key_Z)); | | |||
52 | collection->addAction("undo_polygon_selection", undo_polygon_selection); | | |||
53 | addAction("undo_polygon_selection", undo_polygon_selection); | 49 | addAction("undo_polygon_selection", undo_polygon_selection); | ||
54 | } | 50 | } | ||
55 | } | | |||
56 | 51 | | |||
57 | 52 | | |||
58 | void KisToolPolylineBase::activate(KoToolBase::ToolActivation activation, const QSet<KoShape *> &shapes) | 53 | void KisToolPolylineBase::activate(KoToolBase::ToolActivation activation, const QSet<KoShape *> &shapes) | ||
59 | { | 54 | { | ||
60 | KisToolShape::activate(activation, shapes); | 55 | KisToolShape::activate(activation, shapes); | ||
61 | connect(actions().value("undo_polygon_selection"), SIGNAL(triggered()), SLOT(undoSelection()), Qt::UniqueConnection); | 56 | connect(actions().value("undo_polygon_selection"), SIGNAL(triggered()), SLOT(undoSelection()), Qt::UniqueConnection); | ||
62 | } | 57 | } | ||
63 | 58 | | |||
▲ Show 20 Lines • Show All 207 Lines • Show Last 20 Lines |