]> git.lyx.org Git - lyx.git/blob - src/frontends/qt2/QParagraphDialog.C
Strip trailing whitespace.
[lyx.git] / src / frontends / qt2 / QParagraphDialog.C
1 /**
2  * \file QParagraphDialog.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  *
9  * Full author contact details are available in file CREDITS
10  */
11
12 #include <config.h>
13
14
15 #include "QParagraphDialog.h"
16 #include "QParagraph.h"
17
18 #include <qlineedit.h>
19 #include <qcombobox.h>
20 #include <qpushbutton.h>
21 #include <qvalidator.h>
22
23 #include "helper_funcs.h"
24
25 using std::vector;
26
27
28 QParagraphDialog::QParagraphDialog(QParagraph * form)
29         : QParagraphDialogBase(0, 0, false, 0),
30         form_(form)
31 {
32         connect(okPB, SIGNAL(clicked()),
33                 form_, SLOT(slotOK()));
34         connect(applyPB, SIGNAL(clicked()),
35                 form_, SLOT(slotApply()));
36         connect(closePB, SIGNAL(clicked()),
37                 form_, SLOT(slotClose()));
38
39
40         linespacingValue->setValidator(new QDoubleValidator(linespacingValue));
41         // disabled to allow glue spacing for latexperts
42         //valueAbove->setValidator(new QDoubleValidator(valueAbove));
43         //valueBelow->setValidator(new QDoubleValidator(valueBelow));
44 }
45
46
47 void QParagraphDialog::closeEvent(QCloseEvent * e)
48 {
49         form_->slotWMHide();
50         e->accept();
51 }
52
53
54 void QParagraphDialog::change_adaptor()
55 {
56         form_->changed();
57 }
58
59
60 void QParagraphDialog::enableAbove(int)
61 {
62         bool const enable = spacingAbove->currentItem()==6;
63         valueAbove->setEnabled(enable);
64         unitAbove->setEnabled(enable);
65
66 }
67
68
69 void QParagraphDialog::enableBelow(int)
70 {
71         bool const enable = spacingBelow->currentItem()==6;
72         valueBelow->setEnabled(enable);
73         unitBelow->setEnabled(enable);
74 }
75
76
77 void QParagraphDialog::enableLinespacingValue(int)
78 {
79         bool const enable = linespacing->currentItem()==4;
80         linespacingValue->setEnabled(enable);
81 }