]> Shamusworld >> Repos - architektonas/blob - src/forms/lineoptions.cpp
Initial import
[architektonas] / src / forms / lineoptions.cpp
1 // lineoptions.cpp
2 //
3 // Originally part of QCad Community Edition by Andrew Mustun
4 // Extensively rewritten and refactored by James L. Hammons
5 // (C) 2010 Underground Software
6 //
7 // JLH = James L. Hammons <jlhamm@acm.org>
8 //
9 // Who  When        What
10 // ---  ----------  -----------------------------------------------------------
11 // JLH  05/10/2010  Created this file. :-)
12 //
13
14 #include "lineoptions.h"
15
16 #include "rs.h"
17 #include "rs_actiondrawline.h"
18 #include "rs_actioninterface.h"
19
20 LineOptions::LineOptions(QWidget * parent/*= 0*/, Qt::WindowFlags flags/*= 0*/):
21         QWidget(parent, flags), action(NULL)
22 {
23         ui.setupUi(this);
24 }
25
26 LineOptions::~LineOptions()
27 {
28 }
29
30 void LineOptions::setAction(RS_ActionInterface * a)
31 {
32         if (a != NULL && a->rtti() == RS2::ActionDrawLine)
33         {
34                 action = (RS_ActionDrawLine *)a;
35         }
36         else
37         {
38                 RS_DEBUG->print(RS_Debug::D_ERROR, "QG_LineOptions::setAction: wrong action type");
39                 action = NULL;
40         }
41 }
42
43 void LineOptions::close()
44 {
45         if (action != NULL)
46                 action->close();
47 }
48
49 void LineOptions::undo()
50 {
51         if (action != NULL)
52                 action->undo();
53 }