* This file is part of LyX, the document processor.
* Licence details can be found in the file COPYING.
*
+ * \author Jürgen Vigna
+ * \author Angus Leeming
* \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 "FuncRequest.h"
+
+#include "support/gettext.h"
#include <QRadioButton>
#include <QPushButton>
-#include <QCloseEvent>
+using namespace std;
namespace lyx {
namespace frontend {
-GuiERTDialog::GuiERTDialog(LyXView & lv)
- : GuiDialog(lv, "ert")
+GuiERT::GuiERT(GuiView & lv)
+ : GuiDialog(lv, "ert", qt_("TeX Code Settings")), status_(InsetERT::Collapsed)
{
setupUi(this);
- setViewTitle(_("TeX Code Settings"));
- setController(new ControlERT(*this));
connect(okPB, SIGNAL(clicked()), this, SLOT(slotOK()));
connect(closePB, SIGNAL(clicked()), this, SLOT(slotClose()));
}
-ControlERT & GuiERTDialog::controller() const
+void GuiERT::change_adaptor()
{
- return static_cast<ControlERT &>(Dialog::controller());
+ changed();
}
-void GuiERTDialog::closeEvent(QCloseEvent * e)
+void GuiERT::applyView()
{
- slotWMHide();
- e->accept();
+ if (openRB->isChecked())
+ status_ = Inset::Open;
+ else
+ status_ = Inset::Collapsed;
}
-void GuiERTDialog::change_adaptor()
+void GuiERT::updateContents()
{
- changed();
+ switch (status_) {
+ case InsetERT::Open: openRB->setChecked(true); break;
+ case InsetERT::Collapsed: collapsedRB->setChecked(true); break;
+ }
}
-void GuiERTDialog::applyView()
+bool GuiERT::initialiseParams(string const & data)
{
- if (openRB->isChecked())
- controller().setStatus(Inset::Open);
- else
- controller().setStatus(Inset::Collapsed);
+ status_ = InsetERT::string2params(data);
+ return true;
}
-void GuiERTDialog::update_contents()
+void GuiERT::clearParams()
{
- switch (controller().status()) {
- case InsetERT::Open: openRB->setChecked(true); break;
- case InsetERT::Collapsed: collapsedRB->setChecked(true); break;
- }
+ status_ = InsetERT::Collapsed;
+}
+
+
+void GuiERT::dispatchParams()
+{
+ dispatch(FuncRequest(getLfun(), InsetERT::params2string(status_)));
}
+
+Dialog * createGuiERT(GuiView & lv) { return new GuiERT(lv); }
+
+
} // namespace frontend
} // namespace lyx