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
|
|
|
|
2010-02-15 23:17:45 +00:00
|
|
|
#include "GuiApplication.h"
|
|
|
|
#include "GuiView.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 {
|
|
|
|
|
2010-02-15 23:17:45 +00:00
|
|
|
GuiERT::GuiERT(QWidget * parent) : InsetParamsWidget(parent)
|
2007-04-24 13:47:33 +00:00
|
|
|
{
|
|
|
|
setupUi(this);
|
2007-09-05 20:33:29 +00:00
|
|
|
|
2010-02-15 23:17:45 +00:00
|
|
|
connect(collapsedRB, SIGNAL(clicked()), this, SIGNAL(changed()));
|
|
|
|
connect(openRB, SIGNAL(clicked()), this, SIGNAL(changed()));
|
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-08 13:24:30 +00:00
|
|
|
InsetCollapsable::CollapseStatus const status = openRB->isChecked()
|
2010-02-07 21:41:39 +00:00
|
|
|
? 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);
|
2010-02-15 23:17:45 +00:00
|
|
|
// FIXME: This dialog has absolutely no value...
|
|
|
|
BufferView const * bv = guiApp->currentView()->currentBufferView();
|
|
|
|
InsetCollapsable::CollapseStatus status = ert->status(*bv);
|
2010-02-07 21:41:39 +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
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
} // namespace frontend
|
|
|
|
} // namespace lyx
|
2007-04-24 13:47:33 +00:00
|
|
|
|
2008-11-14 14:28:50 +00:00
|
|
|
#include "moc_GuiERT.cpp"
|