]> git.lyx.org Git - lyx.git/blob - src/frontends/qt2/QPreamble.C
Some string(widget->text()) fixes. Weirdness
[lyx.git] / src / frontends / qt2 / QPreamble.C
1 /**
2  * \file QPreamble.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 #ifdef __GNUG__
14 #pragma implementation
15 #endif
16
17 #include "gettext.h"
18 #include "LyXView.h"
19 #include "ControlPreamble.h"
20
21 #include "QPreamble.h"
22 #include "QPreambleDialog.h"
23 #include "Qt2BC.h"
24
25 #include <qmultilineedit.h>
26 #include <qpushbutton.h>
27
28 typedef Qt2CB<ControlPreamble, Qt2DB<QPreambleDialog> > base_class;
29
30
31 QPreamble::QPreamble()
32         : base_class(_("LaTeX Preamble"))
33 {
34 }
35
36
37 void QPreamble::build_dialog()
38 {
39         dialog_.reset(new QPreambleDialog(this));
40
41         bc().setOK(dialog_->okPB);
42         bc().setApply(dialog_->applyPB);
43         bc().setCancel(dialog_->closePB);
44 }
45
46
47 void QPreamble::update_contents()
48 {
49         dialog_->preambleLE->setText(controller().params().c_str());
50 }
51
52
53 void QPreamble::apply()
54 {
55         controller().params(dialog_->preambleLE->text().latin1());
56 }