]> git.lyx.org Git - lyx.git/blob - src/frontends/qt2/QCharacterDialog.C
namespace grfx -> lyx::graphics
[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
14 #include "QCharacterDialog.h"
15
16 #include <qcombobox.h>
17 #include <qcheckbox.h>
18 #include <qpushbutton.h>
19 #include <qgroupbox.h>
20
21
22 QCharacterDialog::QCharacterDialog(QCharacter * form)
23         : QCharacterDialogBase(0, 0, false, 0),
24         form_(form)
25 {
26         connect(okPB, SIGNAL(clicked()),
27                 form_, SLOT(slotOK()));
28         connect(applyPB, SIGNAL(clicked()),
29                 form_, SLOT(slotApply()));
30         connect(closePB, SIGNAL(clicked()),
31                 form_, SLOT(slotClose()));
32 }
33
34
35 void QCharacterDialog::change_adaptor()
36 {
37         form_->changed();
38
39         if (!autoapplyCB->isChecked())
40                 return;
41
42         // to be really good here, we should set the combos to the values of
43         // the current text, and make it appear as "no change" if the values
44         // stay the same between applys. Might be difficult though wrt to a
45         // moved cursor - jbl
46         form_->slotApply();
47         familyCO->setCurrentItem(0);
48         seriesCO->setCurrentItem(0);
49         sizeCO->setCurrentItem(0);
50         shapeCO->setCurrentItem(0);
51         miscCO->setCurrentItem(0);
52         langCO->setCurrentItem(0);
53         colorCO->setCurrentItem(0);
54 }
55
56
57 void QCharacterDialog::closeEvent(QCloseEvent * e)
58 {
59         form_->slotWMHide();
60         e->accept();
61 }