From 2642fc5409fef63ee59bf4fdd012b35ff7cacee2 Mon Sep 17 00:00:00 2001 From: John Ralls Date: Sat, 8 Mar 2014 16:41:04 -0800 Subject: [PATCH] 6854: Spelling messages at random cause hang for a few seconds. Improve error message to conditionally explain that there is no dictionary if that's in fact the case; otherwise log the actual exception string. --- gramps/gui/spell.py | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/gramps/gui/spell.py b/gramps/gui/spell.py index c9c0e2427..42930bbdb 100644 --- a/gramps/gui/spell.py +++ b/gramps/gui/spell.py @@ -139,11 +139,14 @@ class Spell(object): #available in GtkSpell since version 3.0.3 (2013-06-04) pass self._active_spellcheck = spellcheck_code - except: + except Exception as err: # attaching the spellchecker will fail if # the language does not exist # and presumably if there is no dictionary - LOG.warn(_("Spelling checker could not be attached to TextView")) + if not self.gtkspell_spell.get_language_list(): + LOG.warn(_("You have no installed dictionaries. Either install one or disable spell checking")) + else: + LOG.warn(_("Spelling checker initialization failed: %s"), err) else: if spellcheck_code == 'on': return