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"
15 #include "qt_helpers.h"
17 #include "insets/InsetCommand.h"
20 #include <QPushButton>
27 GuiBibitem::GuiBibitem(QWidget * parent) : InsetParamsWidget(parent)
31 connect(keyED, SIGNAL(textChanged(QString)),
32 this, SIGNAL(changed()));
33 connect(labelED, SIGNAL(textChanged(QString)),
34 this, SIGNAL(changed()));
38 void GuiBibitem::paramsToDialog(Inset const * inset)
40 InsetCommand const * ic = static_cast<InsetCommand const *>(inset);
41 InsetCommandParams const & params = ic->params();
42 keyED->setText(toqstr(params["key"]));
43 labelED->setText(toqstr(params["label"]));
47 docstring GuiBibitem::dialogToParams() const
49 InsetCommandParams params(insetCode());
50 params["key"] = qstring_to_ucs4(keyED->text());
51 params["label"] = qstring_to_ucs4(labelED->text());
52 return from_utf8(InsetCommand::params2string(params));
56 bool GuiBibitem::checkWidgets() const
58 if (!InsetParamsWidget::checkWidgets())
60 return !keyED->text().isEmpty();
63 } // namespace frontend
66 #include "moc_GuiBibitem.cpp"