3 * This file is part of LyX, the document processor.
4 * Licence details can be found in the file COPYING.
8 * Full author contact details are available in file CREDITS.
14 #include "ControlERT.h"
17 #include <QRadioButton>
18 #include <QPushButton>
19 #include <QCloseEvent>
25 GuiERTDialog::GuiERTDialog(LyXView & lv)
26 : GuiDialog(lv, "ert")
29 setViewTitle(_("TeX Code Settings"));
30 setController(new ControlERT(*this));
32 connect(okPB, SIGNAL(clicked()), this, SLOT(slotOK()));
33 connect(closePB, SIGNAL(clicked()), this, SLOT(slotClose()));
34 connect(collapsedRB, SIGNAL(clicked()), this, SLOT(change_adaptor()));
35 connect(openRB, SIGNAL(clicked()), this, SLOT(change_adaptor()));
37 bc().setPolicy(ButtonPolicy::NoRepeatedApplyReadOnlyPolicy);
39 bc().setCancel(closePB);
43 ControlERT & GuiERTDialog::controller() const
45 return static_cast<ControlERT &>(Dialog::controller());
49 void GuiERTDialog::closeEvent(QCloseEvent * e)
56 void GuiERTDialog::change_adaptor()
62 void GuiERTDialog::applyView()
64 if (openRB->isChecked())
65 controller().setStatus(Inset::Open);
67 controller().setStatus(Inset::Collapsed);
71 void GuiERTDialog::update_contents()
73 switch (controller().status()) {
74 case InsetERT::Open: openRB->setChecked(true); break;
75 case InsetERT::Collapsed: collapsedRB->setChecked(true); break;
79 } // namespace frontend
82 #include "GuiERT_moc.cpp"