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"
16 #include <QCloseEvent>
18 #include <QPushButton>
24 /////////////////////////////////////////////////////////////////////
28 /////////////////////////////////////////////////////////////////////
30 GuiBibitemDialog::GuiBibitemDialog(GuiBibitem * form)
34 connect(okPB, SIGNAL(clicked()), form, SLOT(slotOK()));
35 connect(closePB, SIGNAL(clicked()), form, SLOT(slotClose()));
37 connect(keyED, SIGNAL(textChanged(const QString &)),
38 this, SLOT(change_adaptor()));
39 connect(labelED, SIGNAL(textChanged(const QString &)),
40 this, SLOT(change_adaptor()));
44 void GuiBibitemDialog::change_adaptor()
50 void GuiBibitemDialog::closeEvent(QCloseEvent *e)
57 /////////////////////////////////////////////////////////////////////
61 /////////////////////////////////////////////////////////////////////
64 GuiBibitem::GuiBibitem(GuiDialog & parent)
65 : GuiView<GuiBibitemDialog>(parent, _("Bibliography Entry Settings"))
70 void GuiBibitem::build_dialog()
72 dialog_.reset(new GuiBibitemDialog(this));
74 bc().setOK(dialog_->okPB);
75 bc().setCancel(dialog_->closePB);
76 bc().addReadOnly(dialog_->keyED);
77 bc().addReadOnly(dialog_->labelED);
81 void GuiBibitem::update_contents()
83 dialog_->keyED->setText(toqstr(controller().params()["key"]));
84 dialog_->labelED->setText(toqstr(controller().params()["label"]));
88 void GuiBibitem::applyView()
90 controller().params()["key"] = qstring_to_ucs4(dialog_->keyED->text());
91 controller().params()["label"] = qstring_to_ucs4(dialog_->labelED->text());
95 bool GuiBibitem::isValid()
97 return !dialog_->keyED->text().isEmpty();
100 } // namespace frontend
103 #include "GuiBibitem_moc.cpp"