X-Git-Url: https://git.lyx.org/gitweb/?a=blobdiff_plain;f=src%2Ffrontends%2Fqt4%2FGuiCitation.cpp;h=35f7e913a7fc835638c4e4251d2a52fa78cdb452;hb=425d092204118ea6c24c28e85fdf03fcf2bb51a4;hp=74d7c1508d88f35c1ba26d18af7176a1c749c2b0;hpb=83f0903b4aaccefcd3fa80989b3117e511e05423;p=lyx.git diff --git a/src/frontends/qt4/GuiCitation.cpp b/src/frontends/qt4/GuiCitation.cpp index 74d7c1508d..35f7e913a7 100644 --- a/src/frontends/qt4/GuiCitation.cpp +++ b/src/frontends/qt4/GuiCitation.cpp @@ -105,8 +105,6 @@ GuiCitation::GuiCitation(GuiView & lv) connect(textAfterED, SIGNAL(returnPressed()), this, SLOT(on_okPB_clicked())); - connect(this, SIGNAL(rejected()), this, SLOT(cleanUp())); - selectionManager = new GuiSelectionManager(availableLV, selectedLV, addPB, deletePB, upPB, downPB, &available_model_, &selected_model_); connect(selectionManager, SIGNAL(selectionChanged()), @@ -116,6 +114,8 @@ GuiCitation::GuiCitation(GuiView & lv) connect(selectionManager, SIGNAL(okHook()), this, SLOT(on_okPB_clicked())); + setFocusProxy(availableLV); + // FIXME: the sizeHint() for this is _way_ too high infoML->setFixedHeight(60); } @@ -127,13 +127,6 @@ GuiCitation::~GuiCitation() } -void GuiCitation::cleanUp() -{ - clearParams(); - close(); -} - - void GuiCitation::closeEvent(QCloseEvent * e) { clearSelection(); @@ -238,8 +231,14 @@ void GuiCitation::updateFormatting(CiteStyle currentStyle) bool const isNocite = currentStyle == NOCITE; - fulllistCB->setEnabled(natbib_engine && haveSelection && !isNocite); - forceuppercaseCB->setEnabled(natbib_engine && haveSelection && !isNocite); + bool const isCiteyear = + currentStyle == CITEYEAR || + currentStyle == CITEYEARPAR; + + fulllistCB->setEnabled(natbib_engine && haveSelection && !isNocite + && !isCiteyear); + forceuppercaseCB->setEnabled(natbib_engine && haveSelection + && !isNocite && !isCiteyear); textBeforeED->setEnabled(!basic_engine && haveSelection && !isNocite); textBeforeLA->setEnabled(!basic_engine && haveSelection && !isNocite); textAfterED->setEnabled(haveSelection && !isNocite); @@ -322,7 +321,7 @@ void GuiCitation::fillFields(BiblioInfo const & bi) int const oldIndex = fieldsCO->currentIndex(); fieldsCO->clear(); QStringList const fields = to_qstring_list(bi.getFields()); - fieldsCO->insertItem(0, qt_("All Fields")); + fieldsCO->insertItem(0, qt_("All fields")); fieldsCO->insertItem(1, qt_("Keys")); fieldsCO->insertItems(2, fields); if (oldIndex != -1 && oldIndex < fieldsCO->count()) @@ -337,7 +336,7 @@ void GuiCitation::fillEntries(BiblioInfo const & bi) int const oldIndex = entriesCO->currentIndex(); entriesCO->clear(); QStringList const entries = to_qstring_list(bi.getEntries()); - entriesCO->insertItem(0, qt_("All Entry Types")); + entriesCO->insertItem(0, qt_("All entry types")); entriesCO->insertItems(1, entries); if (oldIndex != -1 && oldIndex < entriesCO->count()) entriesCO->setCurrentIndex(oldIndex); @@ -708,8 +707,8 @@ vector GuiCitation::searchKeys(BiblioInfo const & bi, data = to_utf8(*it); else if (field.empty()) data = to_utf8(*it) + ' ' + to_utf8(kvm.allData()); - else if (kvm.hasField(field)) - data = to_utf8(kvm.getValueForField(field)); + else + data = to_utf8(kvm[field]); if (data.empty()) continue; @@ -736,6 +735,7 @@ void GuiCitation::dispatchParams() BiblioInfo const & GuiCitation::bibInfo() const { + buffer().checkBibInfoCache(); return buffer().masterBibInfo(); } @@ -772,5 +772,5 @@ Dialog * createGuiCitation(GuiView & lv) { return new GuiCitation(lv); } } // namespace frontend } // namespace lyx -#include "GuiCitation_moc.cpp" +#include "moc_GuiCitation.cpp"