2006-03-05 17:24:44 +00:00
|
|
|
|
/**
|
2007-08-31 05:53:55 +00:00
|
|
|
|
* \file GuiRef.cpp
|
2006-03-05 17:24:44 +00:00
|
|
|
|
* This file is part of LyX, the document processor.
|
|
|
|
|
* Licence details can be found in the file COPYING.
|
|
|
|
|
*
|
|
|
|
|
* \author John Levon
|
|
|
|
|
* \author J<EFBFBD>rgen Spitzm<EFBFBD>ller
|
|
|
|
|
*
|
|
|
|
|
* Full author contact details are available in file CREDITS.
|
|
|
|
|
*/
|
|
|
|
|
|
|
|
|
|
#include <config.h>
|
|
|
|
|
|
2007-08-31 05:53:55 +00:00
|
|
|
|
#include "GuiRef.h"
|
2007-09-05 20:33:29 +00:00
|
|
|
|
|
|
|
|
|
#include "ControlRef.h"
|
2006-03-05 17:24:44 +00:00
|
|
|
|
#include "qt_helpers.h"
|
|
|
|
|
|
2007-04-25 01:24:38 +00:00
|
|
|
|
#include "insets/InsetRef.h"
|
2006-03-05 17:24:44 +00:00
|
|
|
|
|
2006-05-03 19:51:15 +00:00
|
|
|
|
#include <QLineEdit>
|
|
|
|
|
#include <QCheckBox>
|
|
|
|
|
#include <QListWidget>
|
|
|
|
|
#include <QListWidgetItem>
|
|
|
|
|
#include <QPushButton>
|
|
|
|
|
#include <QToolTip>
|
2007-04-25 10:57:54 +00:00
|
|
|
|
#include <QCloseEvent>
|
2006-03-05 17:24:44 +00:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
using std::vector;
|
|
|
|
|
using std::string;
|
|
|
|
|
|
2007-04-25 10:57:54 +00:00
|
|
|
|
|
2006-03-05 17:24:44 +00:00
|
|
|
|
namespace lyx {
|
|
|
|
|
namespace frontend {
|
|
|
|
|
|
2007-09-05 20:33:29 +00:00
|
|
|
|
GuiRefDialog::GuiRefDialog(LyXView & lv)
|
|
|
|
|
: GuiDialog(lv, "ref")
|
2007-04-25 10:57:54 +00:00
|
|
|
|
{
|
|
|
|
|
setupUi(this);
|
2007-09-05 20:33:29 +00:00
|
|
|
|
setController(new ControlRef(*this));
|
|
|
|
|
setViewTitle(_("Cross-reference"));
|
2007-04-25 10:57:54 +00:00
|
|
|
|
|
2007-09-05 20:33:29 +00:00
|
|
|
|
sort_ = false;
|
|
|
|
|
at_ref_ = false;
|
|
|
|
|
|
|
|
|
|
connect(okPB, SIGNAL(clicked()), this, SLOT(slotOK()));
|
|
|
|
|
connect(applyPB, SIGNAL(clicked()), this, SLOT(slotApply()));
|
|
|
|
|
connect(closePB, SIGNAL(clicked()), this, SLOT(slotClose()));
|
2007-04-25 10:57:54 +00:00
|
|
|
|
connect(closePB, SIGNAL(clicked()), this, SLOT(reset_dialog()));
|
2007-05-17 12:11:56 +00:00
|
|
|
|
connect(this, SIGNAL(rejected()), this, SLOT(reset_dialog()));
|
2007-04-25 10:57:54 +00:00
|
|
|
|
|
2007-05-28 22:27:45 +00:00
|
|
|
|
connect(typeCO, SIGNAL(activated(int)),
|
2007-04-25 10:57:54 +00:00
|
|
|
|
this, SLOT(changed_adaptor()));
|
2007-05-28 22:27:45 +00:00
|
|
|
|
connect(referenceED, SIGNAL(textChanged(const QString &)),
|
2007-04-25 10:57:54 +00:00
|
|
|
|
this, SLOT(changed_adaptor()));
|
2007-05-28 22:27:45 +00:00
|
|
|
|
connect(nameED, SIGNAL(textChanged(const QString &)),
|
2007-04-25 10:57:54 +00:00
|
|
|
|
this, SLOT(changed_adaptor()));
|
2007-05-28 22:27:45 +00:00
|
|
|
|
connect(refsLW, SIGNAL(itemClicked(QListWidgetItem *)),
|
2007-04-25 10:57:54 +00:00
|
|
|
|
this, SLOT(refHighlighted(QListWidgetItem *)));
|
|
|
|
|
connect(refsLW, SIGNAL(itemSelectionChanged()),
|
|
|
|
|
this, SLOT(selectionChanged()));
|
2007-05-28 22:27:45 +00:00
|
|
|
|
connect(refsLW, SIGNAL(itemActivated(QListWidgetItem *)),
|
2007-04-25 10:57:54 +00:00
|
|
|
|
this, SLOT(refSelected(QListWidgetItem *)));
|
|
|
|
|
connect(sortCB, SIGNAL(clicked(bool)),
|
|
|
|
|
this, SLOT(sortToggled(bool)));
|
2007-05-28 22:27:45 +00:00
|
|
|
|
connect(gotoPB, SIGNAL(clicked()),
|
2007-04-25 10:57:54 +00:00
|
|
|
|
this, SLOT(gotoClicked()));
|
2007-05-28 22:27:45 +00:00
|
|
|
|
connect(updatePB, SIGNAL(clicked()),
|
2007-04-25 10:57:54 +00:00
|
|
|
|
this, SLOT(updateClicked()));
|
2007-05-28 22:27:45 +00:00
|
|
|
|
connect(bufferCO, SIGNAL(activated(int)),
|
2007-04-25 10:57:54 +00:00
|
|
|
|
this, SLOT(updateClicked()));
|
|
|
|
|
|
|
|
|
|
setFocusProxy(refsLW);
|
2007-09-05 20:33:29 +00:00
|
|
|
|
|
|
|
|
|
bc().setPolicy(ButtonPolicy::NoRepeatedApplyReadOnlyPolicy);
|
|
|
|
|
bc().setOK(okPB);
|
|
|
|
|
bc().setApply(applyPB);
|
|
|
|
|
bc().setCancel(closePB);
|
|
|
|
|
bc().addReadOnly(refsLW);
|
|
|
|
|
bc().addReadOnly(sortCB);
|
|
|
|
|
bc().addReadOnly(nameED);
|
|
|
|
|
bc().addReadOnly(referenceED);
|
|
|
|
|
bc().addReadOnly(typeCO);
|
|
|
|
|
bc().addReadOnly(bufferCO);
|
|
|
|
|
|
|
|
|
|
restored_buffer_ = -1;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
ControlRef & GuiRefDialog::controller() const
|
|
|
|
|
{
|
2007-09-10 22:32:59 +00:00
|
|
|
|
return static_cast<ControlRef &>(GuiDialog::controller());
|
2007-04-25 10:57:54 +00:00
|
|
|
|
}
|
|
|
|
|
|
2007-09-05 20:33:29 +00:00
|
|
|
|
|
2007-08-31 05:53:55 +00:00
|
|
|
|
void GuiRefDialog::changed_adaptor()
|
2007-04-25 10:57:54 +00:00
|
|
|
|
{
|
2007-09-05 20:33:29 +00:00
|
|
|
|
changed();
|
2007-04-25 10:57:54 +00:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
2007-08-31 05:53:55 +00:00
|
|
|
|
void GuiRefDialog::gotoClicked()
|
2007-04-25 10:57:54 +00:00
|
|
|
|
{
|
2007-09-05 20:33:29 +00:00
|
|
|
|
gotoRef();
|
2007-04-25 10:57:54 +00:00
|
|
|
|
}
|
|
|
|
|
|
2007-08-31 05:53:55 +00:00
|
|
|
|
void GuiRefDialog::selectionChanged()
|
2007-04-25 10:57:54 +00:00
|
|
|
|
{
|
2007-09-05 20:33:29 +00:00
|
|
|
|
if (readOnly())
|
2007-04-25 10:57:54 +00:00
|
|
|
|
return;
|
2007-05-28 22:27:45 +00:00
|
|
|
|
|
2007-04-25 10:57:54 +00:00
|
|
|
|
QList<QListWidgetItem *> selections = refsLW->selectedItems();
|
|
|
|
|
if (selections.isEmpty())
|
|
|
|
|
return;
|
|
|
|
|
QListWidgetItem * sel = selections.first();
|
|
|
|
|
refHighlighted(sel);
|
|
|
|
|
return;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
2007-08-31 05:53:55 +00:00
|
|
|
|
void GuiRefDialog::refHighlighted(QListWidgetItem * sel)
|
2007-04-25 10:57:54 +00:00
|
|
|
|
{
|
2007-09-05 20:33:29 +00:00
|
|
|
|
if (readOnly())
|
2007-04-25 10:57:54 +00:00
|
|
|
|
return;
|
|
|
|
|
|
|
|
|
|
/* int const cur_item = refsLW->currentRow();
|
|
|
|
|
bool const cur_item_selected = cur_item >= 0 ?
|
|
|
|
|
refsLB->isSelected(cur_item) : false;*/
|
|
|
|
|
bool const cur_item_selected = refsLW->isItemSelected(sel);
|
|
|
|
|
|
|
|
|
|
if (cur_item_selected)
|
|
|
|
|
referenceED->setText(sel->text());
|
|
|
|
|
|
2007-09-05 20:33:29 +00:00
|
|
|
|
if (at_ref_)
|
|
|
|
|
gotoRef();
|
2007-04-25 10:57:54 +00:00
|
|
|
|
gotoPB->setEnabled(true);
|
2007-09-05 20:33:29 +00:00
|
|
|
|
if (typeAllowed())
|
2007-04-25 10:57:54 +00:00
|
|
|
|
typeCO->setEnabled(true);
|
2007-09-05 20:33:29 +00:00
|
|
|
|
if (nameAllowed())
|
2007-04-25 10:57:54 +00:00
|
|
|
|
nameED->setEnabled(true);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
2007-08-31 05:53:55 +00:00
|
|
|
|
void GuiRefDialog::refSelected(QListWidgetItem * sel)
|
2007-04-25 10:57:54 +00:00
|
|
|
|
{
|
2007-09-05 20:33:29 +00:00
|
|
|
|
if (readOnly())
|
2007-04-25 10:57:54 +00:00
|
|
|
|
return;
|
|
|
|
|
|
|
|
|
|
/* int const cur_item = refsLW->currentRow();
|
|
|
|
|
bool const cur_item_selected = cur_item >= 0 ?
|
|
|
|
|
refsLB->isSelected(cur_item) : false;*/
|
|
|
|
|
bool const cur_item_selected = refsLW->isItemSelected(sel);
|
|
|
|
|
|
|
|
|
|
if (cur_item_selected)
|
|
|
|
|
referenceED->setText(sel->text());
|
|
|
|
|
// <enter> or double click, inserts ref and closes dialog
|
2007-09-05 20:33:29 +00:00
|
|
|
|
slotOK();
|
2007-04-25 10:57:54 +00:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
2007-08-31 05:53:55 +00:00
|
|
|
|
void GuiRefDialog::sortToggled(bool on)
|
2007-04-25 10:57:54 +00:00
|
|
|
|
{
|
2007-09-05 20:33:29 +00:00
|
|
|
|
sort_ = on;
|
|
|
|
|
redoRefs();
|
2007-04-25 10:57:54 +00:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
2007-08-31 05:53:55 +00:00
|
|
|
|
void GuiRefDialog::updateClicked()
|
2007-04-25 10:57:54 +00:00
|
|
|
|
{
|
2007-09-05 20:33:29 +00:00
|
|
|
|
updateRefs();
|
2007-04-25 10:57:54 +00:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
2007-09-05 20:33:29 +00:00
|
|
|
|
void GuiRefDialog::reset_dialog()
|
|
|
|
|
{
|
|
|
|
|
at_ref_ = false;
|
|
|
|
|
setGotoRef();
|
2007-04-25 10:57:54 +00:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
2007-08-31 05:53:55 +00:00
|
|
|
|
void GuiRefDialog::closeEvent(QCloseEvent * e)
|
2007-04-25 10:57:54 +00:00
|
|
|
|
{
|
2007-09-11 17:06:15 +00:00
|
|
|
|
slotClose();
|
2007-04-25 10:57:54 +00:00
|
|
|
|
reset_dialog();
|
|
|
|
|
e->accept();
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
2007-09-05 20:33:29 +00:00
|
|
|
|
void GuiRefDialog::update_contents()
|
2006-03-05 17:24:44 +00:00
|
|
|
|
{
|
|
|
|
|
InsetCommandParams const & params = controller().params();
|
|
|
|
|
|
2007-09-05 20:33:29 +00:00
|
|
|
|
int orig_type = typeCO->currentIndex();
|
2006-03-05 17:24:44 +00:00
|
|
|
|
|
2007-09-05 20:33:29 +00:00
|
|
|
|
referenceED->setText(toqstr(params["reference"]));
|
2006-03-05 17:24:44 +00:00
|
|
|
|
|
2007-09-05 20:33:29 +00:00
|
|
|
|
nameED->setText(toqstr(params["name"]));
|
|
|
|
|
nameED->setReadOnly(!nameAllowed() && !readOnly());
|
2006-03-05 17:24:44 +00:00
|
|
|
|
|
|
|
|
|
// restore type settings for new insets
|
2006-10-20 13:53:43 +00:00
|
|
|
|
if (params["reference"].empty())
|
2007-09-05 20:33:29 +00:00
|
|
|
|
typeCO->setCurrentIndex(orig_type);
|
2006-03-05 17:24:44 +00:00
|
|
|
|
else
|
2007-09-05 20:33:29 +00:00
|
|
|
|
typeCO->setCurrentIndex(InsetRef::getType(params.getCmdName()));
|
|
|
|
|
typeCO->setEnabled(typeAllowed() && !readOnly());
|
2006-03-05 17:24:44 +00:00
|
|
|
|
if (!typeAllowed())
|
2007-09-05 20:33:29 +00:00
|
|
|
|
typeCO->setCurrentIndex(0);
|
2006-03-05 17:24:44 +00:00
|
|
|
|
|
2007-09-05 20:33:29 +00:00
|
|
|
|
sortCB->setChecked(sort_);
|
2006-03-05 17:24:44 +00:00
|
|
|
|
|
|
|
|
|
// insert buffer list
|
2007-09-05 20:33:29 +00:00
|
|
|
|
bufferCO->clear();
|
2006-03-05 17:24:44 +00:00
|
|
|
|
vector<string> const buffers = controller().getBufferList();
|
|
|
|
|
for (vector<string>::const_iterator it = buffers.begin();
|
|
|
|
|
it != buffers.end(); ++it) {
|
2007-09-05 20:33:29 +00:00
|
|
|
|
bufferCO->addItem(toqstr(*it));
|
2006-03-05 17:24:44 +00:00
|
|
|
|
}
|
|
|
|
|
// restore the buffer combo setting for new insets
|
2006-10-20 13:53:43 +00:00
|
|
|
|
if (params["reference"].empty() && restored_buffer_ != -1
|
2007-09-05 20:33:29 +00:00
|
|
|
|
&& restored_buffer_ < bufferCO->count())
|
|
|
|
|
bufferCO->setCurrentIndex(restored_buffer_);
|
2006-03-05 17:24:44 +00:00
|
|
|
|
else
|
2007-09-05 20:33:29 +00:00
|
|
|
|
bufferCO->setCurrentIndex(controller().getBufferNum());
|
2006-03-05 17:24:44 +00:00
|
|
|
|
|
|
|
|
|
updateRefs();
|
2007-09-03 05:59:32 +00:00
|
|
|
|
bc().setValid(false);
|
2006-03-05 17:24:44 +00:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
2007-09-05 20:33:29 +00:00
|
|
|
|
void GuiRefDialog::applyView()
|
2006-03-05 17:24:44 +00:00
|
|
|
|
{
|
|
|
|
|
InsetCommandParams & params = controller().params();
|
2007-05-28 22:27:45 +00:00
|
|
|
|
|
2007-09-05 20:33:29 +00:00
|
|
|
|
last_reference_ = referenceED->text();
|
2006-03-05 17:24:44 +00:00
|
|
|
|
|
2007-09-05 20:33:29 +00:00
|
|
|
|
params.setCmdName(InsetRef::getName(typeCO->currentIndex()));
|
2007-04-24 22:10:56 +00:00
|
|
|
|
params["reference"] = qstring_to_ucs4(last_reference_);
|
2007-09-05 20:33:29 +00:00
|
|
|
|
params["name"] = qstring_to_ucs4(nameED->text());
|
2006-03-05 17:24:44 +00:00
|
|
|
|
|
2007-09-05 20:33:29 +00:00
|
|
|
|
restored_buffer_ = bufferCO->currentIndex();
|
2006-03-05 17:24:44 +00:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
2007-09-05 20:33:29 +00:00
|
|
|
|
bool GuiRefDialog::nameAllowed()
|
2006-03-05 17:24:44 +00:00
|
|
|
|
{
|
2007-09-10 22:32:59 +00:00
|
|
|
|
KernelDocType const doc_type = controller().docType();
|
|
|
|
|
return doc_type != LATEX && doc_type != LITERATE;
|
2006-03-05 17:24:44 +00:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
2007-09-05 20:33:29 +00:00
|
|
|
|
bool GuiRefDialog::typeAllowed()
|
2006-03-05 17:24:44 +00:00
|
|
|
|
{
|
2007-09-10 22:32:59 +00:00
|
|
|
|
return controller().docType() != DOCBOOK;
|
2006-03-05 17:24:44 +00:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
2007-09-05 20:33:29 +00:00
|
|
|
|
void GuiRefDialog::setGoBack()
|
2006-03-05 17:24:44 +00:00
|
|
|
|
{
|
2007-09-05 20:33:29 +00:00
|
|
|
|
gotoPB->setText(qt_("&Go Back"));
|
|
|
|
|
gotoPB->setToolTip("");
|
|
|
|
|
gotoPB->setToolTip(qt_("Jump back"));
|
2006-03-05 17:24:44 +00:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
2007-09-05 20:33:29 +00:00
|
|
|
|
void GuiRefDialog::setGotoRef()
|
2006-03-05 17:24:44 +00:00
|
|
|
|
{
|
2007-09-05 20:33:29 +00:00
|
|
|
|
gotoPB->setText(qt_("&Go to Label"));
|
|
|
|
|
gotoPB->setToolTip("");
|
|
|
|
|
gotoPB->setToolTip(qt_("Jump to label"));
|
2006-03-05 17:24:44 +00:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
2007-09-05 20:33:29 +00:00
|
|
|
|
void GuiRefDialog::gotoRef()
|
2006-03-05 17:24:44 +00:00
|
|
|
|
{
|
2007-09-10 22:32:59 +00:00
|
|
|
|
string ref = fromqstr(referenceED->text());
|
2006-03-05 17:24:44 +00:00
|
|
|
|
|
|
|
|
|
if (at_ref_) {
|
|
|
|
|
// go back
|
|
|
|
|
setGotoRef();
|
|
|
|
|
controller().gotoBookmark();
|
|
|
|
|
} else {
|
|
|
|
|
// go to the ref
|
|
|
|
|
setGoBack();
|
|
|
|
|
controller().gotoRef(ref);
|
|
|
|
|
}
|
|
|
|
|
at_ref_ = !at_ref_;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
2007-09-05 20:33:29 +00:00
|
|
|
|
void GuiRefDialog::redoRefs()
|
2006-03-05 17:24:44 +00:00
|
|
|
|
{
|
|
|
|
|
// Prevent these widgets from emitting any signals whilst
|
|
|
|
|
// we modify their state.
|
2007-09-05 20:33:29 +00:00
|
|
|
|
refsLW->blockSignals(true);
|
|
|
|
|
referenceED->blockSignals(true);
|
|
|
|
|
refsLW->setUpdatesEnabled(false);
|
2007-05-28 22:27:45 +00:00
|
|
|
|
|
2007-09-05 20:33:29 +00:00
|
|
|
|
refsLW->clear();
|
2006-03-05 17:24:44 +00:00
|
|
|
|
|
|
|
|
|
// need this because Qt will send a highlight() here for
|
|
|
|
|
// the first item inserted
|
2007-09-05 20:33:29 +00:00
|
|
|
|
QString const oldSelection(referenceED->text());
|
2006-03-05 17:24:44 +00:00
|
|
|
|
|
2006-10-12 10:50:45 +00:00
|
|
|
|
for (std::vector<docstring>::const_iterator iter = refs_.begin();
|
2006-03-05 17:24:44 +00:00
|
|
|
|
iter != refs_.end(); ++iter) {
|
2007-09-05 20:33:29 +00:00
|
|
|
|
refsLW->addItem(toqstr(*iter));
|
2006-03-05 17:24:44 +00:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if (sort_)
|
2007-09-05 20:33:29 +00:00
|
|
|
|
refsLW->sortItems();
|
2006-03-05 17:24:44 +00:00
|
|
|
|
|
2007-09-05 20:33:29 +00:00
|
|
|
|
referenceED->setText(oldSelection);
|
2006-03-05 17:24:44 +00:00
|
|
|
|
|
2007-04-24 22:10:56 +00:00
|
|
|
|
// restore the last selection or, for new insets, highlight
|
|
|
|
|
// the previous selection
|
|
|
|
|
if (!oldSelection.isEmpty() || !last_reference_.isEmpty()) {
|
|
|
|
|
bool const newInset = oldSelection.isEmpty();
|
|
|
|
|
QString textToFind = newInset ? last_reference_ : oldSelection;
|
|
|
|
|
bool foundItem = false;
|
2007-09-05 20:33:29 +00:00
|
|
|
|
for (int i = 0; !foundItem && i < refsLW->count(); ++i) {
|
|
|
|
|
QListWidgetItem * item = refsLW->item(i);
|
2007-04-24 22:10:56 +00:00
|
|
|
|
if (textToFind == item->text()) {
|
2007-09-05 20:33:29 +00:00
|
|
|
|
refsLW->setCurrentItem(item);
|
|
|
|
|
refsLW->setItemSelected(item, !newInset);
|
2007-04-24 22:10:56 +00:00
|
|
|
|
//Make sure selected item is visible
|
2007-09-05 20:33:29 +00:00
|
|
|
|
refsLW->scrollToItem(item);
|
2007-04-24 22:10:56 +00:00
|
|
|
|
foundItem = true;
|
2006-05-03 19:51:15 +00:00
|
|
|
|
}
|
2006-03-05 17:24:44 +00:00
|
|
|
|
}
|
2007-04-24 22:10:56 +00:00
|
|
|
|
if (foundItem)
|
|
|
|
|
last_reference_ = textToFind;
|
|
|
|
|
else last_reference_ = "";
|
|
|
|
|
}
|
2007-09-05 20:33:29 +00:00
|
|
|
|
refsLW->setUpdatesEnabled(true);
|
|
|
|
|
refsLW->update();
|
2006-03-05 17:24:44 +00:00
|
|
|
|
|
|
|
|
|
// Re-activate the emission of signals by these widgets.
|
2007-09-05 20:33:29 +00:00
|
|
|
|
refsLW->blockSignals(false);
|
|
|
|
|
referenceED->blockSignals(false);
|
2006-03-05 17:24:44 +00:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
2007-09-05 20:33:29 +00:00
|
|
|
|
void GuiRefDialog::updateRefs()
|
2006-03-05 17:24:44 +00:00
|
|
|
|
{
|
|
|
|
|
refs_.clear();
|
2007-09-05 20:33:29 +00:00
|
|
|
|
string const name = controller().getBufferName(bufferCO->currentIndex());
|
2006-03-05 17:24:44 +00:00
|
|
|
|
refs_ = controller().getLabelList(name);
|
2007-09-05 20:33:29 +00:00
|
|
|
|
sortCB->setEnabled(!refs_.empty());
|
|
|
|
|
refsLW->setEnabled(!refs_.empty());
|
|
|
|
|
gotoPB->setEnabled(!refs_.empty());
|
2006-03-05 17:24:44 +00:00
|
|
|
|
redoRefs();
|
|
|
|
|
}
|
|
|
|
|
|
2007-09-05 20:33:29 +00:00
|
|
|
|
|
|
|
|
|
bool GuiRefDialog::isValid()
|
2006-03-05 17:24:44 +00:00
|
|
|
|
{
|
2007-09-05 20:33:29 +00:00
|
|
|
|
return !referenceED->text().isEmpty();
|
2006-03-05 17:24:44 +00:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
} // namespace frontend
|
|
|
|
|
} // namespace lyx
|
2007-04-25 10:57:54 +00:00
|
|
|
|
|
2007-08-31 05:53:55 +00:00
|
|
|
|
#include "GuiRef_moc.cpp"
|