]> git.lyx.org Git - lyx.git/blob - src/frontends/qt2/QRefDialog.C
Some string(widget->text()) fixes. Weirdness
[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(closePB, SIGNAL(clicked()),
37                 form_, SLOT(slotClose()));
38 }
39
40
41 void QRefDialog::changed_adaptor()
42 {
43         form_->changed();
44 }
45
46
47 void QRefDialog::gotoClicked()
48 {
49         form_->gotoRef();
50 }
51
52
53 void QRefDialog::refHighlighted(const QString & sel)
54 {
55         if (form_->readOnly())
56                 return;
57
58         referenceED->setText(sel);
59         if (form_->at_ref_)
60                 form_->gotoRef();
61         gotoPB->setEnabled(true);
62         if (form_->typeAllowed())
63                 typeCO->setEnabled(true);
64         if (form_->nameAllowed())
65                 nameED->setEnabled(true);
66 }
67
68
69 void QRefDialog::refSelected(const QString &)
70 {
71         form_->gotoRef();
72 }
73
74
75 void QRefDialog::sortToggled(bool on)
76 {
77         form_->sort_ = on;
78         refsLB->clear();
79         form_->redoRefs();
80 }
81
82
83 void QRefDialog::updateClicked()
84 {
85         form_->updateRefs();
86 }
87
88
89 void QRefDialog::closeEvent(QCloseEvent * e)
90 {
91         form_->slotWMHide();
92         e->accept();
93 }