3 * This file is part of LyX, the document processor.
4 * Licence details can be found in the file COPYING.
8 * Full author contact details are available in file CREDITS.
13 #include "GuiBibitem.h"
14 #include "qt_helpers.h"
15 #include "FuncRequest.h"
17 #include <QCloseEvent>
19 #include <QPushButton>
26 GuiBibitem::GuiBibitem(GuiView & lv)
27 : GuiCommand(lv, "bibitem")
30 setViewTitle(_("Bibliography Entry Settings"));
32 connect(okPB, SIGNAL(clicked()), this, SLOT(slotOK()));
33 connect(closePB, SIGNAL(clicked()), this, SLOT(slotClose()));
35 connect(keyED, SIGNAL(textChanged(QString)),
36 this, SLOT(change_adaptor()));
37 connect(labelED, SIGNAL(textChanged(QString)),
38 this, SLOT(change_adaptor()));
40 bc().setPolicy(ButtonPolicy::OkCancelReadOnlyPolicy);
42 bc().setCancel(closePB);
43 bc().addReadOnly(keyED);
44 bc().addReadOnly(labelED);
48 void GuiBibitem::change_adaptor()
54 void GuiBibitem::closeEvent(QCloseEvent *e)
61 void GuiBibitem::updateContents()
63 keyED->setText(toqstr(params_["key"]));
64 labelED->setText(toqstr(params_["label"]));
68 void GuiBibitem::applyView()
70 params_["key"] = qstring_to_ucs4(keyED->text());
71 params_["label"] = qstring_to_ucs4(labelED->text());
75 bool GuiBibitem::isValid()
77 return !keyED->text().isEmpty();
81 Dialog * createGuiBibitem(GuiView & lv) { return new GuiBibitem(lv); }
84 } // namespace frontend
87 #include "GuiBibitem_moc.cpp"