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