X-Git-Url: https://git.lyx.org/gitweb/?a=blobdiff_plain;f=src%2Ffrontends%2Fqt4%2FGuiRef.cpp;h=5d46a471c710bb980c0c062085c8f3a480d405b5;hb=b91e2b99986c0f957ba27eeba74b5ae0460d73bc;hp=907568761a224fbf06830fb0e3bff5dead70feb2;hpb=439338850831ee099dbceb3fc5d3438e3e7c77cc;p=lyx.git diff --git a/src/frontends/qt4/GuiRef.cpp b/src/frontends/qt4/GuiRef.cpp index 907568761a..5d46a471c7 100644 --- a/src/frontends/qt4/GuiRef.cpp +++ b/src/frontends/qt4/GuiRef.cpp @@ -76,13 +76,12 @@ GuiRef::GuiRef(GuiView & lv) sortingCO->addItem(qt_("Alphabetically (Case-Insensitive)"), "nocase"); sortingCO->addItem(qt_("Alphabetically (Case-Sensitive)"), "case"); + buttonBox->button(QDialogButtonBox::Reset)->setText(qt_("&Update")); + buttonBox->button(QDialogButtonBox::Reset)->setToolTip(qt_("Update the label list")); + refsTW->setColumnCount(1); refsTW->header()->setVisible(false); - connect(okPB, SIGNAL(clicked()), this, SLOT(slotOK())); - connect(applyPB, SIGNAL(clicked()), this, SLOT(slotApply())); - connect(closePB, SIGNAL(clicked()), this, SLOT(slotClose())); - connect(closePB, SIGNAL(clicked()), this, SLOT(resetDialog())); connect(this, SIGNAL(rejected()), this, SLOT(dialogRejected())); connect(typeCO, SIGNAL(activated(int)), @@ -111,8 +110,6 @@ GuiRef::GuiRef(GuiView & lv) this, SLOT(groupToggled())); connect(gotoPB, SIGNAL(clicked()), this, SLOT(gotoClicked())); - connect(updatePB, SIGNAL(clicked()), - this, SLOT(updateClicked())); connect(bufferCO, SIGNAL(activated(int)), this, SLOT(updateClicked())); connect(pluralCB, SIGNAL(clicked()), @@ -125,9 +122,9 @@ GuiRef::GuiRef(GuiView & lv) enableBoxes(); bc().setPolicy(ButtonPolicy::NoRepeatedApplyReadOnlyPolicy); - bc().setOK(okPB); - bc().setApply(applyPB); - bc().setCancel(closePB); + bc().setOK(buttonBox->button(QDialogButtonBox::Ok)); + bc().setApply(buttonBox->button(QDialogButtonBox::Apply)); + bc().setCancel(buttonBox->button(QDialogButtonBox::Cancel)); bc().addReadOnly(typeCO); restored_buffer_ = -1; @@ -263,6 +260,28 @@ void GuiRef::groupToggled() } +void GuiRef::on_buttonBox_clicked(QAbstractButton * button) +{ + switch (buttonBox->standardButton(button)) { + case QDialogButtonBox::Ok: + slotOK(); + break; + case QDialogButtonBox::Apply: + slotApply(); + break; + case QDialogButtonBox::Cancel: + slotClose(); + resetDialog(); + break; + case QDialogButtonBox::Reset: + updateClicked(); + break; + default: + break; + } +} + + void GuiRef::updateClicked() { updateRefs(); @@ -309,9 +328,9 @@ void GuiRef::updateContents() typeCO->addItem(qt_(""), "pageref"); typeCO->addItem(qt_("on page "), "vpageref"); typeCO->addItem(qt_(" on page "), "vref"); + typeCO->addItem(qt_("Textual reference"), "nameref"); if (bufferview()->cursor().inTexted()) { typeCO->addItem(qt_("Formatted reference"), "formatted"); - typeCO->addItem(qt_("Textual reference"), "nameref"); typeCO->addItem(qt_("Label only"), "labelonly"); } else typeCO->addItem(qt_("Formatted reference"), "prettyref");