]> git.lyx.org Git - lyx.git/blob - src/frontends/qt2/QParagraphDialog.C
Some string(widget->text()) fixes. Weirdness
[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
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
50 void QParagraphDialog::closeEvent(QCloseEvent * e)
51 {
52         form_->slotWMHide();
53         e->accept();
54 }
55
56
57 void QParagraphDialog::change_adaptor()
58 {
59         form_->changed();
60 }
61
62
63 void QParagraphDialog::enableAbove(int)
64 {
65         bool const enable = spacingAbove->currentItem()==6;
66         valueAbove->setEnabled(enable);
67         unitAbove->setEnabled(enable);
68
69 }
70
71
72 void QParagraphDialog::enableBelow(int)
73 {
74         bool const enable = spacingBelow->currentItem()==6;
75         valueBelow->setEnabled(enable);
76         unitBelow->setEnabled(enable);
77 }
78
79
80 void QParagraphDialog::enableLinespacingValue(int)
81 {
82         bool const enable = linespacing->currentItem()==4;
83         linespacingValue->setEnabled(enable);
84 }