mirror of
https://git.lyx.org/repos/lyx.git
synced 2025-01-24 01:01:57 +00:00
fix double clicking in qrefs dialog (bug 2194)
double clicking in qrefs dialog now inserts a ref (bug 2187) git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/branches/BRANCH_1_3_X@10716 a592a061-630c-0410-9148-cb99ea01b6c8
This commit is contained in:
parent
0155e3e433
commit
a0a923307c
@ -1,3 +1,19 @@
|
||||
2006-01-08 Jürgen Spitzmüller <j.spitzmueller@gmx.de>
|
||||
|
||||
* ui/QRefDialogBase.ui: re-connect the refsLB->Selected signal
|
||||
in order to restore double clicking (bug 2194)
|
||||
|
||||
* QRef.[Ch]: add isValid member and use it (disable OK button
|
||||
when text widget is empty).
|
||||
|
||||
* QRef.C:
|
||||
* QRefDialog.C: assure that the browser items are correctly
|
||||
highlighted/not highlighted if a dialog is opened for the first
|
||||
time (was distorted by the refsLB->Selected signal).
|
||||
|
||||
* QRefDialog.C (refSelected): insert reference on double click/
|
||||
enter (bug 2187).
|
||||
|
||||
2005-10-19 Angus Leeming <leeming@lyx.org>
|
||||
|
||||
* lyx_gui.C (LApplication d-tor): remove code to unlock
|
||||
|
@ -86,7 +86,7 @@ void QRef::update_contents()
|
||||
|
||||
updateRefs();
|
||||
|
||||
bc().invalid();
|
||||
bc().valid(isValid());
|
||||
}
|
||||
|
||||
|
||||
@ -154,6 +154,8 @@ void QRef::redoRefs()
|
||||
dialog_->refsLB->blockSignals(true);
|
||||
dialog_->referenceED->blockSignals(true);
|
||||
|
||||
int lastref = dialog_->refsLB->currentItem();
|
||||
|
||||
dialog_->refsLB->setAutoUpdate(false);
|
||||
dialog_->refsLB->clear();
|
||||
|
||||
@ -171,10 +173,17 @@ void QRef::redoRefs()
|
||||
|
||||
dialog_->referenceED->setText(tmp);
|
||||
|
||||
for (unsigned int i = 0; i < dialog_->refsLB->count(); ++i) {
|
||||
if (tmp == dialog_->refsLB->text(i))
|
||||
dialog_->refsLB->setCurrentItem(i);
|
||||
}
|
||||
// restore the last selection for new insets
|
||||
// but do not highlight it
|
||||
if (tmp.isEmpty() && lastref != -1
|
||||
&& lastref < int(dialog_->refsLB->count())) {
|
||||
dialog_->refsLB->setCurrentItem(lastref);
|
||||
dialog_->refsLB->clearSelection();
|
||||
} else
|
||||
for (unsigned int i = 0; i < dialog_->refsLB->count(); ++i) {
|
||||
if (tmp == dialog_->refsLB->text(i))
|
||||
dialog_->refsLB->setSelected(i, true);
|
||||
}
|
||||
|
||||
dialog_->refsLB->setAutoUpdate(true);
|
||||
dialog_->refsLB->update();
|
||||
@ -197,3 +206,9 @@ void QRef::updateRefs()
|
||||
dialog_->refsLB->setEnabled(!refs_.empty());
|
||||
redoRefs();
|
||||
}
|
||||
|
||||
|
||||
bool QRef::isValid()
|
||||
{
|
||||
return !dialog_->referenceED->text().isEmpty();
|
||||
}
|
||||
|
@ -27,6 +27,8 @@ public:
|
||||
friend class QRefDialog;
|
||||
|
||||
QRef();
|
||||
protected:
|
||||
virtual bool isValid();
|
||||
private:
|
||||
/// apply changes
|
||||
virtual void apply();
|
||||
|
@ -36,8 +36,7 @@ QRefDialog::QRefDialog(QRef * form)
|
||||
|
||||
void QRefDialog::changed_adaptor()
|
||||
{
|
||||
if (!referenceED->text().isEmpty())
|
||||
form_->changed();
|
||||
form_->changed();
|
||||
}
|
||||
|
||||
|
||||
@ -69,9 +68,19 @@ void QRefDialog::refHighlighted(const QString & sel)
|
||||
}
|
||||
|
||||
|
||||
void QRefDialog::refSelected(const QString &)
|
||||
void QRefDialog::refSelected(const QString & sel)
|
||||
{
|
||||
form_->gotoRef();
|
||||
if (form_->readOnly())
|
||||
return;
|
||||
|
||||
int const cur_item = refsLB->currentItem();
|
||||
bool const cur_item_selected = cur_item >= 0 ?
|
||||
refsLB->isSelected(cur_item) : false;
|
||||
|
||||
if (cur_item_selected)
|
||||
referenceED->setText(sel);
|
||||
// <enter> or double click, inserts ref and closes dialog
|
||||
form_->slotOK();
|
||||
}
|
||||
|
||||
|
||||
|
@ -399,6 +399,12 @@
|
||||
<receiver>QRefDialogBase</receiver>
|
||||
<slot>refHighlighted(const QString&)</slot>
|
||||
</connection>
|
||||
<connection>
|
||||
<sender>refsLB</sender>
|
||||
<signal>selected(const QString&)</signal>
|
||||
<receiver>QRefDialogBase</receiver>
|
||||
<slot>refSelected(const QString&)</slot>
|
||||
</connection>
|
||||
<connection>
|
||||
<sender>sortCB</sender>
|
||||
<signal>toggled(bool)</signal>
|
||||
|
@ -56,6 +56,9 @@ What's new
|
||||
- The Return key is no longer bound to the Goto button in the reference
|
||||
dialog. [Qt only].
|
||||
|
||||
- Double clicking in the reference dialog now inserts a reference
|
||||
(bug 2187) [Qt only].
|
||||
|
||||
- Searching backwards in the citation dialog always skipped one result
|
||||
(bug 2002). Fixed now.
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user