]> git.lyx.org Git - lyx.git/blob - src/frontends/qt2/Qt2Base.C
fix typo that put too many include paths for most people
[lyx.git] / src / frontends / qt2 / Qt2Base.C
1 /* This file is part of
2  * ======================================================
3  *
4  *                 LyX, The Document Processor
5  *
6  *                 Copyright 2000 The LyX Team.
7  *
8  * ======================================================
9  *
10  * \author Angus Leeming <a.leeming@ic.ac.uk>
11  */
12
13 #include <config.h>
14
15 #ifdef __GNUG__
16 #pragma implementation
17 #endif
18
19 #include <qdialog.h>
20 #include <qapplication.h>
21
22 #include "debug.h"
23 #include "QtLyXView.h"
24 #include "Dialogs.h"
25 #include "Qt2Base.h"
26 #include "Qt2BC.h"
27 #include "support/LAssert.h"
28
29 Qt2Base::Qt2Base(ControlButtons & c, QString const & t)
30         : ViewBC<Qt2BC>(c), updating_(false), title_(t)
31 {}
32
33
34 void Qt2Base::show()
35 {
36         if (!form()) {
37                 build();
38         }
39
40         form()->setMinimumSize(form()->sizeHint());
41
42         update();  // make sure its up-to-date
43
44         if (form()->isVisible()) {
45                 form()->raise();
46         } else {
47                 form()->setCaption(title_);
48                 form()->show();
49         }
50 }
51
52
53 void Qt2Base::hide()
54 {
55         if (form() && form()->isVisible())
56                 form()->hide();
57 }
58
59
60 bool Qt2Base::isValid()
61 {
62         return true;
63 }
64
65
66 void Qt2Base::changed()
67 {
68         if (updating_)
69                 return;
70
71         if (isValid())
72                 bc().valid();
73         else
74                 bc().invalid();
75 }
76
77
78 void Qt2Base::slotWMHide()
79 {
80         CancelButton();
81 }
82
83
84 void Qt2Base::slotApply()
85 {
86         ApplyButton();
87 }
88
89
90 void Qt2Base::slotOK()
91 {
92         OKButton();
93 }
94
95
96 void Qt2Base::slotClose()
97 {
98         CancelButton();
99 }
100
101
102 void Qt2Base::slotRestore()
103 {
104         RestoreButton();
105 }