From c95f44b0b1a15d62ab480008f39b625157a44d8a Mon Sep 17 00:00:00 2001 From: Abdelrazak Younes Date: Sat, 4 Jul 2009 17:15:27 +0000 Subject: [PATCH] GuiSpellchecker: add 'Find Next' and 'Replace All' buttons. git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@30350 a592a061-630c-0410-9148-cb99ea01b6c8 --- src/frontends/qt4/GuiSpellchecker.cpp | 20 +++++++++++++++ src/frontends/qt4/GuiSpellchecker.h | 2 ++ src/frontends/qt4/ui/SpellcheckerUi.ui | 34 ++++++++++++++++++++------ 3 files changed, 49 insertions(+), 7 deletions(-) diff --git a/src/frontends/qt4/GuiSpellchecker.cpp b/src/frontends/qt4/GuiSpellchecker.cpp index 2700d9e5f8..aacac46dc9 100644 --- a/src/frontends/qt4/GuiSpellchecker.cpp +++ b/src/frontends/qt4/GuiSpellchecker.cpp @@ -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()); diff --git a/src/frontends/qt4/GuiSpellchecker.h b/src/frontends/qt4/GuiSpellchecker.h index 3d9f3c093e..dfa64f2220 100644 --- a/src/frontends/qt4/GuiSpellchecker.h +++ b/src/frontends/qt4/GuiSpellchecker.h @@ -35,6 +35,8 @@ public: private Q_SLOTS: void on_closePB_clicked(); + void on_findNextPB_clicked(); + void on_replaceAllPB_clicked(); void on_suggestionsLW_itemChanged(QListWidgetItem *); void on_replaceCO_highlighted(const QString & str); void on_ignoreAllPB_clicked(); diff --git a/src/frontends/qt4/ui/SpellcheckerUi.ui b/src/frontends/qt4/ui/SpellcheckerUi.ui index fbf0ef2c27..79b2209274 100644 --- a/src/frontends/qt4/ui/SpellcheckerUi.ui +++ b/src/frontends/qt4/ui/SpellcheckerUi.ui @@ -6,7 +6,7 @@ 0 0 259 - 536 + 506 @@ -31,6 +31,16 @@ + + + + Replace word with current choice + + + &Find Next + + + @@ -89,10 +99,20 @@ - + + + + Replace word with current choice + + + Replace &All + + + + - + Ignore this word @@ -102,7 +122,7 @@ - + Ignore this word throughout this session @@ -112,7 +132,7 @@ - + Add the word to your personal dictionary @@ -122,7 +142,7 @@ - + Qt::Vertical @@ -138,7 +158,7 @@ - + 24 -- 2.39.2