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