1 // actionmodifyentity.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 06/04/2010 Added this text. :-)
17 #include "actionmodifyentity.h"
19 #include "rs_dialogfactory.h"
20 #include "graphicview.h"
22 ActionModifyEntity::ActionModifyEntity(RS_EntityContainer & container,
23 GraphicView & graphicView):
24 ActionInterface("Modify Entity", container, graphicView)
29 ActionModifyEntity::~ActionModifyEntity()
33 void ActionModifyEntity::trigger()
37 RS_Entity * clone = en->clone();
39 if (RS_DIALOGFACTORY->requestModifyEntityDialog(clone))
41 container->addEntity(clone);
43 graphicView->deleteEntity(en);
44 en->setSelected(false);
46 clone->setSelected(false);
47 graphicView->drawEntity(clone);
51 document->startUndoCycle();
53 document->addUndoable(clone);
54 en->setUndoState(true);
55 document->addUndoable(en);
57 document->endUndoCycle();
59 RS_DIALOGFACTORY->updateSelectionWidget(container->countSelected());
66 RS_DEBUG->print("ActionModifyEntity::trigger: Entity is NULL\n");
69 void ActionModifyEntity::mouseReleaseEvent(QMouseEvent * e)
71 if (e->button() == Qt::RightButton)
72 init(getStatus() - 1);
80 void ActionModifyEntity::updateMouseCursor()
82 graphicView->setMouseCursor(RS2::SelectCursor);