]> git.lyx.org Git - features.git/blobdiff - src/frontends/qt4/GuiSpellchecker.cpp
GuiSpellchecker: add 'Find Next' and 'Replace All' buttons.
[features.git] / src / frontends / qt4 / GuiSpellchecker.cpp
index 2700d9e5f84b19ca7953b81e29d0ad0db49d3e25..aacac46dc9e6afa35fc4009a5b827bb680329ed8 100644 (file)
@@ -28,6 +28,7 @@
 #include "Language.h"
 #include "LyX.h"
 #include "LyXRC.h"
+#include "lyxfind.h"
 #include "Paragraph.h"
 #include "WordLangTuple.h"
 
@@ -147,6 +148,15 @@ void GuiSpellchecker::on_ignorePB_clicked()
 }
 
 
+void GuiSpellchecker::on_findNextPB_clicked()
+{
+       docstring const data = find2string(
+                               qstring_to_ucs4(d->ui.wordED->text()),
+                               true, true, true);
+       dispatch(FuncRequest(LFUN_WORD_FIND, data));
+}
+
+
 void GuiSpellchecker::on_replacePB_clicked()
 {
        docstring const replacement = qstring_to_ucs4(d->ui.replaceCO->currentText());
@@ -163,6 +173,16 @@ void GuiSpellchecker::on_replacePB_clicked()
 }
 
 
+void GuiSpellchecker::on_replaceAllPB_clicked()
+{
+       docstring const data = replace2string(
+               qstring_to_ucs4(d->ui.wordED->text()),
+               qstring_to_ucs4(d->ui.replaceCO->currentText()),
+               true, true, true, true);
+       dispatch(FuncRequest(LFUN_WORD_REPLACE, data));
+}
+
+
 void GuiSpellchecker::updateSuggestions(docstring_list & words)
 {
        QString const suggestion = toqstr(d->word_.word());