]> git.lyx.org Git - lyx.git/blob - src/frontends/qt2/QIndex.C
Lots and lots of little trivial bits.
[lyx.git] / src / frontends / qt2 / QIndex.C
1 /**
2  * \file QIndex.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 "ControlIndex.h"
18 #include "gettext.h"
19
20 #include "QIndexDialog.h"
21 #include "QIndex.h"
22 #include "Qt2BC.h"
23 #include <qlineedit.h>
24 #include <qpushbutton.h>
25
26 typedef Qt2CB<ControlIndex, Qt2DB<QIndexDialog> > base_class;
27
28 QIndex::QIndex()
29         : base_class(_("Index"))
30 {
31 }
32
33
34 void QIndex::build_dialog()
35 {
36         dialog_.reset(new QIndexDialog(this));
37
38         bc().setOK(dialog_->okPB);
39         bc().setCancel(dialog_->closePB);
40         bc().addReadOnly(dialog_->keywordED);
41 }
42
43
44 void QIndex::update_contents()
45 {
46         dialog_->keywordED->setText(controller().params().getContents().c_str());
47 }
48
49
50 void QIndex::apply()
51 {
52         controller().params().setContents(dialog_->keywordED->text().latin1());
53 }
54
55
56 bool QIndex::isValid()
57 {
58         return !string(dialog_->keywordED->text()).empty();
59 }