]> Shamusworld >> Repos - architektonas/blob - src/actions/actionlayersadd.cpp
Last checkin before major refactor...
[architektonas] / src / actions / actionlayersadd.cpp
1 // actionlayersadd.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 "actionlayersadd.h"
16
17 #include "rs_dialogfactory.h"
18 #include "drawing.h"
19
20 ActionLayersAdd::ActionLayersAdd(RS_EntityContainer & container, GraphicView & graphicView):
21         ActionInterface("Add Layer", container, graphicView)
22 {
23 }
24
25 ActionLayersAdd::~ActionLayersAdd()
26 {
27 }
28
29 void ActionLayersAdd::trigger()
30 {
31         RS_DEBUG->print("add layer");
32
33         if (RS_DIALOGFACTORY != NULL && graphic)
34         {
35                 RS_Layer * layer = RS_DIALOGFACTORY->requestNewLayerDialog(graphic->getLayerList());
36
37                 if (layer != NULL)
38                         graphic->addLayer(layer);
39         }
40
41         finish();
42 }
43
44 void ActionLayersAdd::init(int status)
45 {
46         ActionInterface::init(status);
47         trigger();
48 }