** 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.
**
#include "rs_actionblocksattributes.h"
-#include "rs_graphic.h"
+#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