]> git.lyx.org Git - lyx.git/blob - src/frontends/qt2/QBibitem.C
dont use pragma impementation and interface anymore
[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 #include "support/lstrings.h"
15
16 #include "ControlBibitem.h"
17 #include "qt_helpers.h"
18 #include "debug.h"
19
20 #include <qlineedit.h>
21 #include <qpushbutton.h>
22
23 #include "QBibitemDialog.h"
24 #include "QBibitem.h"
25 #include "Qt2BC.h"
26
27 typedef Qt2CB<ControlBibitem, Qt2DB<QBibitemDialog> > base_class;
28
29
30 QBibitem::QBibitem()
31         : base_class(qt_("Bibliography Item"))
32 {
33 }
34
35
36 void QBibitem::build_dialog()
37 {
38         dialog_.reset(new QBibitemDialog(this));
39
40         bc().setOK(dialog_->okPB);
41         bc().setCancel(dialog_->closePB);
42         bc().addReadOnly(dialog_->keyED);
43         bc().addReadOnly(dialog_->labelED);
44 }
45
46
47 void QBibitem::update_contents()
48 {
49         dialog_->keyED->setText(toqstr(controller().params().getContents()));
50         dialog_->labelED->setText(toqstr(controller().params().getOptions()));
51 }
52
53
54 void QBibitem::apply()
55 {
56         controller().params().setContents(fromqstr(dialog_->keyED->text()));
57         controller().params().setOptions(fromqstr(dialog_->labelED->text()));
58 }
59
60
61 bool QBibitem::isValid()
62 {
63         return !dialog_->keyED->text().isEmpty();
64 }