check OSError from gtkspell.py. Fixes #4897

This commit is contained in:
Yann Leboulanger 2009-03-11 09:17:23 +00:00
parent aa44b8466a
commit 5301dcd4a0
4 changed files with 5 additions and 5 deletions

View File

@ -314,7 +314,7 @@ class ChatControlBase(MessageControl):
if lang: if lang:
self.msg_textview.lang = lang self.msg_textview.lang = lang
spell.set_language(lang) spell.set_language(lang)
except (gobject.GError, RuntimeError, TypeError): except (gobject.GError, RuntimeError, TypeError, OSError):
dialogs.AspellDictError(lang) dialogs.AspellDictError(lang)
def on_msg_textview_populate_popup(self, textview, menu): def on_msg_textview_populate_popup(self, textview, menu):

View File

@ -636,7 +636,7 @@ class PreferencesWindow:
if isinstance(ctrl, chat_control.ChatControlBase): if isinstance(ctrl, chat_control.ChatControlBase):
try: try:
spell_obj = gtkspell.get_from_text_view(ctrl.msg_textview) spell_obj = gtkspell.get_from_text_view(ctrl.msg_textview)
except (TypeError, RuntimeError): except (TypeError, RuntimeError, OSError):
spell_obj = None spell_obj = None
if not spell_obj: if not spell_obj:
@ -663,7 +663,7 @@ class PreferencesWindow:
tv = gtk.TextView() tv = gtk.TextView()
try: try:
gtkspell.Spell(tv, lang) gtkspell.Spell(tv, lang)
except (TypeError, RuntimeError): except (TypeError, RuntimeError, OSError):
dialogs.ErrorDialog( dialogs.ErrorDialog(
_('Dictionary for lang %s not available') % lang, _('Dictionary for lang %s not available') % lang,
_('You have to install %s dictionary to use spellchecking, or ' _('You have to install %s dictionary to use spellchecking, or '

View File

@ -2203,7 +2203,7 @@ class SingleMessageWindow:
lang = gajim.LANG lang = gajim.LANG
gtkspell.Spell(self.conversation_textview.tv, lang) gtkspell.Spell(self.conversation_textview.tv, lang)
gtkspell.Spell(self.message_textview, lang) gtkspell.Spell(self.message_textview, lang)
except (gobject.GError, TypeError, RuntimeError): except (gobject.GError, TypeError, RuntimeError, OSError):
AspellDictError(lang) AspellDictError(lang)
self.prepare_widgets_for(self.action) self.prepare_widgets_for(self.action)

View File

@ -3409,7 +3409,7 @@ class Interface:
try: try:
import gtkspell import gtkspell
spell = gtkspell.Spell(tv, lang) spell = gtkspell.Spell(tv, lang)
except (ImportError, TypeError, RuntimeError): except (ImportError, TypeError, RuntimeError, OSError):
dialogs.AspellDictError(lang) dialogs.AspellDictError(lang)
if gajim.config.get('soundplayer') == '': if gajim.config.get('soundplayer') == '':