1 // rs_actioneditundo.cpp
3 // Part of the Architektonas Project
4 // Originally part of QCad Community Edition by Andrew Mustun
5 // Extensively rewritten and refactored by James L. Hammons
6 // (C) 2010 Underground Software
8 // JLH = James L. Hammons <jlhamm@acm.org>
11 // --- ---------- -----------------------------------------------------------
12 // JLH 05/22/2010 Added this text. :-)
15 #include "rs_actioneditundo.h"
16 #include "rs_snapper.h"
18 //#include <QIcon>//needed???
23 * @param undo true for undo and false for redo.
25 RS_ActionEditUndo::RS_ActionEditUndo(bool undo, RS_EntityContainer & container,
26 RS_GraphicView & graphicView): RS_ActionInterface("Edit Undo", container, graphicView)
31 RS_ActionEditUndo::~RS_ActionEditUndo()
35 QAction * RS_ActionEditUndo::createGUIAction(RS2::ActionType type, QObject * parent)
39 if (type == RS2::ActionEditUndo)
41 action = new QAction(QIcon(":/res/undo2.png"), tr("&Undo")/*+ QString("\too")*/, parent);
42 QList<QKeySequence> ks;
43 ks.append(QKeySequence(tr("o, o", "Edit|Undo")));
44 ks.append(Qt::CTRL + Qt::Key_Z);
45 // action->setShortcut(Qt::CTRL + Qt::Key_Z);
46 action->setShortcuts(ks);
47 action->setStatusTip(tr("Undoes last action"));
51 action = new QAction(QIcon(":/res/redo2.png"), tr("&Redo")/* + QString("\tuu")*/, parent);
52 QList<QKeySequence> ks;
53 ks.append(QKeySequence(tr("u, u", "Edit|Redo")));
54 ks.append(Qt::CTRL + Qt::SHIFT + Qt::Key_Z);
55 // action->setShortcut(Qt::CTRL + Qt::SHIFT + Qt::Key_Z);
56 action->setShortcuts(ks);
57 action->setStatusTip(tr("Redoes last action"));
63 void RS_ActionEditUndo::init(int status)
65 RS_ActionInterface::init(status);
69 void RS_ActionEditUndo::trigger()
76 document->updateInserts();
78 graphicView->redraw();
81 RS_DIALOGFACTORY->updateSelectionWidget(container->countSelected());