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"
18 #include <QPushButton>
25 GuiBibitem::GuiBibitem(GuiView & lv)
26 : GuiCommand(lv, "bibitem", qt_("Bibliography Entry Settings"))
30 connect(okPB, SIGNAL(clicked()), this, SLOT(slotOK()));
31 connect(closePB, SIGNAL(clicked()), this, SLOT(slotClose()));
33 connect(keyED, SIGNAL(textChanged(QString)),
34 this, SLOT(change_adaptor()));
35 connect(labelED, SIGNAL(textChanged(QString)),
36 this, SLOT(change_adaptor()));
38 bc().setPolicy(ButtonPolicy::OkCancelReadOnlyPolicy);
40 bc().setCancel(closePB);
41 bc().addReadOnly(keyED);
42 bc().addReadOnly(labelED);
46 void GuiBibitem::change_adaptor()
52 void GuiBibitem::updateContents()
54 keyED->setText(toqstr(params_["key"]));
55 labelED->setText(toqstr(params_["label"]));
59 void GuiBibitem::applyView()
61 params_["key"] = qstring_to_ucs4(keyED->text());
62 params_["label"] = qstring_to_ucs4(labelED->text());
66 bool GuiBibitem::isValid()
68 return !keyED->text().isEmpty();
72 Dialog * createGuiBibitem(GuiView & lv) { return new GuiBibitem(lv); }
75 } // namespace frontend
78 #include "GuiBibitem_moc.cpp"