]> git.lyx.org Git - lyx.git/blob - src/frontends/qt2/QIndex.C
fix typo that put too many include paths for most people
[lyx.git] / src / frontends / qt2 / QIndex.C
1 /**
2  * \file QIndex.C
3  * Copyright 2001 the LyX Team
4  * Read the file COPYING
5  *
6  * \author John Levon <moz@compsoc.man.ac.uk>
7  */
8
9 #include <config.h>
10
11 #include "QIndexDialog.h"
12 #include "ControlIndex.h"
13 #include "QIndex.h"
14 #include "Qt2BC.h"
15 #include "gettext.h"
16
17 #include <qlineedit.h>
18 #include <qpushbutton.h>
19
20 typedef Qt2CB<ControlIndex, Qt2DB<QIndexDialog> > base_class;
21
22 QIndex::QIndex(ControlIndex & c)
23         : base_class(c, _("Index"))
24 {
25 }
26
27
28 void QIndex::build_dialog()
29 {
30         dialog_.reset(new QIndexDialog(this));
31
32         bc().setOK(dialog_->okPB);
33         bc().setCancel(dialog_->closePB);
34         bc().addReadOnly(dialog_->keywordED);
35 }
36
37
38 void QIndex::update_contents()
39 {
40         dialog_->keywordED->setText(controller().params().getContents().c_str());
41 }
42
43
44 void QIndex::apply()
45 {
46         controller().params().setContents(dialog_->keywordED->text().latin1());
47 }
48
49
50 bool QIndex::isValid()
51 {
52         return !string(dialog_->keywordED->text()).empty();
53 }