#include "qt_helpers.h"
#include "FuncRequest.h"
-#include <QCloseEvent>
+#include "insets/InsetCommand.h"
+
#include <QLineEdit>
#include <QPushButton>
namespace frontend {
-GuiBibitem::GuiBibitem(LyXView & lv)
- : GuiCommand(lv, "bibitem")
+GuiBibitem::GuiBibitem(GuiView & lv)
+ : GuiDialog(lv, "bibitem", qt_("Bibliography Entry Settings")),
+ params_(insetCode("bibitem"))
{
setupUi(this);
- setViewTitle(_("Bibliography Entry Settings"));
connect(okPB, SIGNAL(clicked()), this, SLOT(slotOK()));
connect(closePB, SIGNAL(clicked()), this, SLOT(slotClose()));
}
-void GuiBibitem::closeEvent(QCloseEvent *e)
-{
- slotClose();
- e->accept();
-}
-
-
void GuiBibitem::updateContents()
{
keyED->setText(toqstr(params_["key"]));
}
-Dialog * createGuiBibitem(LyXView & lv) { return new GuiBibitem(lv); }
+bool GuiBibitem::initialiseParams(std::string const & data)
+{
+ // The name passed with LFUN_INSET_APPLY is also the name
+ // used to identify the mailer.
+ InsetCommand::string2params("bibitem", data, params_);
+ return true;
+}
+
+
+void GuiBibitem::dispatchParams()
+{
+ std::string const lfun = InsetCommand::params2string("bibitem", params_);
+ dispatch(FuncRequest(getLfun(), lfun));
+}
+
+
+Dialog * createGuiBibitem(GuiView & lv) { return new GuiBibitem(lv); }
} // namespace frontend