]> git.lyx.org Git - features.git/blob - src/frontends/qt3/QVSpaceDialog.C
* Rename src/frontends/qt2 to src/frontends/qt3,
[features.git] / src / frontends / qt3 / QVSpaceDialog.C
1 /**
2  * \file QVSpaceDialog.C
3  * This file is part of LyX, the document processor.
4  * Licence details can be found in the file COPYING.
5  *
6  * \author John Levon
7  * \author Edwin Leuven
8  * \author Jürgen Spitzmüller
9  *
10  * Full author contact details are available in file CREDITS.
11  */
12
13 #include <config.h>
14
15 #include "QVSpaceDialog.h"
16 #include "QVSpace.h"
17
18 #include "lengthcombo.h"
19 #include "validators.h"
20 #include "qt_helpers.h"
21
22 #include <qcombobox.h>
23 #include <qlineedit.h>
24 #include <qpushbutton.h>
25 #include <qvalidator.h>
26
27
28 namespace lyx {
29 namespace frontend {
30
31
32 QVSpaceDialog::QVSpaceDialog(QVSpace * form)
33         : QVSpaceDialogBase(0, 0, false, 0),
34         form_(form)
35 {
36         connect(okPB, SIGNAL(clicked()),
37                 form_, SLOT(slotOK()));
38         connect(applyPB, SIGNAL(clicked()),
39                 form_, SLOT(slotApply()));
40         connect(closePB, SIGNAL(clicked()),
41                 form_, SLOT(slotClose()));
42
43         valueLE->setValidator(unsignedLengthValidator(valueLE));
44 }
45
46
47 void QVSpaceDialog::closeEvent(QCloseEvent * e)
48 {
49         form_->slotWMHide();
50         e->accept();
51 }
52
53
54 void QVSpaceDialog::change_adaptor()
55 {
56         form_->changed();
57 }
58
59
60 void QVSpaceDialog::enableCustom(int)
61 {
62         bool const enable = spacingCO->currentItem() == 5;
63         valueLE->setEnabled(enable);
64         unitCO->setEnabled(enable);
65 }
66
67 } // namespace frontend
68 } // namespace lyx