]> git.lyx.org Git - lyx.git/blob - src/frontends/qt2/QParagraphDialog.C
small fixes
[lyx.git] / src / frontends / qt2 / QParagraphDialog.C
1 /**
2  * \file QParagraphDialog.C
3  * Copyright 2001 LyX Team
4  * see the file COPYING
5  *
6  * \author John Levon, moz@compsoc.man.ac.uk
7  * \author Edwin Leuven, leuven@fee.uva.nl
8  */
9
10 #include "QParagraphDialog.h"
11
12 #include <qlineedit.h>
13 #include <qcombobox.h>
14 #include <qpushbutton.h>
15 #include <qvalidator.h>
16
17 #include "helper_funcs.h"
18
19 using std::vector;
20
21 QParagraphDialog::QParagraphDialog(QParagraph * form)
22         : QParagraphDialogBase(0, 0, false, 0),
23         form_(form)
24 {
25         connect(okPB, SIGNAL(clicked()),
26                 form_, SLOT(slotOK()));
27         connect(applyPB, SIGNAL(clicked()),
28                 form_, SLOT(slotApply()));
29         connect(closePB, SIGNAL(clicked()),
30                 form_, SLOT(slotClose()));
31         
32
33         linespacingValue->setValidator(new QDoubleValidator(linespacingValue));
34         // disabled to allow glue spacing for latexperts 
35         //valueAbove->setValidator(new QDoubleValidator(valueAbove));
36         //valueBelow->setValidator(new QDoubleValidator(valueBelow));
37 }
38
39 void QParagraphDialog::closeEvent(QCloseEvent * e)
40 {
41         form_->slotWMHide();
42         e->accept();
43 }
44
45
46 void QParagraphDialog::change_adaptor()
47 {
48         form_->changed();
49 }
50
51 void QParagraphDialog::enableAbove(int)
52 {
53         bool const enable = spacingAbove->currentItem()==6;
54         valueAbove->setEnabled(enable);
55         unitAbove->setEnabled(enable);
56         
57 }
58
59 void QParagraphDialog::enableBelow(int)
60 {
61         bool const enable = spacingBelow->currentItem()==6;
62         valueBelow->setEnabled(enable);
63         unitBelow->setEnabled(enable);
64 }
65
66 void QParagraphDialog::enableLinespacingValue(int)
67 {
68         bool const enable = linespacing->currentItem()==4;
69         linespacingValue->setEnabled(enable);
70 }