X-Git-Url: http://shamusworld.gotdns.org/cgi-bin/gitweb.cgi?a=blobdiff_plain;f=src%2Factions%2Frs_actionblocksattributes.cpp;h=a4e084bc89096c0cd1f1c499a39cdeeb5aced119;hb=27d4a138d23453e93a833e9347444b828a971cb4;hp=9c363e31ebe05ecbd36d0fca53fae260b8a71796;hpb=89e127aa3dbd74d3158e6dbe0ca1703420c04395;p=architektonas diff --git a/src/actions/rs_actionblocksattributes.cpp b/src/actions/rs_actionblocksattributes.cpp index 9c363e3..a4e084b 100644 --- a/src/actions/rs_actionblocksattributes.cpp +++ b/src/actions/rs_actionblocksattributes.cpp @@ -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,66 +29,58 @@ #include "drawing.h" #include "rs_dialogfactory.h" - - RS_ActionBlocksAttributes::RS_ActionBlocksAttributes( - RS_EntityContainer& container, - RS_GraphicView& graphicView) - :RS_ActionInterface("Edit Block Attributes", container, graphicView) + RS_EntityContainer & container, GraphicView & graphicView): + RS_ActionInterface("Edit Block Attributes", container, graphicView) { } - - -QAction* RS_ActionBlocksAttributes::createGUIAction(RS2::ActionType /*type*/, QObject* /*parent*/) +QAction * RS_ActionBlocksAttributes::createGUIAction(RS2::ActionType /*type*/, QObject * /*parent*/) { - - QAction * action = new QAction(tr("&Rename Block"), 0); + QAction * action = new QAction(tr("&Rename Block"), 0); // QAction* action = new QAction(tr("Rename Block"), // tr("&Rename Block"), // QKeySequence(), NULL); - action->setStatusTip(tr("Rename Block and all Inserts")); - return action; + action->setStatusTip(tr("Rename Block and all Inserts")); + return action; } - - void RS_ActionBlocksAttributes::trigger() { - RS_DEBUG->print("editing block attributes"); - - if (graphic!=NULL && RS_DIALOGFACTORY!=NULL) { - RS_Block* block = graphic->getActiveBlock(); - RS_BlockList* blockList = graphic->getBlockList(); - if (blockList!=NULL && block!=NULL) { - QString oldName = block->getName(); - - RS_BlockData d; - d = RS_DIALOGFACTORY->requestBlockAttributesDialog( - blockList); - - if (d.isValid()) { - - QString newName = d.name; - blockList->rename(block, newName); - - // update the name of all inserts: - graphic->renameInserts(oldName, newName); - - graphic->addBlockNotification(); - } - } - - } - finish(); + RS_DEBUG->print("editing block attributes"); + + if (graphic != NULL && RS_DIALOGFACTORY != NULL) + { + RS_Block * block = graphic->getActiveBlock(); + RS_BlockList * blockList = graphic->getBlockList(); + + if (blockList != NULL && block != NULL) + { + QString oldName = block->getName(); + + RS_BlockData d; + d = RS_DIALOGFACTORY->requestBlockAttributesDialog( + blockList); + + if (d.isValid()) + { + QString newName = d.name; + blockList->rename(block, newName); + + // update the name of all inserts: + graphic->renameInserts(oldName, newName); + + graphic->addBlockNotification(); + } + } + } + finish(); } - - void RS_ActionBlocksAttributes::init(int status) { - RS_ActionInterface::init(status); - trigger(); + RS_ActionInterface::init(status); + trigger(); } // EOF