]> Shamusworld >> Repos - architektonas/blob - src/actions/rs_actionselectall.cpp
912dce514d3b7cbdd06c8ed22a1031d76630586a
[architektonas] / src / actions / rs_actionselectall.cpp
1 // rs_actionselectall.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/22/2010  Added this text. :-)
13 //
14
15 #include "rs_actionselectall.h"
16
17 #include "rs_dialogfactory.h"
18 #include "rs_selection.h"
19
20 RS_ActionSelectAll::RS_ActionSelectAll(RS_EntityContainer & container,
21         GraphicView & graphicView, bool select):
22         RS_ActionInterface("Select All Entities", container, graphicView)
23 {
24         this->select = select;
25 }
26
27 RS_ActionSelectAll::~RS_ActionSelectAll()
28 {
29 }
30
31 /*virtual*/ RS2::ActionType RS_ActionSelectAll::rtti()
32 {
33         return RS2::ActionSelectAll;
34 }
35
36 void RS_ActionSelectAll::init(int status)
37 {
38         RS_ActionInterface::init(status);
39         trigger();
40         finish();
41 }
42
43 void RS_ActionSelectAll::trigger()
44 {
45         RS_Selection s(*container, graphicView);
46         s.selectAll(select);
47
48         RS_DIALOGFACTORY->updateSelectionWidget(container->countSelected());
49 }