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", qt_("Bibliography Entry Settings"))
31 connect(okPB, SIGNAL(clicked()), this, SLOT(slotOK()));
32 connect(closePB, SIGNAL(clicked()), this, SLOT(slotClose()));
34 connect(keyED, SIGNAL(textChanged(QString)),
35 this, SLOT(change_adaptor()));
36 connect(labelED, SIGNAL(textChanged(QString)),
37 this, SLOT(change_adaptor()));
39 bc().setPolicy(ButtonPolicy::OkCancelReadOnlyPolicy);
41 bc().setCancel(closePB);
42 bc().addReadOnly(keyED);
43 bc().addReadOnly(labelED);
47 void GuiBibitem::change_adaptor()
53 void GuiBibitem::closeEvent(QCloseEvent *e)
60 void GuiBibitem::updateContents()
62 keyED->setText(toqstr(params_["key"]));
63 labelED->setText(toqstr(params_["label"]));
67 void GuiBibitem::applyView()
69 params_["key"] = qstring_to_ucs4(keyED->text());
70 params_["label"] = qstring_to_ucs4(labelED->text());
74 bool GuiBibitem::isValid()
76 return !keyED->text().isEmpty();
80 Dialog * createGuiBibitem(GuiView & lv) { return new GuiBibitem(lv); }
83 } // namespace frontend
86 #include "GuiBibitem_moc.cpp"