]> git.lyx.org Git - lyx.git/blob - src/frontends/qt2/QParagraphDialog.C
Copyright notices
[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 #ifdef __GNUG__
15 #pragma implementation
16 #endif
17
18 #include "QParagraphDialog.h"
19 #include "QParagraph.h"
20
21 #include <qlineedit.h>
22 #include <qcombobox.h>
23 #include <qpushbutton.h>
24 #include <qvalidator.h>
25
26 #include "helper_funcs.h"
27
28 using std::vector;
29
30 QParagraphDialog::QParagraphDialog(QParagraph * form)
31         : QParagraphDialogBase(0, 0, false, 0),
32         form_(form)
33 {
34         connect(okPB, SIGNAL(clicked()),
35                 form_, SLOT(slotOK()));
36         connect(applyPB, SIGNAL(clicked()),
37                 form_, SLOT(slotApply()));
38         connect(closePB, SIGNAL(clicked()),
39                 form_, SLOT(slotClose()));
40
41
42         linespacingValue->setValidator(new QDoubleValidator(linespacingValue));
43         // disabled to allow glue spacing for latexperts
44         //valueAbove->setValidator(new QDoubleValidator(valueAbove));
45         //valueBelow->setValidator(new QDoubleValidator(valueBelow));
46 }
47
48 void QParagraphDialog::closeEvent(QCloseEvent * e)
49 {
50         form_->slotWMHide();
51         e->accept();
52 }
53
54
55 void QParagraphDialog::change_adaptor()
56 {
57         form_->changed();
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 void QParagraphDialog::enableBelow(int)
69 {
70         bool const enable = spacingBelow->currentItem()==6;
71         valueBelow->setEnabled(enable);
72         unitBelow->setEnabled(enable);
73 }
74
75 void QParagraphDialog::enableLinespacingValue(int)
76 {
77         bool const enable = linespacing->currentItem()==4;
78         linespacingValue->setEnabled(enable);
79 }