]> git.lyx.org Git - lyx.git/blob - src/frontends/qt2/QParagraphDialog.C
Martin's changes to the Note inset.
[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 #include <qwhatsthis.h>
23
24 #include "qt_helpers.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
45         QWhatsThis::add(labelWidth, qt_(
46 "As described in the User Guide, the length of"
47 " this text will determine how wide the label part"
48 " of each item is in environments like List and"
49 " Description.\n"
50 "\n"
51 " Normally you won't need to set this,"
52 " since the largest label width of all the"
53 " items is used. But if you need to, you can"
54 " change it here."
55         ));
56 }
57
58
59 void QParagraphDialog::closeEvent(QCloseEvent * e)
60 {
61         form_->slotWMHide();
62         e->accept();
63 }
64
65
66 void QParagraphDialog::change_adaptor()
67 {
68         form_->changed();
69 }
70
71
72 void QParagraphDialog::enableAbove(int)
73 {
74         bool const enable = spacingAbove->currentItem()==6;
75         valueAbove->setEnabled(enable);
76         unitAbove->setEnabled(enable);
77
78 }
79
80
81 void QParagraphDialog::enableBelow(int)
82 {
83         bool const enable = spacingBelow->currentItem()==6;
84         valueBelow->setEnabled(enable);
85         unitBelow->setEnabled(enable);
86 }
87
88
89 void QParagraphDialog::enableLinespacingValue(int)
90 {
91         bool const enable = linespacing->currentItem()==4;
92         linespacingValue->setEnabled(enable);
93 }