]> git.lyx.org Git - lyx.git/blob - src/frontends/qt2/QParagraphDialog.C
fix tooltips in toolbar
[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         valueAbove->setValidator(new QDoubleValidator(valueAbove));
35         valueBelow->setValidator(new QDoubleValidator(valueBelow));
36 }
37
38 void QParagraphDialog::closeEvent(QCloseEvent * e)
39 {
40         form_->slotWMHide();
41         e->accept();
42 }
43
44
45 void QParagraphDialog::change_adaptor()
46 {
47         form_->changed();
48 }
49
50 void QParagraphDialog::enableAbove(int)
51 {
52         bool const enable = spacingAbove->currentItem()==6;
53         valueAbove->setEnabled(enable);
54         unitAbove->setEnabled(enable);
55         
56 }
57
58 void QParagraphDialog::enableBelow(int)
59 {
60         bool const enable = spacingBelow->currentItem()==6;
61         valueBelow->setEnabled(enable);
62         unitBelow->setEnabled(enable);
63 }
64
65 void QParagraphDialog::enableLinespacingValue(int)
66 {
67         bool const enable = linespacing->currentItem()==4;
68         linespacingValue->setEnabled(enable);
69 }
70
71
72