]> git.lyx.org Git - lyx.git/blob - src/frontends/qt4/QVSpaceDialog.C
enable Font cache only for MacOSX and inline width() for other platform.
[lyx.git] / src / frontends / qt4 / 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 //Added by qt3to4:
18 #include <QCloseEvent>
19
20 #include "lengthcombo.h"
21 #include "validators.h"
22 #include "qt_helpers.h"
23
24 #include <QLineEdit>
25 #include <QPushButton>
26 #include <QValidator>
27
28
29 namespace lyx {
30 namespace frontend {
31
32
33 QVSpaceDialog::QVSpaceDialog(QVSpace * form)
34         : form_(form)
35 {
36         setupUi(this);
37
38         connect(okPB, SIGNAL(clicked()),
39                 form_, SLOT(slotOK()));
40         connect(applyPB, SIGNAL(clicked()),
41                 form_, SLOT(slotApply()));
42         connect(closePB, SIGNAL(clicked()),
43                 form_, SLOT(slotClose()));
44
45     connect( spacingCO, SIGNAL( highlighted(const QString&) ), this, SLOT( change_adaptor() ) );
46     connect( valueLE, SIGNAL( textChanged(const QString&) ), this, SLOT( change_adaptor() ) );
47     connect( spacingCO, SIGNAL( activated(int) ), this, SLOT( enableCustom(int) ) );
48     connect( keepCB, SIGNAL( clicked() ), this, SLOT( change_adaptor() ) );
49     connect( unitCO, SIGNAL( selectionChanged(LyXLength::UNIT) ), this, SLOT( change_adaptor() ) );
50
51         valueLE->setValidator(unsignedLengthValidator(valueLE));
52 }
53
54
55 void QVSpaceDialog::closeEvent(QCloseEvent * e)
56 {
57         form_->slotWMHide();
58         e->accept();
59 }
60
61
62 void QVSpaceDialog::change_adaptor()
63 {
64         form_->changed();
65 }
66
67
68 void QVSpaceDialog::enableCustom(int selection)
69 {
70         bool const enable = selection == 5;
71         valueLE->setEnabled(enable);
72         unitCO->setEnabled(enable);
73 }
74
75 } // namespace frontend
76 } // namespace lyx
77
78 #include "QVSpaceDialog_moc.cpp"