On Fri, Mar 07, 2003 at 06:33:08PM +0100, Jean-Marc Lasgouttes wrote:
> Dekel> I want to port the following patch to 1.3.1cvs (the patch is
> Dekel> against HEAD). It add 'hspell' option to the list of
> Dekel> spell-checkers (hspell is a spell-checker for Hebrew). Is it OK
> Dekel> ?
> 
> Well, I want to see the final patch first. Does xforms need a similar
> patch?

I've attached a patch against 1.3.1cvs
Xforms needs such a patch, but since the xforms spellcheking dialog cannot
show Hebrew properly, it doesn't make much sense to make such a patch.

> [Sorry for the nice paragraph rebreak]
> 
> Is it really necessary to use such a loop? Isn;t there some kind of
> setCurrentItem(QString)? 

There is, but only in QT3 (according to the docs).

> More generally, I am not a very big fan of last-minute fixes. This is
> not even in 1.4.0.cvs... Can this wait until 1.3.2? We have other
> patches in the queue already.

I guess it can wait, but the patch is quite small.
 
Index: ChangeLog
===================================================================
RCS file: /usr/local/lyx/cvsroot/lyx-devel/src/frontends/qt2/ChangeLog,v
retrieving revision 1.389.2.13
diff -u -p -r1.389.2.13 ChangeLog
--- ChangeLog   6 Mar 2003 12:29:41 -0000       1.389.2.13
+++ ChangeLog   7 Mar 2003 18:10:36 -0000
@@ -1,3 +1,8 @@
+2003-03-07  Dekel Tsur  <[EMAIL PROTECTED]>
+
+       * QPrefs.C:
+       * QPrefSpellcheckerModule.ui: Add 'hspell' option.
+
 2003-03-06  Dekel Tsur  <[EMAIL PROTECTED]>
 
        * qfont_loader.C (available): Rewrite as the old version did not
Index: QPrefs.C
===================================================================
RCS file: /usr/local/lyx/cvsroot/lyx-devel/src/frontends/qt2/QPrefs.C,v
retrieving revision 1.21.2.1
diff -u -p -r1.21.2.1 QPrefs.C
--- QPrefs.C    15 Feb 2003 21:46:21 -0000      1.21.2.1
+++ QPrefs.C    7 Mar 2003 18:10:36 -0000
@@ -188,10 +188,7 @@ void QPrefs::apply()
 
        QPrefSpellcheckerModule * spellmod(dialog_->spellcheckerModule);
 
-       if (spellmod->spellCommandCO->currentItem() == 0)
-               rc.isp_command = "ispell";
-       else
-               rc.isp_command = "aspell";
+       rc.isp_command = fromqstr(spellmod->spellCommandCO->currentText());
 
        // FIXME: remove isp_use_alt_lang
        rc.isp_alt_lang = fromqstr(spellmod->altLanguageED->text());
@@ -441,8 +438,13 @@ void QPrefs::update_contents()
 
        QPrefSpellcheckerModule * spellmod(dialog_->spellcheckerModule);
 
-       item = (rc.isp_command == "ispell") ? 0 : 1;
-       spellmod->spellCommandCO->setCurrentItem(item);
+       QString const tmp = qt_(rc.isp_command);
+       for (int i = 0; i < spellmod->spellCommandCO->count(); ++i) {
+               if (spellmod->spellCommandCO->text(i) == tmp) {
+                       spellmod->spellCommandCO->setCurrentItem(i);
+                       break;
+               }
+       }
        // FIXME: remove isp_use_alt_lang
        spellmod->altLanguageED->setText(toqstr(rc.isp_alt_lang));
        // FIXME: remove isp_use_esc_chars
Index: ui/QPrefSpellcheckerModule.ui
===================================================================
RCS file: 
/usr/local/lyx/cvsroot/lyx-devel/src/frontends/qt2/ui/QPrefSpellcheckerModule.ui,v
retrieving revision 1.4.2.1
diff -u -p -r1.4.2.1 QPrefSpellcheckerModule.ui
--- ui/QPrefSpellcheckerModule.ui       17 Feb 2003 00:40:29 -0000      1.4.2.1
+++ ui/QPrefSpellcheckerModule.ui       7 Mar 2003 18:10:36 -0000
@@ -193,6 +193,12 @@
                             <string>aspell</string>
                         </property>
                     </item>
+                    <item>
+                        <property>
+                            <name>text</name>
+                            <string>hspell</string>
+                        </property>
+                    </item>
                     <property stdset="1">
                         <name>name</name>
                         <cstring>spellCommandCO</cstring>

Reply via email to