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
This commit is contained in:
Abdelrazak Younes 2009-07-04 17:15:27 +00:00
parent 93ea135eb5
commit c95f44b0b1
3 changed files with 49 additions and 7 deletions

View 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());

View 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();

View 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" >
@ -31,6 +31,16 @@
</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" >
@ -89,10 +99,20 @@
</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>
@ -102,7 +122,7 @@
</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>
@ -112,7 +132,7 @@
</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>
@ -122,7 +142,7 @@
</property>
</widget>
</item>
<item row="8" column="1" >
<item row="9" column="1" >
<spacer name="spacer" >
<property name="orientation" >
<enum>Qt::Vertical</enum>
@ -138,7 +158,7 @@
</property>
</spacer>
</item>
<item row="9" column="0" >
<item row="10" column="0" >
<widget class="QProgressBar" name="spellcheckPR" >
<property name="value" >
<number>24</number>