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 <QCloseEvent>
19 #include <QPushButton>
25 /////////////////////////////////////////////////////////////////////
29 /////////////////////////////////////////////////////////////////////
31 GuiBibitemDialog::GuiBibitemDialog(GuiBibitem * form)
35 connect(okPB, SIGNAL(clicked()), form, SLOT(slotOK()));
36 connect(closePB, SIGNAL(clicked()), form, SLOT(slotClose()));
38 connect(keyED, SIGNAL(textChanged(const QString &)),
39 this, SLOT(change_adaptor()));
40 connect(labelED, SIGNAL(textChanged(const QString &)),
41 this, SLOT(change_adaptor()));
45 void GuiBibitemDialog::change_adaptor()
51 void GuiBibitemDialog::closeEvent(QCloseEvent *e)
58 /////////////////////////////////////////////////////////////////////
62 /////////////////////////////////////////////////////////////////////
65 GuiBibitem::GuiBibitem(Dialog & parent)
66 : GuiView<GuiBibitemDialog>(parent, _("Bibliography Entry Settings"))
71 void GuiBibitem::build_dialog()
73 dialog_.reset(new GuiBibitemDialog(this));
75 bcview().setOK(dialog_->okPB);
76 bcview().setCancel(dialog_->closePB);
77 bcview().addReadOnly(dialog_->keyED);
78 bcview().addReadOnly(dialog_->labelED);
82 void GuiBibitem::update_contents()
84 dialog_->keyED->setText(toqstr(controller().params()["key"]));
85 dialog_->labelED->setText(toqstr(controller().params()["label"]));
89 void GuiBibitem::apply()
91 controller().params()["key"] = qstring_to_ucs4(dialog_->keyED->text());
92 controller().params()["label"] = qstring_to_ucs4(dialog_->labelED->text());
96 bool GuiBibitem::isValid()
98 return !dialog_->keyED->text().isEmpty();
101 } // namespace frontend
104 #include "GuiBibitem_moc.cpp"