mirror of
https://git.lyx.org/repos/lyx.git
synced 2024-11-14 06:57:01 +00:00
470aba2a0e
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@20217 a592a061-630c-0410-9148-cb99ea01b6c8
83 lines
1.6 KiB
C++
83 lines
1.6 KiB
C++
/**
|
|
* \file GuiERT.cpp
|
|
* This file is part of LyX, the document processor.
|
|
* Licence details can be found in the file COPYING.
|
|
*
|
|
* \author John Levon
|
|
*
|
|
* Full author contact details are available in file CREDITS.
|
|
*/
|
|
|
|
#include <config.h>
|
|
|
|
#include "GuiERT.h"
|
|
#include "ControlERT.h"
|
|
#include "gettext.h"
|
|
|
|
#include <QRadioButton>
|
|
#include <QPushButton>
|
|
#include <QCloseEvent>
|
|
|
|
|
|
namespace lyx {
|
|
namespace frontend {
|
|
|
|
GuiERTDialog::GuiERTDialog(LyXView & lv)
|
|
: GuiDialog(lv, "ert")
|
|
{
|
|
setupUi(this);
|
|
setViewTitle(_("TeX Code Settings"));
|
|
setController(new ControlERT(*this));
|
|
|
|
connect(okPB, SIGNAL(clicked()), this, SLOT(slotOK()));
|
|
connect(closePB, SIGNAL(clicked()), this, SLOT(slotClose()));
|
|
connect(collapsedRB, SIGNAL(clicked()), this, SLOT(change_adaptor()));
|
|
connect(openRB, SIGNAL(clicked()), this, SLOT(change_adaptor()));
|
|
|
|
bc().setPolicy(ButtonPolicy::NoRepeatedApplyReadOnlyPolicy);
|
|
bc().setOK(okPB);
|
|
bc().setCancel(closePB);
|
|
}
|
|
|
|
|
|
ControlERT & GuiERTDialog::controller()
|
|
{
|
|
return static_cast<ControlERT &>(GuiDialog::controller());
|
|
}
|
|
|
|
|
|
void GuiERTDialog::closeEvent(QCloseEvent * e)
|
|
{
|
|
slotClose();
|
|
e->accept();
|
|
}
|
|
|
|
|
|
void GuiERTDialog::change_adaptor()
|
|
{
|
|
changed();
|
|
}
|
|
|
|
|
|
void GuiERTDialog::applyView()
|
|
{
|
|
if (openRB->isChecked())
|
|
controller().setStatus(Inset::Open);
|
|
else
|
|
controller().setStatus(Inset::Collapsed);
|
|
}
|
|
|
|
|
|
void GuiERTDialog::updateContents()
|
|
{
|
|
switch (controller().status()) {
|
|
case InsetERT::Open: openRB->setChecked(true); break;
|
|
case InsetERT::Collapsed: collapsedRB->setChecked(true); break;
|
|
}
|
|
}
|
|
|
|
} // namespace frontend
|
|
} // namespace lyx
|
|
|
|
#include "GuiERT_moc.cpp"
|