]> Shamusworld >> Repos - architektonas/blob - src/actions/actionblockstoggleview.cpp
In the middle of major refactoring...
[architektonas] / src / actions / actionblockstoggleview.cpp
1 // actionblockstoggleview.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/03/2010  Added this text. :-)
13 //
14
15 #include "actionblockstoggleview.h"
16
17 #include "drawing.h"
18 #include "graphicview.h"
19
20 ActionBlocksToggleView::ActionBlocksToggleView(RS_EntityContainer & container,
21         GraphicView & graphicView): ActionInterface("Toggle Block Visibility",
22         container, graphicView)
23 {
24 }
25
26 ActionBlocksToggleView::~ActionBlocksToggleView()
27 {
28 }
29
30 void ActionBlocksToggleView::trigger()
31 {
32         RS_DEBUG->print("toggle block");
33
34         if (graphic)
35         {
36                 RS_Block * block = graphic->getActiveBlock();
37                 graphic->toggleBlock(block);
38         }
39
40         graphicView->redraw();
41         finish();
42 }
43
44 void ActionBlocksToggleView::init(int status)
45 {
46         ActionInterface::init(status);
47         trigger();
48 }