#include <config.h>
#include "GuiBibitem.h"
-#include "ControlCommand.h"
#include "qt_helpers.h"
+#include "FuncRequest.h"
-#include <QCloseEvent>
#include <QLineEdit>
#include <QPushButton>
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);
}
-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