]> git.lyx.org Git - lyx.git/blob - src/frontends/qt4/QIndexDialog.C
This new citation dialog follows a new design similar to lyx-1.3:
[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.h>
19 #include <qlineedit.h>
20 #include <q3whatsthis.h>
21 //Added by qt3to4:
22 #include <QCloseEvent>
23
24 namespace lyx {
25 namespace frontend {
26
27 QIndexDialog::QIndexDialog(QIndex * form)
28         : form_(form)
29 {
30         setupUi(this);
31
32         connect(okPB, SIGNAL(clicked()),
33                 form, SLOT(slotOK()));
34         connect(closePB, SIGNAL(clicked()),
35                 form, SLOT(slotClose()));
36
37     connect( keywordED, SIGNAL( textChanged(const QString&) ), this, SLOT( change_adaptor() ) );
38
39         Q3WhatsThis::add(keywordED, qt_(
40 "The format of the entry in the index.\n"
41 "\n"
42 "An entry can be specified as a sub-entry of\n"
43 "another with \"!\":\n"
44 "\n"
45 "cars!mileage\n"
46 "\n"
47 "You can cross-refer to another entry like so:\n"
48 "\n"
49 "cars!mileage|see{economy}\n"
50 "\n"
51 "For further details refer to the local LaTeX\n"
52 "documentation.\n"));
53 }
54
55
56 void QIndexDialog::show()
57 {
58         QDialog::show();
59         keywordED->setFocus();
60 }
61
62
63 void QIndexDialog::change_adaptor()
64 {
65         form_->changed();
66 }
67
68
69 void QIndexDialog::reject()
70 {
71         form_->slotClose();
72 }
73
74
75 void QIndexDialog::closeEvent(QCloseEvent * e)
76 {
77         form_->slotWMHide();
78         e->accept();
79 }
80
81 } // namespace frontend
82 } // namespace lyx