]> git.lyx.org Git - features.git/commitdiff
Fixed spellchecker problems.
authorJürgen Vigna <jug@sad.it>
Mon, 22 Oct 2001 21:17:06 +0000 (21:17 +0000)
committerJürgen Vigna <jug@sad.it>
Mon, 22 Oct 2001 21:17:06 +0000 (21:17 +0000)
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@2910 a592a061-630c-0410-9148-cb99ea01b6c8

src/ChangeLog
src/frontends/controllers/ChangeLog
src/frontends/controllers/ControlSpellchecker.C
src/sp_pspell.h
src/sp_spell.C

index 3edc48f0545ca8ba94571e5731fca108588ccd96..8e86c9a2205681162679cf61aa25508b78bcbaa0 100644 (file)
@@ -1,3 +1,8 @@
+2001-10-22  Juergen Vigna  <jug@sad.it>
+
+       * sp_pspell.h (class PSpell): add alive function needed in the
+       controller to see if the spellchecker could be started.
+
 2001-10-22  Juergen Vigna  <jug@sad.it>
 
        * buffer.C (insertStringAsLines): modify the font for inserting
index 88f072d55c36e3921151efea2f66dfb22e210d2e..7a4c2f382adf465ea9677cbe698cdeda0b69bf8e 100644 (file)
@@ -1,3 +1,9 @@
+2001-10-22  Juergen Vigna  <jug@sad.it>
+
+       * ControlSpellchecker.C (clearParams): use the error_ message of the
+       speller_ if available when the spellchecker died.
+       (setParams): remove double error message display.
+
 2001-10-15  Angus Leeming  <a.leeming@ic.ac.uk>
 
        * ControlMinipage.[Ch] (getUnits): moved to helper_funcs.
index e724c585b2b6eea65b8585f02b633ba44f4b1253..0bd1ce36e7aecd861d073c6c2a1a3e97b48e90f9 100644 (file)
@@ -90,9 +90,11 @@ void ControlSpellchecker::setParams()
                }
                
                if (speller_->error() != 0) {
+#if 0
                        message_ = speller_->error();
                        // show error message
                        view().partialUpdate(2);
+#endif
                        clearParams();
                        return;
                }
@@ -215,9 +217,11 @@ void ControlSpellchecker::clearParams()
                message_ = _("Spellchecking completed! ") + message_;
 
        } else {
+               message_ = speller_->error();
                speller_->cleanUp();
-               message_ = _("The spell checker has died for some reason.\n"
-                            "Maybe it has been killed.");
+               if (message_.empty())
+                   message_ = _("The spell checker has died for some reason.\n"
+                                "Maybe it has been killed.");
 
                // make sure that the dialog is not launched
                emergency_exit_ = true;
index 0833c8945e3fab3791b306e4e966c900c4e0e61a..7c682bbc64f168c8dfb87a5d884398bccaaf5d57 100644 (file)
@@ -23,7 +23,7 @@ class PSpell : public SpellBase
     /// initialize spell checker
     void initialize(BufferParams const & params, string const & lang);
 
-    bool alive() { return true; }
+    bool alive() { return alive_; }
 
     /// clean up after error
     void cleanUp();
@@ -58,7 +58,8 @@ class PSpell : public SpellBase
     spellStatus flag;
 
     const char * error_;
-   
+
+    bool alive_;
 };
    
 #endif
index ce6323cfaa8b0bff415c390cdd6bb5742770d401..bb301cadd59b3d827426f45d4fb7d6fdb4bbee60 100644 (file)
@@ -74,13 +74,15 @@ extern void sigchldchecker(pid_t pid, int * status);
 
 
 PSpell::PSpell() 
-       : sc(0), els(0), spell_error_object(0), flag(ISP_UNKNOWN)
+       : sc(0), els(0), spell_error_object(0), flag(ISP_UNKNOWN),
+         alive_(false)
 {
 }
 
 
 PSpell::PSpell(BufferParams const & params, string const & lang)
-       : sc(0), els(0), spell_error_object(0), flag(ISP_UNKNOWN)
+       : sc(0), els(0), spell_error_object(0), flag(ISP_UNKNOWN),
+         alive_(false)
 {
        initialize(params, lang);
 }
@@ -106,6 +108,7 @@ void PSpell::initialize(BufferParams const &, string const & lang)
                error_ = 0;
                sc = to_pspell_manager(spell_error_object);
                spell_error_object = 0;
+               alive_ = true;
        }
 }