]> git.lyx.org Git - lyx.git/blob - src/frontends/qt2/QParagraphDialog.C
Lots and lots of little trivial bits.
[lyx.git] / src / frontends / qt2 / QParagraphDialog.C
1 /**
2  * \file QParagraphDialog.C
3  * Copyright 2001 LyX Team
4  * This file is part of LyX, the document processor.
5  * Licence details can be found in the file COPYING.
6  *
7  * \author John Levon
8  * \author Edwin Leuven
9  *
10  * Full author contact details are available in file CREDITS
11  */
12
13 #include <config.h>
14
15 #ifdef __GNUG__
16 #pragma implementation
17 #endif
18
19 #include "QParagraphDialog.h"
20 #include "QParagraph.h"
21
22 #include <qlineedit.h>
23 #include <qcombobox.h>
24 #include <qpushbutton.h>
25 #include <qvalidator.h>
26
27 #include "helper_funcs.h"
28
29 using std::vector;
30
31 QParagraphDialog::QParagraphDialog(QParagraph * form)
32         : QParagraphDialogBase(0, 0, false, 0),
33         form_(form)
34 {
35         connect(okPB, SIGNAL(clicked()),
36                 form_, SLOT(slotOK()));
37         connect(applyPB, SIGNAL(clicked()),
38                 form_, SLOT(slotApply()));
39         connect(closePB, SIGNAL(clicked()),
40                 form_, SLOT(slotClose()));
41
42
43         linespacingValue->setValidator(new QDoubleValidator(linespacingValue));
44         // disabled to allow glue spacing for latexperts
45         //valueAbove->setValidator(new QDoubleValidator(valueAbove));
46         //valueBelow->setValidator(new QDoubleValidator(valueBelow));
47 }
48
49 void QParagraphDialog::closeEvent(QCloseEvent * e)
50 {
51         form_->slotWMHide();
52         e->accept();
53 }
54
55
56 void QParagraphDialog::change_adaptor()
57 {
58         form_->changed();
59 }
60
61 void QParagraphDialog::enableAbove(int)
62 {
63         bool const enable = spacingAbove->currentItem()==6;
64         valueAbove->setEnabled(enable);
65         unitAbove->setEnabled(enable);
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 void QParagraphDialog::enableLinespacingValue(int)
77 {
78         bool const enable = linespacing->currentItem()==4;
79         linespacingValue->setEnabled(enable);
80 }