]> git.lyx.org Git - lyx.git/blob - src/frontends/qt2/QCharacterDialog.C
Some string(widget->text()) fixes. Weirdness
[lyx.git] / src / frontends / qt2 / QCharacterDialog.C
1 /**
2  * \file QCharacterDialog.C
3  * This file is part of LyX, the document processor.
4  * Licence details can be found in the file COPYING.
5  *
6  * \author Edwin Leuven
7  *
8  * Full author contact details are available in file CREDITS
9  */
10
11 #include <config.h>
12
13 #ifdef __GNUG__
14 #pragma implementation
15 #endif
16
17 #include "QCharacterDialog.h"
18
19 #include <qcombobox.h>
20 #include <qcheckbox.h>
21 #include <qpushbutton.h>
22 #include <qgroupbox.h>
23
24
25 QCharacterDialog::QCharacterDialog(QCharacter * form)
26         : QCharacterDialogBase(0, 0, false, 0),
27         form_(form)
28 {
29         connect(okPB, SIGNAL(clicked()),
30                 form_, SLOT(slotOK()));
31         connect(applyPB, SIGNAL(clicked()),
32                 form_, SLOT(slotApply()));
33         connect(closePB, SIGNAL(clicked()),
34                 form_, SLOT(slotClose()));
35 }
36
37
38 void QCharacterDialog::change_adaptor()
39 {
40         form_->changed();
41
42         if (!autoapplyCB->isChecked())
43                 return;
44
45         // to be really good here, we should set the combos to the values of
46         // the current text, and make it appear as "no change" if the values
47         // stay the same between applys. Might be difficult though wrt to a
48         // moved cursor - jbl
49         form_->slotApply();
50         familyCO->setCurrentItem(0);
51         seriesCO->setCurrentItem(0);
52         sizeCO->setCurrentItem(0);
53         shapeCO->setCurrentItem(0);
54         miscCO->setCurrentItem(0);
55         langCO->setCurrentItem(0);
56         colorCO->setCurrentItem(0);
57 }
58
59
60 void QCharacterDialog::closeEvent(QCloseEvent * e)
61 {
62         form_->slotWMHide();
63         e->accept();
64 }