]> git.lyx.org Git - features.git/commitdiff
GuiSpellchecker: add 'Find Next' and 'Replace All' buttons.
authorAbdelrazak Younes <younes@lyx.org>
Sat, 4 Jul 2009 17:15:27 +0000 (17:15 +0000)
committerAbdelrazak Younes <younes@lyx.org>
Sat, 4 Jul 2009 17:15:27 +0000 (17:15 +0000)
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@30350 a592a061-630c-0410-9148-cb99ea01b6c8

src/frontends/qt4/GuiSpellchecker.cpp
src/frontends/qt4/GuiSpellchecker.h
src/frontends/qt4/ui/SpellcheckerUi.ui

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());
index 3d9f3c093e8b5f30df3f626c5c569d1c7cdf6620..dfa64f222024f98d8b346b8f881b2141141eb0de 100644 (file)
@@ -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();
index fbf0ef2c27eabf2437f806c16cca4f703ac25e86..79b2209274f3440ced9a6a945ac6e479660b5998 100644 (file)
@@ -6,7 +6,7 @@
     <x>0</x>
     <y>0</y>
     <width>259</width>
-    <height>536</height>
+    <height>506</height>
    </rect>
   </property>
   <property name="windowTitle" >
       </property>
      </widget>
     </item>
+    <item row="1" column="1" >
+     <widget class="QPushButton" name="findNextPB" >
+      <property name="toolTip" >
+       <string>Replace word with current choice</string>
+      </property>
+      <property name="text" >
+       <string>&amp;Find Next</string>
+      </property>
+     </widget>
+    </item>
     <item row="2" column="0" >
      <widget class="QLabel" name="TextLabel1" >
       <property name="text" >
       </property>
      </widget>
     </item>
-    <item rowspan="4" row="5" column="0" >
+    <item row="4" column="1" >
+     <widget class="QPushButton" name="replaceAllPB" >
+      <property name="toolTip" >
+       <string>Replace word with current choice</string>
+      </property>
+      <property name="text" >
+       <string>Replace &amp;All</string>
+      </property>
+     </widget>
+    </item>
+    <item rowspan="5" row="5" column="0" >
      <widget class="QListWidget" name="suggestionsLW" />
     </item>
-    <item row="5" column="1" >
+    <item row="6" column="1" >
      <widget class="QPushButton" name="ignorePB" >
       <property name="toolTip" >
        <string>Ignore this word</string>
       </property>
      </widget>
     </item>
-    <item row="6" column="1" >
+    <item row="7" column="1" >
      <widget class="QPushButton" name="ignoreAllPB" >
       <property name="toolTip" >
        <string>Ignore this word throughout this session</string>
       </property>
      </widget>
     </item>
-    <item row="7" column="1" >
+    <item row="8" column="1" >
      <widget class="QPushButton" name="addPB" >
       <property name="toolTip" >
        <string>Add the word to your personal dictionary</string>
       </property>
      </widget>
     </item>
-    <item row="8" column="1" >
+    <item row="9" column="1" >
      <spacer name="spacer" >
       <property name="orientation" >
        <enum>Qt::Vertical</enum>
       </property>
      </spacer>
     </item>
-    <item row="9" column="0" >
+    <item row="10" column="0" >
      <widget class="QProgressBar" name="spellcheckPR" >
       <property name="value" >
        <number>24</number>