]> git.lyx.org Git - lyx.git/blob - src/frontends/qt2/Qt2Base.C
Fix for qt2 citation dialog crash when selecting first key
[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 #undef emit
21
22 #include "Dialogs.h"
23 #include "Qt2Base.h"
24 #include "qt2BC.h"
25 #include "support/LAssert.h"
26
27 #include <stdio.h>
28
29
30 Qt2Base::Qt2Base(ControlButtons & c, QString const & t)
31         : ViewBC<qt2BC>(c), title_(t)
32 {}
33
34
35 void Qt2Base::show()
36 {
37         if (!form()) {
38                 build();
39         }
40
41         update();  // make sure its up-to-date
42
43         if (form()->isVisible()) {
44                 form()->raise();
45         } else {
46                 form()->setCaption( title_ );
47                 form()->show();
48         }
49 }
50
51
52 void Qt2Base::hide()
53 {
54         if (form() && form()->isVisible() )
55                 form()->hide();
56 }
57
58
59 // PENDING(kalle) Handle this with QValidator?
60 // void Qt2Base::InputCB(FL_OBJECT * ob, long data)
61 // {
62 //      bc().input(input(ob, data));
63 // }
64
65
66 ButtonPolicy::SMInput Qt2Base::input(QWidget*, long)
67 {
68         return ButtonPolicy::SMI_VALID;
69 }
70
71
72
73 void Qt2Base::slotWMHide()
74 {
75         CancelButton();
76 }
77
78
79
80 void Qt2Base::slotApply()
81 {
82         ApplyButton();
83 }
84
85
86 void Qt2Base::slotOK()
87 {
88         OKButton();
89 }
90
91
92 void Qt2Base::slotCancel()
93 {
94         CancelButton();
95 }
96
97
98 void Qt2Base::slotRestore()
99 {
100         RestoreButton();
101 }
102
103
104 // PENDING(kalle) How to handle this?
105 // extern "C" void C_Qt2BaseInputCB(FL_OBJECT * ob, long d)
106 // {
107 //      GetForm(ob)->InputCB(ob, d);
108 // }