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"
|
2010-02-07 21:41:39 +00:00
|
|
|
|
|
|
|
#include "insets/InsetERT.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)
|
2010-02-07 21:41:39 +00:00
|
|
|
: InsetDialog(lv, ERT_CODE, LFUN_INSET_INSERT, "ert", "TeX Code Settings")
|
2007-04-24 13:47:33 +00:00
|
|
|
{
|
|
|
|
setupUi(this);
|
2007-09-05 20:33:29 +00:00
|
|
|
|
2010-02-07 21:41:39 +00:00
|
|
|
connect(collapsedRB, SIGNAL(clicked()), this, SLOT(applyView()));
|
|
|
|
connect(openRB, SIGNAL(clicked()), this, SLOT(applyView()));
|
2007-04-24 13:47:33 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
|
2010-02-07 21:41:39 +00:00
|
|
|
void GuiERT::enableView(bool enable)
|
2006-03-05 17:24:44 +00:00
|
|
|
{
|
2010-02-07 21:41:39 +00:00
|
|
|
collapsedRB->setEnabled(enable);
|
|
|
|
openRB->setEnabled(enable);
|
2006-03-05 17:24:44 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
|
2010-02-07 21:41:39 +00:00
|
|
|
docstring GuiERT::dialogToParams() const
|
2006-03-05 17:24:44 +00:00
|
|
|
{
|
2010-02-07 21:41:39 +00:00
|
|
|
InsetCollapsable::CollapseStatus status = openRB->isChecked()
|
|
|
|
? InsetCollapsable::Open : InsetCollapsable::Collapsed;
|
|
|
|
return from_ascii(InsetERT::params2string(status));
|
2006-03-05 17:24:44 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
|
2010-02-07 21:41:39 +00:00
|
|
|
void GuiERT::paramsToDialog(Inset const * inset)
|
2006-03-05 17:24:44 +00:00
|
|
|
{
|
2010-02-07 21:41:39 +00:00
|
|
|
InsetERT const * ert = static_cast<InsetERT const *>(inset);
|
|
|
|
InsetCollapsable::CollapseStatus status = ert->status(*bufferview());
|
|
|
|
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-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"
|