mirror of
https://git.lyx.org/repos/lyx.git
synced 2024-11-25 19:07:45 +00:00
restore double clicking in the QRefs dialog (bug 2194), plus some small ui fixes.
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@10714 a592a061-630c-0410-9148-cb99ea01b6c8
This commit is contained in:
parent
49de27a95f
commit
10a5c58dbd
@ -1,3 +1,16 @@
|
||||
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).
|
||||
|
||||
2005-12-14 Hartmut Haase <hha4491@atomstromfrei.de>
|
||||
|
||||
* ui/QPrefLatexModule.ui: make the papersize choices in
|
||||
|
@ -100,7 +100,7 @@ void QRef::update_contents()
|
||||
dialog_->bufferCO->setCurrentItem(controller().getBufferNum());
|
||||
|
||||
updateRefs();
|
||||
bc().valid(false);
|
||||
bc().valid(isValid());
|
||||
}
|
||||
|
||||
|
||||
@ -192,13 +192,15 @@ void QRef::redoRefs()
|
||||
dialog_->referenceED->setText(tmp);
|
||||
|
||||
// restore the last selection for new insets
|
||||
// but do not highlight it
|
||||
if (tmp.isEmpty() && lastref != -1
|
||||
&& lastref < int(dialog_->refsLB->count()))
|
||||
&& lastref < int(dialog_->refsLB->count())) {
|
||||
dialog_->refsLB->setCurrentItem(lastref);
|
||||
else
|
||||
dialog_->refsLB->clearSelection();
|
||||
} else
|
||||
for (unsigned int i = 0; i < dialog_->refsLB->count(); ++i) {
|
||||
if (tmp == dialog_->refsLB->text(i))
|
||||
dialog_->refsLB->setCurrentItem(i);
|
||||
dialog_->refsLB->setSelected(i, true);
|
||||
}
|
||||
|
||||
dialog_->refsLB->setAutoUpdate(true);
|
||||
@ -223,5 +225,11 @@ void QRef::updateRefs()
|
||||
redoRefs();
|
||||
}
|
||||
|
||||
|
||||
bool QRef::isValid()
|
||||
{
|
||||
return !dialog_->referenceED->text().isEmpty();
|
||||
}
|
||||
|
||||
} // namespace frontend
|
||||
} // namespace lyx
|
||||
|
@ -30,6 +30,8 @@ public:
|
||||
friend class QRefDialog;
|
||||
|
||||
QRef(Dialog &);
|
||||
protected:
|
||||
virtual bool isValid();
|
||||
private:
|
||||
/// apply changes
|
||||
virtual void apply();
|
||||
|
@ -44,8 +44,7 @@ void QRefDialog::show()
|
||||
|
||||
void QRefDialog::changed_adaptor()
|
||||
{
|
||||
if (!referenceED->text().isEmpty())
|
||||
form_->changed();
|
||||
form_->changed();
|
||||
}
|
||||
|
||||
|
||||
@ -82,7 +81,12 @@ void QRefDialog::refSelected(const QString & sel)
|
||||
if (form_->readOnly())
|
||||
return;
|
||||
|
||||
referenceED->setText(sel);
|
||||
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();
|
||||
}
|
||||
|
@ -409,6 +409,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>
|
||||
|
Loading…
Reference in New Issue
Block a user