X-Git-Url: https://git.lyx.org/gitweb/?a=blobdiff_plain;f=src%2Ffrontends%2Fqt4%2FGuiBibitem.cpp;h=20285f8daa224d5ac73959a1a91843e4584c8932;hb=425d092204118ea6c24c28e85fdf03fcf2bb51a4;hp=6ae2b30c0760e7afdad936cde053ead819e0073f;hpb=4b510c9b7cdd69cb353afe5df626dea25d8cac2b;p=lyx.git diff --git a/src/frontends/qt4/GuiBibitem.cpp b/src/frontends/qt4/GuiBibitem.cpp index 6ae2b30c07..20285f8daa 100644 --- a/src/frontends/qt4/GuiBibitem.cpp +++ b/src/frontends/qt4/GuiBibitem.cpp @@ -14,7 +14,8 @@ #include "qt_helpers.h" #include "FuncRequest.h" -#include +#include "insets/InsetCommand.h" + #include #include @@ -23,11 +24,11 @@ namespace lyx { 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())); @@ -51,13 +52,6 @@ void GuiBibitem::change_adaptor() } -void GuiBibitem::closeEvent(QCloseEvent *e) -{ - slotClose(); - e->accept(); -} - - void GuiBibitem::updateContents() { keyED->setText(toqstr(params_["key"])); @@ -78,10 +72,26 @@ bool GuiBibitem::isValid() } -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 } // namespace lyx -#include "GuiBibitem_moc.cpp" +#include "moc_GuiBibitem.cpp"