]> git.lyx.org Git - lyx.git/blob - src/frontends/qt2/QRefDialog.C
fix minipage layout
[lyx.git] / src / frontends / qt2 / QRefDialog.C
1 /**
2  * \file QRefDialog.C
3  * Copyright 2001 the LyX Team
4  * Read the file COPYING
5  *
6  * \author Kalle Dalheimer <kalle@klaralvdalens-datakonsult.se>
7  * \author John Levon <moz@compsoc.man.ac.uk>
8  */
9
10 #include <config.h>
11
12 #include <qpushbutton.h>
13 #include <qlineedit.h> 
14 #include <qcombobox.h>
15 #include <qlistbox.h> 
16  
17 #include "QRefDialog.h"
18 #include "ControlRef.h" 
19 #include "Dialogs.h"
20 #include "QRef.h"
21 #include "debug.h"
22
23 QRefDialog::QRefDialog(QRef * form)
24         : QRefDialogBase(0, 0, false, 0),
25         form_(form)
26 {
27         connect(okPB, SIGNAL(clicked()),
28                 form_, SLOT(slotOK()));
29         connect(closePB, SIGNAL(clicked()),
30                 form_, SLOT(slotClose()));
31 }
32
33
34 void QRefDialog::changed_adaptor()
35 {
36         form_->changed();
37 }
38
39
40 void QRefDialog::gotoClicked()
41 {
42         form_->gotoRef();
43 }
44
45
46 void QRefDialog::refHighlighted(const QString & sel)
47 {
48         if (form_->readOnly())
49                 return;
50
51         referenceED->setText(sel); 
52         if (form_->at_ref_)     
53                 form_->gotoRef();
54         gotoPB->setEnabled(true);
55         if (form_->typeAllowed())
56                 typeCO->setEnabled(true);
57         if (form_->nameAllowed())
58                 nameED->setEnabled(true);
59 }
60
61  
62 void QRefDialog::refSelected(const QString &)
63 {
64         form_->gotoRef();
65 }
66
67
68 void QRefDialog::sortToggled(bool on)
69 {
70         form_->sort_ = on;
71         refsLB->clear();
72         form_->redoRefs();
73 }
74
75
76 void QRefDialog::updateClicked()
77 {
78         form_->updateRefs();
79 }
80
81
82 void QRefDialog::closeEvent(QCloseEvent * e)
83 {
84         form_->slotWMHide();
85         e->accept();
86 }