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.
|
|
|
|
*
|
2007-10-05 21:06:08 +00:00
|
|
|
* \author Jürgen Vigna
|
|
|
|
* \author Angus Leeming
|
2006-03-05 17:24:44 +00:00
|
|
|
* \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-10-05 21:06:08 +00:00
|
|
|
#include "FuncRequest.h"
|
2006-03-05 17:24:44 +00:00
|
|
|
|
2008-03-26 23:41:35 +00:00
|
|
|
#include "support/gettext.h"
|
|
|
|
|
2007-04-24 13:47:33 +00:00
|
|
|
#include <QRadioButton>
|
|
|
|
#include <QPushButton>
|
2006-03-05 17:24:44 +00:00
|
|
|
|
2007-12-12 19:28:07 +00:00
|
|
|
using namespace std;
|
2006-03-05 17:24:44 +00:00
|
|
|
|
|
|
|
namespace lyx {
|
|
|
|
namespace frontend {
|
|
|
|
|
2007-11-23 09:44:02 +00:00
|
|
|
GuiERT::GuiERT(GuiView & lv)
|
2009-11-02 05:03:09 +00:00
|
|
|
: GuiDialog(lv, "ert", qt_("TeX Code Settings")), status_(InsetCollapsable::Collapsed)
|
2007-04-24 13:47:33 +00:00
|
|
|
{
|
|
|
|
setupUi(this);
|
2007-09-05 20:33:29 +00:00
|
|
|
|
|
|
|
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-10-05 21:06:08 +00:00
|
|
|
void GuiERT::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-10-05 21:06:08 +00:00
|
|
|
void GuiERT::applyView()
|
2006-03-05 17:24:44 +00:00
|
|
|
{
|
2007-09-05 20:33:29 +00:00
|
|
|
if (openRB->isChecked())
|
2009-11-02 05:03:09 +00:00
|
|
|
status_ = InsetCollapsable::Open;
|
2006-03-05 17:24:44 +00:00
|
|
|
else
|
2009-11-02 05:03:09 +00:00
|
|
|
status_ = InsetCollapsable::Collapsed;
|
2006-03-05 17:24:44 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
|
2007-10-05 21:06:08 +00:00
|
|
|
void GuiERT::updateContents()
|
2006-03-05 17:24:44 +00:00
|
|
|
{
|
2007-10-05 21:06:08 +00:00
|
|
|
switch (status_) {
|
2009-11-02 05:03:09 +00:00
|
|
|
case InsetCollapsable::Open: openRB->setChecked(true); break;
|
|
|
|
case InsetCollapsable::Collapsed: collapsedRB->setChecked(true); break;
|
2006-03-05 17:24:44 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2007-10-05 21:06:08 +00:00
|
|
|
|
2007-12-12 19:28:07 +00:00
|
|
|
bool GuiERT::initialiseParams(string const & data)
|
2007-10-05 21:06:08 +00:00
|
|
|
{
|
2008-03-27 23:37:59 +00:00
|
|
|
status_ = InsetERT::string2params(data);
|
2007-10-05 21:06:08 +00:00
|
|
|
return true;
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
void GuiERT::clearParams()
|
|
|
|
{
|
2009-11-02 05:03:09 +00:00
|
|
|
status_ = InsetCollapsable::Collapsed;
|
2007-10-05 21:06:08 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
void GuiERT::dispatchParams()
|
|
|
|
{
|
2008-03-26 23:41:35 +00:00
|
|
|
dispatch(FuncRequest(getLfun(), InsetERT::params2string(status_)));
|
2007-10-05 21:06:08 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
|
2007-11-23 09:44:02 +00:00
|
|
|
Dialog * createGuiERT(GuiView & lv) { return new GuiERT(lv); }
|
2007-10-05 21:06:08 +00:00
|
|
|
|
|
|
|
|
2006-03-05 17:24:44 +00:00
|
|
|
} // namespace frontend
|
|
|
|
} // namespace lyx
|
2007-04-24 13:47:33 +00:00
|
|
|
|
2008-11-14 14:28:50 +00:00
|
|
|
#include "moc_GuiERT.cpp"
|