]> git.lyx.org Git - lyx.git/blob - src/frontends/qt2/QParagraphDialog.C
some tabular fixes for the problems reported by Helge
[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 #include "QParagraphDialog.h"
15 #include "QParagraph.h"
16
17 #include <qcombobox.h>
18 #include <qlineedit.h>
19 #include <qpushbutton.h>
20 #include <qvalidator.h>
21 #include <qwhatsthis.h>
22
23 #include "qt_helpers.h"
24
25 namespace lyx {
26 namespace frontend {
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
42         QWhatsThis::add(labelWidth, qt_(
43 "As described in the User Guide, the length of"
44 " this text will determine how wide the label part"
45 " of each item is in environments like List and"
46 " Description.\n"
47 "\n"
48 " Normally you won't need to set this,"
49 " since the largest label width of all the"
50 " items is used. But if you need to, you can"
51 " change it here."
52         ));
53 }
54
55
56 void QParagraphDialog::closeEvent(QCloseEvent * e)
57 {
58         form_->slotWMHide();
59         e->accept();
60 }
61
62
63 void QParagraphDialog::change_adaptor()
64 {
65         form_->changed();
66 }
67
68
69 void QParagraphDialog::enableLinespacingValue(int)
70 {
71         bool const enable = linespacing->currentItem() == 4;
72         linespacingValue->setEnabled(enable);
73 }
74
75 } // namespace frontend
76 } // namespace lyx