Just log a warning rather than show an error dialog if spell checker cannot be imported

svn: r20197
This commit is contained in:
Gary Burton 2012-08-08 21:50:38 +00:00
parent b4ee8915d6
commit 97f26ed118

View File

@ -49,12 +49,19 @@ LOG = logging.getLogger(".Spell")
#
#-------------------------------------------------------------------------
from gi.repository import Gtk
from gi import Repository
try:
from gi.repository import Gtkspell
HAVE_GTKSPELL = True
except ImportError:
HAVE_GTKSPELL = False
HAVE_GTKSPELL = False
# Attempting to import gtkspell gives an error dialog if gtkspell is not
# available so test first and log just a warning to the console instead.
repository = Repository.get_default()
if repository.enumerate_versions("Gtkspell"):
try:
from gi.repository import Gtkspell
HAVE_GTKSPELL = True
except:
pass
if not HAVE_GTKSPELL:
LOG.warn(_("Spelling checker is not installed"))