1 // actionblocksattributes.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 // Portions copyright (C) 2001-2003 RibbonSoft
7 // Copyright (C) 2010 Underground Software
8 // See the README and GPLv2 files for licensing and warranty information
10 // JLH = James L. Hammons <jlhamm@acm.org>
13 // --- ---------- -----------------------------------------------------------
14 // JLH 07/12/2010 Added this text. :-)
17 #include "actionblocksattributes.h"
20 #include "dialogfactory.h"
22 ActionBlocksAttributes::ActionBlocksAttributes(
23 EntityContainer & container, GraphicView & graphicView):
24 ActionInterface("Edit Block Attributes", container, graphicView)
28 ActionBlocksAttributes::~ActionBlocksAttributes()
32 void ActionBlocksAttributes::trigger()
34 DEBUG->print("editing block attributes");
36 if (graphic && DIALOGFACTORY)
38 Block * block = graphic->getActiveBlock();
39 BlockList * blockList = graphic->getBlockList();
41 if (blockList && block)
43 QString oldName = block->getName();
44 BlockData d = DIALOGFACTORY->requestBlockAttributesDialog(blockList);
48 QString newName = d.name;
49 blockList->rename(block, newName);
51 // update the name of all inserts:
52 graphic->renameInserts(oldName, newName);
53 graphic->addBlockNotification();
61 void ActionBlocksAttributes::init(int status)
63 ActionInterface::init(status);