]> git.lyx.org Git - lyx.git/blobdiff - src/frontends/qt4/GuiCitation.cpp
Give focus to the filter in GuiRef
[lyx.git] / src / frontends / qt4 / GuiCitation.cpp
index c121008dc5376abffa6fbe856dc8b9f299ca3410..f19837e3dc4eeeb57fc4d4db2d7a56c1080f8766 100644 (file)
@@ -140,7 +140,7 @@ GuiCitation::GuiCitation(GuiView & lv)
        connect(textAfterED, SIGNAL(returnPressed()),
                this, SLOT(on_okPB_clicked()));
 
-       selectionManager = new GuiSelectionManager(availableLV, selectedLV,
+       selectionManager = new GuiSelectionManager(this, availableLV, selectedLV,
                        addPB, deletePB, upPB, downPB, &available_model_, &selected_model_, 1);
        connect(selectionManager, SIGNAL(selectionChanged()),
                this, SLOT(setCitedKeys()));
@@ -155,6 +155,13 @@ GuiCitation::GuiCitation(GuiView & lv)
                this, SLOT(filterChanged(QString)));
        connect(filter_, SIGNAL(returnPressed()),
                this, SLOT(filterPressed()));
+#if (QT_VERSION < 0x050000)
+       connect(filter_, SIGNAL(downPressed()),
+               availableLV, SLOT(setFocus()));
+#else
+       connect(filter_, &FancyLineEdit::downPressed,
+               availableLV, [=](){ focusAndHighlight(availableLV); });
+#endif
        connect(regexp_, SIGNAL(triggered()),
                this, SLOT(regexChanged()));
        connect(casesense_, SIGNAL(triggered()),
@@ -172,12 +179,6 @@ GuiCitation::GuiCitation(GuiView & lv)
 }
 
 
-GuiCitation::~GuiCitation()
-{
-       delete selectionManager;
-}
-
-
 void GuiCitation::closeEvent(QCloseEvent * e)
 {
        clearSelection();
@@ -1052,7 +1053,7 @@ void GuiCitation::restoreSession()
        QSettings settings;
        regexp_->setChecked(settings.value(sessionKey() + "/regex").toBool());
        casesense_->setChecked(settings.value(sessionKey() + "/casesensitive").toBool());
-       instant_->setChecked(settings.value(sessionKey() + "/autofind").toBool());
+       instant_->setChecked(settings.value(sessionKey() + "/autofind", true).toBool());
        style_ = settings.value(sessionKey() + "/citestyle").toInt();
        updateFilterHint();
 }