]> git.lyx.org Git - lyx.git/blob - src/frontends/qt2/QRefDialog.C
reverse last change
[lyx.git] / src / frontends / qt2 / QRefDialog.C
1 /**
2  * \file QRefDialog.C
3  * This file is part of LyX, the document processor.
4  * Licence details can be found in the file COPYING.
5  *
6  * \author Kalle Dalheimer
7  * \author John Levon
8  *
9  * Full author contact details are available in file CREDITS
10  */
11
12 #include <config.h>
13
14 #ifdef __GNUG__
15 #pragma implementation
16 #endif
17
18 #include "ControlRef.h"
19 #include "debug.h"
20
21 #include "QRef.h"
22 #include "QRefDialog.h"
23
24 #include <qpushbutton.h>
25 #include <qlineedit.h>
26 #include <qcombobox.h>
27 #include <qlistbox.h>
28
29
30 QRefDialog::QRefDialog(QRef * form)
31         : QRefDialogBase(0, 0, false, 0),
32         form_(form)
33 {
34         connect(okPB, SIGNAL(clicked()),
35                 form_, SLOT(slotOK()));
36         connect(applyPB, SIGNAL(clicked()),
37                 form_, SLOT(slotApply()));
38         connect(closePB, SIGNAL(clicked()),
39                 form_, SLOT(slotClose()));
40 }
41
42
43 void QRefDialog::changed_adaptor()
44 {
45         form_->changed();
46 }
47
48
49 void QRefDialog::gotoClicked()
50 {
51         form_->gotoRef();
52 }
53
54
55 void QRefDialog::refHighlighted(const QString & sel)
56 {
57         if (form_->readOnly())
58                 return;
59
60         referenceED->setText(sel);
61         if (form_->at_ref_)
62                 form_->gotoRef();
63         gotoPB->setEnabled(true);
64         if (form_->typeAllowed())
65                 typeCO->setEnabled(true);
66         if (form_->nameAllowed())
67                 nameED->setEnabled(true);
68 }
69
70
71 void QRefDialog::refSelected(const QString &)
72 {
73         form_->gotoRef();
74 }
75
76
77 void QRefDialog::sortToggled(bool on)
78 {
79         form_->sort_ = on;
80         refsLB->clear();
81         form_->redoRefs();
82 }
83
84
85 void QRefDialog::updateClicked()
86 {
87         form_->updateRefs();
88 }
89
90
91 void QRefDialog::closeEvent(QCloseEvent * e)
92 {
93         form_->slotWMHide();
94         e->accept();
95 }