]> git.lyx.org Git - lyx.git/blobdiff - src/frontends/qt4/GuiCitation.cpp
If we are in a closeEvent, we don't want to close all buffers, because these may...
[lyx.git] / src / frontends / qt4 / GuiCitation.cpp
index 601b386221106c36f1c97476fc9fc9343bee385e..8c653d88f825f0a4ca3f6b5236bd55d1399fc9a4 100644 (file)
@@ -114,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);
 }
@@ -229,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);
@@ -700,7 +708,7 @@ vector<docstring> GuiCitation::searchKeys(BiblioInfo const & bi,
                else if (field.empty())
                        data = to_utf8(*it) + ' ' + to_utf8(kvm.allData());
                else if (kvm.hasField(field))
-                       data = to_utf8(kvm.getValueForField(field));
+                       data = to_utf8(kvm[field]);
                
                if (data.empty())
                        continue;
@@ -763,5 +771,5 @@ Dialog * createGuiCitation(GuiView & lv) { return new GuiCitation(lv); }
 } // namespace frontend
 } // namespace lyx
 
-#include "GuiCitation_moc.cpp"
+#include "moc_GuiCitation.cpp"