]> git.lyx.org Git - lyx.git/blob - src/frontends/qt2/QIndex.C
various fixes
[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 "QtLyXView.h" 
14 #include "BufferView.h"
15
16 #include "Dialogs.h"
17 #include "Qt2BC.h"
18 #include "QIndex.h"
19 #include "gettext.h"
20 #include "buffer.h"
21 #include "lyxfunc.h" 
22
23 #include <qlineedit.h>
24 #include <qpushbutton.h>
25
26 typedef Qt2CB<ControlIndex, Qt2DB<QIndexDialog> > base_class;
27  
28 QIndex::QIndex(ControlIndex & c)
29         : base_class(c, _("Index"))
30 {
31 }
32
33
34 void QIndex::build()
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 }