]> 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 74d7c1508d88f35c1ba26d18af7176a1c749c2b0..8c653d88f825f0a4ca3f6b5236bd55d1399fc9a4 100644 (file)
@@ -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);
@@ -709,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;
@@ -772,5 +771,5 @@ Dialog * createGuiCitation(GuiView & lv) { return new GuiCitation(lv); }
 } // namespace frontend
 } // namespace lyx
 
-#include "GuiCitation_moc.cpp"
+#include "moc_GuiCitation.cpp"