2006-03-05 17:24:44 +00:00
|
|
|
/**
|
2007-08-31 05:53:55 +00:00
|
|
|
* \file GuiERT.cpp
|
2006-03-05 17:24:44 +00:00
|
|
|
* 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>
|
|
|
|
|
2007-08-31 05:53:55 +00:00
|
|
|
#include "GuiERT.h"
|
2007-09-05 20:33:29 +00:00
|
|
|
#include "ControlERT.h"
|
2007-09-03 05:59:32 +00:00
|
|
|
#include "gettext.h"
|
2006-03-05 17:24:44 +00:00
|
|
|
|
2007-04-24 13:47:33 +00:00
|
|
|
#include <QRadioButton>
|
|
|
|
#include <QPushButton>
|
|
|
|
#include <QCloseEvent>
|
2006-03-05 17:24:44 +00:00
|
|
|
|
|
|
|
|
|
|
|
namespace lyx {
|
|
|
|
namespace frontend {
|
|
|
|
|
2007-09-05 20:33:29 +00:00
|
|
|
GuiERTDialog::GuiERTDialog(LyXView & lv)
|
|
|
|
: GuiDialog(lv, "ert")
|
2007-04-24 13:47:33 +00:00
|
|
|
{
|
|
|
|
setupUi(this);
|
2007-09-05 20:33:29 +00:00
|
|
|
setViewTitle(_("TeX Code Settings"));
|
|
|
|
setController(new ControlERT(*this));
|
|
|
|
|
|
|
|
connect(okPB, SIGNAL(clicked()), this, SLOT(slotOK()));
|
|
|
|
connect(closePB, SIGNAL(clicked()), this, SLOT(slotClose()));
|
2007-04-24 13:47:33 +00:00
|
|
|
connect(collapsedRB, SIGNAL(clicked()), this, SLOT(change_adaptor()));
|
|
|
|
connect(openRB, SIGNAL(clicked()), this, SLOT(change_adaptor()));
|
|
|
|
|
2007-09-05 20:33:29 +00:00
|
|
|
bc().setPolicy(ButtonPolicy::NoRepeatedApplyReadOnlyPolicy);
|
|
|
|
bc().setOK(okPB);
|
|
|
|
bc().setCancel(closePB);
|
2007-04-24 13:47:33 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
|
2007-09-05 20:33:29 +00:00
|
|
|
ControlERT & GuiERTDialog::controller() const
|
2007-04-24 13:47:33 +00:00
|
|
|
{
|
2007-09-10 22:32:59 +00:00
|
|
|
return static_cast<ControlERT &>(GuiDialog::controller());
|
2007-04-24 13:47:33 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
|
2007-09-05 20:33:29 +00:00
|
|
|
void GuiERTDialog::closeEvent(QCloseEvent * e)
|
2006-03-05 17:24:44 +00:00
|
|
|
{
|
2007-09-05 20:33:29 +00:00
|
|
|
slotWMHide();
|
|
|
|
e->accept();
|
2006-03-05 17:24:44 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
|
2007-09-05 20:33:29 +00:00
|
|
|
void GuiERTDialog::change_adaptor()
|
2006-03-05 17:24:44 +00:00
|
|
|
{
|
2007-09-05 20:33:29 +00:00
|
|
|
changed();
|
2006-03-05 17:24:44 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
|
2007-09-05 20:33:29 +00:00
|
|
|
void GuiERTDialog::applyView()
|
2006-03-05 17:24:44 +00:00
|
|
|
{
|
2007-09-05 20:33:29 +00:00
|
|
|
if (openRB->isChecked())
|
2007-08-16 16:36:50 +00:00
|
|
|
controller().setStatus(Inset::Open);
|
2006-03-05 17:24:44 +00:00
|
|
|
else
|
2007-08-16 16:36:50 +00:00
|
|
|
controller().setStatus(Inset::Collapsed);
|
2006-03-05 17:24:44 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
|
2007-09-05 20:33:29 +00:00
|
|
|
void GuiERTDialog::update_contents()
|
2006-03-05 17:24:44 +00:00
|
|
|
{
|
|
|
|
switch (controller().status()) {
|
2007-09-05 20:33:29 +00:00
|
|
|
case InsetERT::Open: openRB->setChecked(true); break;
|
|
|
|
case InsetERT::Collapsed: collapsedRB->setChecked(true); break;
|
2006-03-05 17:24:44 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
} // namespace frontend
|
|
|
|
} // namespace lyx
|
2007-04-24 13:47:33 +00:00
|
|
|
|
2007-08-31 05:53:55 +00:00
|
|
|
#include "GuiERT_moc.cpp"
|