]> git.lyx.org Git - lyx.git/blobdiff - src/frontends/qt4/GuiBibitem.cpp
Complete the removal of the embedding stuff. Maybe. It's hard to be sure we got every...
[lyx.git] / src / frontends / qt4 / GuiBibitem.cpp
index 8adff5841522257e289511a0a5a6ede23c0a094e..0e13e49426f1499307ca02d8e2c4d202a84ed1bb 100644 (file)
 #include <config.h>
 
 #include "GuiBibitem.h"
-#include "ControlCommand.h"
 #include "qt_helpers.h"
+#include "FuncRequest.h"
 
-#include <QCloseEvent>
 #include <QLineEdit>
 #include <QPushButton>
 
@@ -23,19 +22,17 @@ namespace lyx {
 namespace frontend {
 
 
-GuiBibitemDialog::GuiBibitemDialog(LyXView & lv)
-       : GuiDialog(lv, "bibitem")
+GuiBibitem::GuiBibitem(GuiView & lv)
+       : GuiCommand(lv, "bibitem", qt_("Bibliography Entry Settings"))
 {
        setupUi(this);
-       setViewTitle(_("Bibliography Entry Settings"));
-       setController(new ControlCommand(*this, "bibitem", "bibitem"));
 
        connect(okPB, SIGNAL(clicked()), this, SLOT(slotOK()));
        connect(closePB, SIGNAL(clicked()), this, SLOT(slotClose()));
 
-       connect(keyED, SIGNAL(textChanged(const QString &)),
+       connect(keyED, SIGNAL(textChanged(QString)),
                this, SLOT(change_adaptor()));
-       connect(labelED, SIGNAL(textChanged(const QString &)),
+       connect(labelED, SIGNAL(textChanged(QString)),
                this, SLOT(change_adaptor()));
 
        bc().setPolicy(ButtonPolicy::OkCancelReadOnlyPolicy);
@@ -46,43 +43,34 @@ GuiBibitemDialog::GuiBibitemDialog(LyXView & lv)
 }
 
 
-ControlCommand & GuiBibitemDialog::controller() const
-{
-       return static_cast<ControlCommand &>(Dialog::controller());
-}
-
-
-void GuiBibitemDialog::change_adaptor()
+void GuiBibitem::change_adaptor()
 {
        changed();
 }
 
 
-void GuiBibitemDialog::closeEvent(QCloseEvent *e)
+void GuiBibitem::updateContents()
 {
-       slotWMHide();
-       e->accept();
+       keyED->setText(toqstr(params_["key"]));
+       labelED->setText(toqstr(params_["label"]));
 }
 
 
-void GuiBibitemDialog::update_contents()
+void GuiBibitem::applyView()
 {
-       keyED->setText(toqstr(controller().params()["key"]));
-       labelED->setText(toqstr(controller().params()["label"]));
+       params_["key"] = qstring_to_ucs4(keyED->text());
+       params_["label"] = qstring_to_ucs4(labelED->text());
 }
 
 
-void GuiBibitemDialog::applyView()
+bool GuiBibitem::isValid()
 {
-       controller().params()["key"] = qstring_to_ucs4(keyED->text());
-       controller().params()["label"] = qstring_to_ucs4(labelED->text());
+       return !keyED->text().isEmpty();
 }
 
 
-bool GuiBibitemDialog::isValid()
-{
-       return !keyED->text().isEmpty();
-}
+Dialog * createGuiBibitem(GuiView & lv) { return new GuiBibitem(lv); }
+
 
 } // namespace frontend
 } // namespace lyx