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.
14 #include "QBibitemDialog.h"
16 #include "qt_helpers.h"
18 #include "controllers/ControlCommand.h"
20 #include <qlineedit.h>
21 #include <qpushbutton.h>
27 typedef QController<ControlCommand, QView<QBibitemDialog> > base_class;
30 QBibitem::QBibitem(Dialog & parent)
31 : base_class(parent, _("Bibliography Entry Settings"))
36 void QBibitem::build_dialog()
38 dialog_.reset(new QBibitemDialog(this));
40 bcview().setOK(dialog_->okPB);
41 bcview().setCancel(dialog_->closePB);
42 bcview().addReadOnly(dialog_->keyED);
43 bcview().addReadOnly(dialog_->labelED);
47 void QBibitem::update_contents()
49 dialog_->keyED->setText(toqstr(controller().params()["key"]));
50 dialog_->labelED->setText(toqstr(controller().params()["label"]));
54 void QBibitem::apply()
56 controller().params()["key"] = qstring_to_ucs4(dialog_->keyED->text());
57 controller().params()["label"] = qstring_to_ucs4(dialog_->labelED->text());
61 bool QBibitem::isValid()
63 return !dialog_->keyED->text().isEmpty();
66 } // namespace frontend