]> git.lyx.org Git - lyx.git/blob - src/frontends/qt2/QCharacterDialog.C
character dialog with auto-apply ...
[lyx.git] / src / frontends / qt2 / QCharacterDialog.C
1 /**
2  * \file QCharacterDialog.C
3  * Copyright 2001 the LyX Team
4  * See the file COPYING.
5  *
6  * \author Edwin Leuven, leuven@fee.uva.nl
7  */
8
9 #include "QCharacterDialog.h"
10
11 #include <qcombobox.h>
12 #include <qcheckbox.h>
13 #include <qpushbutton.h>
14 #include <qgroupbox.h>
15
16 QCharacterDialog::QCharacterDialog(QCharacter * form)
17         : QCharacterDialogBase(0, 0, false, 0), 
18         form_(form)
19 {
20         connect(okPB, SIGNAL(clicked()),
21                 form_, SLOT(slotOK()));
22         connect(applyPB, SIGNAL(clicked()),
23                 form_, SLOT(slotApply()));
24         connect(closePB, SIGNAL(clicked()),
25                 form_, SLOT(slotClose()));
26 }
27  
28
29 void QCharacterDialog::change_adaptor()
30 {
31         form_->changed();
32  
33         if (!autoapplyCB->isChecked())
34                 return;
35
36         // to be really good here, we should set the combos to the values of
37         // the current text, and make it appear as "no change" if the values
38         // stay the same between applys. Might be difficult though wrt to a
39         // moved cursor - jbl
40         form_->slotApply();
41         familyCO->setCurrentItem(0);
42         seriesCO->setCurrentItem(0);
43         sizeCO->setCurrentItem(0);
44         shapeCO->setCurrentItem(0);
45         miscCO->setCurrentItem(0);
46         langCO->setCurrentItem(0);
47         colorCO->setCurrentItem(0); 
48 }
49
50  
51 void QCharacterDialog::closeEvent(QCloseEvent * e)
52 {
53         form_->slotWMHide();
54         e->accept();
55 }