]> git.lyx.org Git - lyx.git/blob - src/frontends/qt2/QBibitem.C
Minipage is no more (long live the box inset)
[lyx.git] / src / frontends / qt2 / QBibitem.C
1 /**
2  * \file QBibitem.C
3  * This file is part of LyX, the document processor.
4  * Licence details can be found in the file COPYING.
5  *
6  * \author John Levon
7  *
8  * Full author contact details are available in file CREDITS.
9  */
10
11 #include <config.h>
12
13
14
15 #include "debug.h"
16 #include "ControlCommand.h"
17 #include "qt_helpers.h"
18
19 #include <qlineedit.h>
20 #include <qpushbutton.h>
21
22 #include "QBibitemDialog.h"
23 #include "QBibitem.h"
24 #include "Qt2BC.h"
25
26 typedef QController<ControlCommand, QView<QBibitemDialog> > base_class;
27
28
29 QBibitem::QBibitem(Dialog & parent)
30         : base_class(parent, _("LyX: Bibliography Item Settings"))
31 {
32 }
33
34
35 void QBibitem::build_dialog()
36 {
37         dialog_.reset(new QBibitemDialog(this));
38
39         bcview().setOK(dialog_->okPB);
40         bcview().setCancel(dialog_->closePB);
41         bcview().addReadOnly(dialog_->keyED);
42         bcview().addReadOnly(dialog_->labelED);
43 }
44
45
46 void QBibitem::update_contents()
47 {
48         dialog_->keyED->setText(toqstr(controller().params().getContents()));
49         dialog_->labelED->setText(toqstr(controller().params().getOptions()));
50 }
51
52
53 void QBibitem::apply()
54 {
55         controller().params().setContents(fromqstr(dialog_->keyED->text()));
56         controller().params().setOptions(fromqstr(dialog_->labelED->text()));
57 }
58
59
60 bool QBibitem::isValid()
61 {
62         return !dialog_->keyED->text().isEmpty();
63 }