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