]> Shamusworld >> Repos - architektonas/blobdiff - src/actions/rs_actionblocksadd.cpp
Major refactoring of actions: Moved implementation from header files
[architektonas] / src / actions / rs_actionblocksadd.cpp
index d6705fedf092328a139a2460ed8e0718a735d295..a0ca3d69d040790986b7bfc116e76c2ace2dda89 100644 (file)
@@ -10,7 +10,7 @@
 ** Foundation and appearing in the file LICENSE.GPL included in the
 ** packaging of this file.
 **
-** Licensees holding valid qcadlib Professional Edition licenses may use 
+** Licensees holding valid qcadlib Professional Edition licenses may use
 ** this file in accordance with the qcadlib Commercial License
 ** Agreement provided with the Software.
 **
@@ -29,9 +29,8 @@
 #include "drawing.h"
 #include "rs_dialogfactory.h"
 
-RS_ActionBlocksAdd::RS_ActionBlocksAdd(RS_EntityContainer& container,
-                                       RS_GraphicView& graphicView)
-        :RS_ActionInterface("Add Block", container, graphicView)
+RS_ActionBlocksAdd::RS_ActionBlocksAdd(RS_EntityContainer & container, RS_GraphicView & graphicView):
+       RS_ActionInterface("Add Block", container, graphicView)
 {
 }
 
@@ -41,17 +40,17 @@ QAction * RS_ActionBlocksAdd::createGUIAction(RS2::ActionType /*type*/, QObject
 //    QAction * action = new QAction(tr("Add Block"), tr("&Add Block"),
 //                             QKeySequence(), NULL);
        QAction * action = new QAction(tr("&Add Block"), 0);
-    action->setStatusTip(tr("Add Block"));
-    return action;
+       action->setStatusTip(tr("Add Block"));
+       return action;
 }
 
 void RS_ActionBlocksAdd::trigger()
 {
-    RS_DEBUG->print("adding block");
-    //RS_Block* block = new RS_Block(container, "", Vector(0.0,0.0));
+       RS_DEBUG->print("adding block");
+       //RS_Block* block = new RS_Block(container, "", Vector(0.0,0.0));
 
-    if (graphic != NULL)
-    {
+       if (graphic != NULL)
+       {
                RS_BlockList * blockList = graphic->getBlockList();
 
                if (blockList != NULL)
@@ -59,21 +58,17 @@ void RS_ActionBlocksAdd::trigger()
                        RS_BlockData d = RS_DIALOGFACTORY->requestNewBlockDialog(blockList);
 
                        if (d.isValid())
-                       {
-                       graphic->addBlock(new RS_Block(container, d));
-                       }
+                               graphic->addBlock(new RS_Block(container, d));
                }
-    }
+       }
 
-    finish();
+       finish();
 }
 
-
-
 void RS_ActionBlocksAdd::init(int status)
 {
-    RS_ActionInterface::init(status);
-    trigger();
+       RS_ActionInterface::init(status);
+       trigger();
 }
 
 // EOF