2001-08-19 13:25:15 +00:00
|
|
|
/**
|
|
|
|
* \file QRefDialog.C
|
|
|
|
* Copyright 2001 the LyX Team
|
|
|
|
* Read the file COPYING
|
|
|
|
*
|
|
|
|
* \author Kalle Dalheimer <kalle@klaralvdalens-datakonsult.se>
|
2001-08-26 00:29:39 +00:00
|
|
|
* \author John Levon <moz@compsoc.man.ac.uk>
|
2001-08-19 13:25:15 +00:00
|
|
|
*/
|
|
|
|
|
2001-08-26 00:29:39 +00:00
|
|
|
#include <config.h>
|
|
|
|
|
|
|
|
#include <qpushbutton.h>
|
|
|
|
#include <qlineedit.h>
|
|
|
|
#include <qcombobox.h>
|
|
|
|
#include <qlistbox.h>
|
|
|
|
|
2001-08-19 13:25:15 +00:00
|
|
|
#include "QRefDialog.h"
|
2001-08-26 00:29:39 +00:00
|
|
|
#include "ControlRef.h"
|
2001-08-19 13:25:15 +00:00
|
|
|
#include "Dialogs.h"
|
|
|
|
#include "QRef.h"
|
2001-08-26 00:29:39 +00:00
|
|
|
#include "debug.h"
|
2001-08-19 13:25:15 +00:00
|
|
|
|
2001-08-26 00:29:39 +00:00
|
|
|
QRefDialog::QRefDialog(QRef * form)
|
|
|
|
: QRefDialogBase(0, 0, false, 0),
|
2001-08-19 13:25:15 +00:00
|
|
|
form_(form)
|
|
|
|
{
|
2001-08-26 00:29:39 +00:00
|
|
|
connect(okPB, SIGNAL(clicked()),
|
|
|
|
form_, SLOT(slotOK()));
|
|
|
|
connect(closePB, SIGNAL(clicked()),
|
|
|
|
form_, SLOT(slotClose()));
|
2001-08-19 13:25:15 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
|
2001-08-26 00:29:39 +00:00
|
|
|
void QRefDialog::changed_adaptor()
|
2001-08-19 13:25:15 +00:00
|
|
|
{
|
2001-08-26 00:29:39 +00:00
|
|
|
form_->changed();
|
2001-08-19 13:25:15 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
|
2001-08-26 00:29:39 +00:00
|
|
|
void QRefDialog::gotoClicked()
|
2001-08-19 13:25:15 +00:00
|
|
|
{
|
2001-08-26 00:29:39 +00:00
|
|
|
form_->gotoRef();
|
2001-08-19 13:25:15 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
|
2001-08-26 00:29:39 +00:00
|
|
|
void QRefDialog::refHighlighted(const QString & sel)
|
2001-08-19 13:25:15 +00:00
|
|
|
{
|
2001-08-26 00:29:39 +00:00
|
|
|
if (form_->readOnly())
|
|
|
|
return;
|
|
|
|
|
|
|
|
referenceED->setText(sel);
|
|
|
|
if (form_->at_ref_)
|
|
|
|
form_->gotoRef();
|
|
|
|
gotoPB->setEnabled(true);
|
|
|
|
if (form_->typeAllowed())
|
|
|
|
typeCO->setEnabled(true);
|
|
|
|
if (form_->nameAllowed())
|
|
|
|
nameED->setEnabled(true);
|
2001-08-19 13:25:15 +00:00
|
|
|
}
|
|
|
|
|
2001-08-26 00:29:39 +00:00
|
|
|
|
2001-09-06 14:24:09 +00:00
|
|
|
void QRefDialog::refSelected(const QString &)
|
2001-08-19 13:25:15 +00:00
|
|
|
{
|
2001-08-26 00:29:39 +00:00
|
|
|
form_->gotoRef();
|
2001-08-19 13:25:15 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
|
2001-08-26 00:29:39 +00:00
|
|
|
void QRefDialog::sortToggled(bool on)
|
2001-08-19 13:25:15 +00:00
|
|
|
{
|
2001-08-26 00:29:39 +00:00
|
|
|
form_->sort_ = on;
|
|
|
|
refsLB->clear();
|
|
|
|
form_->redoRefs();
|
2001-08-19 13:25:15 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
|
2001-08-26 00:29:39 +00:00
|
|
|
void QRefDialog::updateClicked()
|
2001-08-19 13:25:15 +00:00
|
|
|
{
|
2001-08-26 00:29:39 +00:00
|
|
|
form_->updateRefs();
|
2001-08-19 13:25:15 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
void QRefDialog::closeEvent(QCloseEvent * e)
|
|
|
|
{
|
2001-08-26 00:29:39 +00:00
|
|
|
form_->slotWMHide();
|
2001-08-19 13:25:15 +00:00
|
|
|
e->accept();
|
|
|
|
}
|