diff --git a/src/frontends/qt4/GuiCitation.cpp b/src/frontends/qt4/GuiCitation.cpp index e6af4f8237..c1e7fd74c6 100644 --- a/src/frontends/qt4/GuiCitation.cpp +++ b/src/frontends/qt4/GuiCitation.cpp @@ -92,8 +92,12 @@ GuiCitation::GuiCitation(GuiView & lv) this, SLOT(changed())); connect(textAfterED, SIGNAL(textChanged(QString)), this, SLOT(changed())); - connect(clearPB, SIGNAL(clicked()), - findLE, SLOT(clear())); + connect(findLE, SIGNAL(returnPressed()), + this, SLOT(on_searchPB_clicked())); + connect(textBeforeED, SIGNAL(returnPressed()), + this, SLOT(on_okPB_clicked())); + connect(textAfterED, SIGNAL(returnPressed()), + this, SLOT(on_okPB_clicked())); connect(this, SIGNAL(rejected()), this, SLOT(cleanUp())); selectionManager = new GuiSelectionManager(availableLV, selectedLV, @@ -420,10 +424,16 @@ void GuiCitation::on_citationStyleCO_currentIndexChanged(int index) void GuiCitation::on_findLE_textChanged(const QString & text) { - clearPB->setDisabled(text.isEmpty()); - if (text.isEmpty()) - findLE->setFocus(); - findText(text); + searchPB->setDisabled(text.isEmpty()); + if (!text.isEmpty()) + return; + findText(findLE->text()); + findLE->setFocus(); +} + +void GuiCitation::on_searchPB_clicked() +{ + findText(findLE->text()); } @@ -527,7 +537,7 @@ void GuiCitation::findKey(QString const & str, bool only_keys, last_case_sensitive = case_sensitive; last_reg_exp = reg_exp; - Qt::CaseSensitivity qtcase = case_sensitive? + Qt::CaseSensitivity qtcase = case_sensitive ? Qt::CaseSensitive: Qt::CaseInsensitive; QStringList keys; // If new string (str) contains the last searched one... diff --git a/src/frontends/qt4/GuiCitation.h b/src/frontends/qt4/GuiCitation.h index 5e07a24fa3..8863bc3a04 100644 --- a/src/frontends/qt4/GuiCitation.h +++ b/src/frontends/qt4/GuiCitation.h @@ -64,6 +64,7 @@ private Q_SLOTS: void on_cancelPB_clicked(); void on_restorePB_clicked(); void on_applyPB_clicked(); + void on_searchPB_clicked(); void on_findLE_textChanged(const QString & text); void on_fieldsCO_currentIndexChanged(int index); void on_entriesCO_currentIndexChanged(int index); diff --git a/src/frontends/qt4/ui/CitationUi.ui b/src/frontends/qt4/ui/CitationUi.ui index 6e385752d2..1a4cd5145b 100644 --- a/src/frontends/qt4/ui/CitationUi.ui +++ b/src/frontends/qt4/ui/CitationUi.ui @@ -33,7 +33,7 @@ - Move the selected citation up + Move the selected citation up (try Ctrl-Up) &Up @@ -41,6 +41,9 @@ + + false + @@ -52,7 +55,7 @@ - Move the selected citation down + Move the selected citation down (try Ctrl-Down) &Down @@ -60,6 +63,9 @@ + + false + @@ -77,9 +83,15 @@ + + The delete key works, too + D&elete + + false + @@ -92,13 +104,13 @@ - + The Enter key works, too &Add - true + false @@ -162,18 +174,27 @@ + + Hit Enter to search, or click Go! + - + false + + You can also hit Enter in the search box + - <- C&lear + &Go! + + + false @@ -384,6 +405,9 @@ &Restore + + false + @@ -405,10 +429,10 @@ &OK - true + false - true + false @@ -417,6 +441,9 @@ A&pply + + false + @@ -441,7 +468,7 @@ upPB downPB findLE - clearPB + searchPB caseCB regexCB citationStyleCO