#include "GuiSearch.h"
+#include "qt_helpers.h"
+
#include "FuncRequest.h"
#include "lyxfind.h"
-#include "qt_helpers.h"
-
#include <QLineEdit>
-#include <QCloseEvent>
#include <QShowEvent>
using namespace std;
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()));
void GuiSearch::showEvent(QShowEvent * e)
{
+ findPB->setFocus();
findCO->lineEdit()->selectAll();
GuiDialog::showEvent(e);
}
-void GuiSearch::closeEvent(QCloseEvent * e)
-{
- slotClose();
- GuiDialog::closeEvent(e);
-}
-
-
void GuiSearch::findChanged()
{
if (findCO->currentText().isEmpty()) {
bool forward, bool all)
{
docstring const data =
- replace2string(search, replace, casesensitive,
+ replace2string(replace, search, casesensitive,
matchword, all, forward);
dispatch(FuncRequest(LFUN_WORD_REPLACE, data));
}
} // namespace lyx
-#include "GuiSearch_moc.cpp"
+#include "moc_GuiSearch.cpp"