]> Shamusworld >> Repos - architektonas/blob - src/actions/actionlayersremove.cpp
ac6bd42a60345dca98f59f231f6c0859913b7f9c
[architektonas] / src / actions / actionlayersremove.cpp
1 // actionlayersedit.cpp
2 //
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 // (C) 2010 Underground Software
7 //
8 // JLH = James L. Hammons <jlhamm@acm.org>
9 //
10 // Who  When        What
11 // ---  ----------  -----------------------------------------------------------
12 // JLH  06/04/2010  Added this text. :-)
13 //
14
15 #include "actionlayersremove.h"
16
17 #include "rs_dialogfactory.h"
18 #include "drawing.h"
19
20 ActionLayersRemove::ActionLayersRemove(RS_EntityContainer & container,
21         GraphicView & graphicView):
22         ActionInterface("Remove Layer", container, graphicView)
23 {
24 }
25
26 ActionLayersRemove::~ActionLayersRemove()
27 {
28 }
29
30 void ActionLayersRemove::trigger()
31 {
32         RS_DEBUG->print("ActionLayersRemove::trigger");
33
34         if (graphic)
35         {
36                 RS_Layer * layer =
37                         RS_DIALOGFACTORY->requestLayerRemovalDialog(graphic->getLayerList());
38
39                 // Now remove the layer from the layer list:
40                 graphic->removeLayer(layer);
41         }
42
43         finish();
44         RS_DIALOGFACTORY->updateSelectionWidget(container->countSelected());
45 }
46
47 void ActionLayersRemove::init(int status)
48 {
49         ActionInterface::init(status);
50         trigger();
51 }