]> git.lyx.org Git - lyx.git/blob - src/frontends/qt4/QERT.C
enable Font cache only for MacOSX and inline width() for other platform.
[lyx.git] / src / frontends / qt4 / QERT.C
1 /**
2  * \file QERT.C
3  * This file is part of LyX, the document processor.
4  * Licence details can be found in the file COPYING.
5  *
6  * \author John Levon
7  *
8  * Full author contact details are available in file CREDITS.
9  */
10
11 #include <config.h>
12
13 #include "QERT.h"
14 #include "QERTDialog.h"
15 #include "Qt2BC.h"
16
17 #include "controllers/ControlERT.h"
18
19 #include <qradiobutton.h>
20 #include <qpushbutton.h>
21
22
23 namespace lyx {
24 namespace frontend {
25
26 typedef QController<ControlERT, QView<QERTDialog> > base_class;
27
28
29 QERT::QERT(Dialog & parent)
30         : base_class(parent, lyx::to_utf8(_("TeX Code Settings")))
31 {
32 }
33
34
35 void QERT::build_dialog()
36 {
37         dialog_.reset(new QERTDialog(this));
38
39         bcview().setOK(dialog_->okPB);
40         bcview().setCancel(dialog_->closePB);
41 }
42
43
44 void QERT::apply()
45 {
46         if (dialog_->openRB->isChecked())
47                 controller().setStatus(InsetERT::Open);
48         else if (dialog_->inlineRB->isChecked())
49                 controller().setStatus(InsetERT::Inlined);
50         else
51                 controller().setStatus(InsetERT::Collapsed);
52 }
53
54
55 void QERT::update_contents()
56 {
57         QRadioButton * rb = 0;
58
59         switch (controller().status()) {
60                 case InsetERT::Open: rb = dialog_->openRB; break;
61                 case InsetERT::Inlined: rb = dialog_->inlineRB; break;
62                 case InsetERT::Collapsed: rb = dialog_->collapsedRB; break;
63         }
64
65         rb->setChecked(true);
66 }
67
68 } // namespace frontend
69 } // namespace lyx