X-Git-Url: https://git.lyx.org/gitweb/?a=blobdiff_plain;f=src%2Ffrontends%2Fqt4%2FGuiSearch.cpp;h=a8f10e7c63cf59b1169b0c5b59911e2cb495c9d8;hb=425d092204118ea6c24c28e85fdf03fcf2bb51a4;hp=ee6bdfda72298bf84c7594e03ef0c6472c8eeaec;hpb=42015a8ebd17092c9b55c9519015119d04f52218;p=lyx.git diff --git a/src/frontends/qt4/GuiSearch.cpp b/src/frontends/qt4/GuiSearch.cpp index ee6bdfda72..a8f10e7c63 100644 --- a/src/frontends/qt4/GuiSearch.cpp +++ b/src/frontends/qt4/GuiSearch.cpp @@ -14,16 +14,15 @@ #include "GuiSearch.h" +#include "qt_helpers.h" + #include "FuncRequest.h" #include "lyxfind.h" -#include "qt_helpers.h" - #include -#include - -using std::string; +#include +using namespace std; namespace lyx { namespace frontend { @@ -34,15 +33,14 @@ static void uniqueInsert(QComboBox * box, QString const & text) if (box->itemText(i) == text) return; - box->addItem(text); + box->insertItem(0, text); } GuiSearch::GuiSearch(GuiView & lv) - : GuiDialog(lv, "findreplace") + : GuiDialog(lv, "findreplace", qt_("Find and Replace")) { setupUi(this); - setViewTitle(_("Find and Replace")); connect(closePB, SIGNAL(clicked()), this, SLOT(slotClose())); connect(findPB, SIGNAL(clicked()), this, SLOT(findClicked())); @@ -64,17 +62,11 @@ GuiSearch::GuiSearch(GuiView & lv) } -void GuiSearch::showView() +void GuiSearch::showEvent(QShowEvent * e) { + findPB->setFocus(); findCO->lineEdit()->selectAll(); - GuiDialog::showView(); -} - - -void GuiSearch::closeEvent(QCloseEvent * e) -{ - slotClose(); - GuiDialog::closeEvent(e); + GuiDialog::showEvent(e); } @@ -137,7 +129,7 @@ void GuiSearch::replace(docstring const & search, docstring const & replace, bool forward, bool all) { docstring const data = - replace2string(search, replace, casesensitive, + replace2string(replace, search, casesensitive, matchword, all, forward); dispatch(FuncRequest(LFUN_WORD_REPLACE, data)); } @@ -149,4 +141,4 @@ Dialog * createGuiSearch(GuiView & lv) { return new GuiSearch(lv); } } // namespace lyx -#include "GuiSearch_moc.cpp" +#include "moc_GuiSearch.cpp"