3 * This file is part of LyX, the document processor.
4 * Licence details can be found in the file COPYING.
6 * \author Kalle Dalheimer
9 * Full author contact details are available in file CREDITS.
14 #include "QRefDialog.h"
17 #include <qcombobox.h>
18 #include <qlineedit.h>
20 #include <qpushbutton.h>
25 QRefDialog::QRefDialog(QRef * form)
26 : QRefDialogBase(0, 0, false, 0),
29 connect(okPB, SIGNAL(clicked()),
30 form_, SLOT(slotOK()));
31 connect(applyPB, SIGNAL(clicked()),
32 form_, SLOT(slotApply()));
33 connect(closePB, SIGNAL(clicked()),
34 form_, SLOT(slotClose()));
38 void QRefDialog::show()
40 QRefDialogBase::show();
45 void QRefDialog::changed_adaptor()
51 void QRefDialog::gotoClicked()
57 void QRefDialog::refHighlighted(const QString & sel)
59 if (form_->readOnly())
62 int const cur_item = refsLB->currentItem();
63 bool const cur_item_selected = cur_item >= 0 ?
64 refsLB->isSelected(cur_item) : false;
66 if (cur_item_selected)
67 referenceED->setText(sel);
71 gotoPB->setEnabled(true);
72 if (form_->typeAllowed())
73 typeCO->setEnabled(true);
74 if (form_->nameAllowed())
75 nameED->setEnabled(true);
79 void QRefDialog::refSelected(const QString & sel)
81 if (form_->readOnly())
84 int const cur_item = refsLB->currentItem();
85 bool const cur_item_selected = cur_item >= 0 ?
86 refsLB->isSelected(cur_item) : false;
88 if (cur_item_selected)
89 referenceED->setText(sel);
90 // <enter> or double click, inserts ref and closes dialog
95 void QRefDialog::sortToggled(bool on)
102 void QRefDialog::updateClicked()
108 void QRefDialog::closeEvent(QCloseEvent * e)
114 } // namespace frontend