2001-08-19 13:25:15 +00:00
|
|
|
/**
|
|
|
|
* \file QRefDialog.C
|
2002-09-24 13:57:09 +00:00
|
|
|
* This file is part of LyX, the document processor.
|
|
|
|
* Licence details can be found in the file COPYING.
|
2001-08-19 13:25:15 +00:00
|
|
|
*
|
2002-10-20 01:48:28 +00:00
|
|
|
* \author Kalle Dalheimer
|
|
|
|
* \author John Levon
|
2002-09-24 13:57:09 +00:00
|
|
|
*
|
|
|
|
* Full author contact details are available in file CREDITS
|
2001-08-19 13:25:15 +00:00
|
|
|
*/
|
|
|
|
|
2001-08-26 00:29:39 +00:00
|
|
|
#include <config.h>
|
|
|
|
|
2002-09-24 13:57:09 +00:00
|
|
|
|
2002-06-19 03:38:44 +00:00
|
|
|
#include "ControlRef.h"
|
|
|
|
#include "debug.h"
|
|
|
|
|
|
|
|
#include "QRef.h"
|
|
|
|
#include "QRefDialog.h"
|
2002-10-20 01:48:28 +00:00
|
|
|
|
2001-08-26 00:29:39 +00:00
|
|
|
#include <qpushbutton.h>
|
2002-03-21 21:21:28 +00:00
|
|
|
#include <qlineedit.h>
|
2001-08-26 00:29:39 +00:00
|
|
|
#include <qcombobox.h>
|
2002-03-21 21:21:28 +00:00
|
|
|
#include <qlistbox.h>
|
|
|
|
|
2002-10-20 01:48:28 +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()));
|
2003-02-09 00:11:51 +00:00
|
|
|
connect(applyPB, SIGNAL(clicked()),
|
|
|
|
form_, SLOT(slotApply()));
|
2001-08-26 00:29:39 +00:00
|
|
|
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;
|
|
|
|
|
2002-03-21 21:21:28 +00:00
|
|
|
referenceED->setText(sel);
|
|
|
|
if (form_->at_ref_)
|
2001-08-26 00:29:39 +00:00
|
|
|
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
|
|
|
}
|
|
|
|
|
2002-03-21 21:21:28 +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();
|
|
|
|
}
|