]> git.lyx.org Git - lyx.git/blob - src/frontends/qt4/QIndexDialog.C
Fix unreported bug related to 3246 by Richard Heck:
[lyx.git] / src / frontends / qt4 / QIndexDialog.C
1 /**
2  * \file QIndexDialog.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 #include "qt_helpers.h"
14
15 #include "QIndex.h"
16 #include "QIndexDialog.h"
17
18 #include <QPushButton>
19 #include <QLineEdit>
20 #include <QWhatsThis>
21 #include <QCloseEvent>
22
23 namespace lyx {
24 namespace frontend {
25
26 QIndexDialog::QIndexDialog(QIndex * form)
27         : form_(form)
28 {
29         setupUi(this);
30
31         connect(okPB, SIGNAL(clicked()),
32                 form, SLOT(slotOK()));
33         connect(closePB, SIGNAL(clicked()),
34                 form, SLOT(slotClose()));
35         connect( keywordED, SIGNAL( textChanged(const QString&) ), 
36                 this, SLOT( change_adaptor() ) );
37
38         setFocusProxy(keywordED);
39
40         keywordED->setWhatsThis( qt_(
41                 "The format of the entry in the index.\n"
42                 "\n"
43                 "An entry can be specified as a sub-entry of\n"
44                 "another with \"!\":\n"
45                 "\n"
46                 "cars!mileage\n"
47                 "\n"
48                 "You can cross-refer to another entry like so:\n"
49                 "\n"
50                 "cars!mileage|see{economy}\n"
51                 "\n"
52                 "For further details refer to the local LaTeX\n"
53                 "documentation.\n")
54         );
55 }
56
57
58 void QIndexDialog::change_adaptor()
59 {
60         form_->changed();
61 }
62
63
64 void QIndexDialog::reject()
65 {
66         form_->slotClose();
67 }
68
69
70 void QIndexDialog::closeEvent(QCloseEvent * e)
71 {
72         form_->slotWMHide();
73         e->accept();
74 }
75
76 } // namespace frontend
77 } // namespace lyx
78
79 #include "QIndexDialog_moc.cpp"