]> Shamusworld >> Repos - architektonas/blobdiff - src/actions/rs_actioneditundo.cpp
Major refactoring of actions: Moved implementation from header files
[architektonas] / src / actions / rs_actioneditundo.cpp
index 939fe95e470a277eefab89b45802b772b14e88aa..3a9cfeac6578dfa63705b14eae8653315d2b4caf 100644 (file)
 //
 
 #include "rs_actioneditundo.h"
-#include "rs_snapper.h"
-//Added by qt3to4:
-//#include <QIcon>//needed???
+
+#include "rs_dialogfactory.h"
+#include "rs_graphicview.h"
 
 /**
  * Constructor.
  *
  * @param undo true for undo and false for redo.
  */
-RS_ActionEditUndo::RS_ActionEditUndo(bool undo, RS_EntityContainer & container,
-       RS_GraphicView & graphicView): RS_ActionInterface("Edit Undo", container, graphicView)
+RS_ActionEditUndo::RS_ActionEditUndo(bool undo, RS_EntityContainer & container, RS_GraphicView & graphicView): RS_ActionInterface("Edit Undo", container, graphicView)
 {
        this->undo = undo;
 }
@@ -32,34 +31,6 @@ RS_ActionEditUndo::~RS_ActionEditUndo()
 {
 }
 
-QAction * RS_ActionEditUndo::createGUIAction(RS2::ActionType type, QObject * parent)
-{
-       QAction * action;
-
-       if (type == RS2::ActionEditUndo)
-       {
-               action = new QAction(QIcon(":/res/undo2.png"), tr("&Undo")/*+ QString("\too")*/, parent);
-               QList<QKeySequence> ks;
-               ks.append(QKeySequence(tr("o, o", "Edit|Undo")));
-               ks.append(Qt::CTRL + Qt::Key_Z);
-//             action->setShortcut(Qt::CTRL + Qt::Key_Z);
-               action->setShortcuts(ks);
-               action->setStatusTip(tr("Undoes last action"));
-       }
-       else
-       {
-               action = new QAction(QIcon(":/res/redo2.png"), tr("&Redo")/* + QString("\tuu")*/, parent);
-               QList<QKeySequence> ks;
-               ks.append(QKeySequence(tr("u, u", "Edit|Redo")));
-               ks.append(Qt::CTRL + Qt::SHIFT + Qt::Key_Z);
-//             action->setShortcut(Qt::CTRL + Qt::SHIFT + Qt::Key_Z);
-               action->setShortcuts(ks);
-               action->setStatusTip(tr("Redoes last action"));
-       }
-
-       return action;
-}
-
 void RS_ActionEditUndo::init(int status)
 {
        RS_ActionInterface::init(status);
@@ -80,3 +51,4 @@ void RS_ActionEditUndo::trigger()
        finish();
        RS_DIALOGFACTORY->updateSelectionWidget(container->countSelected());
 }
+