From 676ca7bbe157d0b7549188ad7ebf56f5ad7a2db5 Mon Sep 17 00:00:00 2001 From: saxon-s Date: Wed, 13 May 2020 21:28:33 -0700 Subject: [PATCH] Fix: Allow gtkspellcheck as alternative to gtkspell As of Ubuntu 16.04, 'gtkspell' is deprecated and replaced with 'gtkspellcheck'. This change modifies 'reccard_spellcheck_plugin.py' to import 'gtkspellcheck' if 'gtkspell' is not installed. Fixes #860 --- .../spellcheck/reccard_spellcheck_plugin.py | 15 ++++++++++----- 1 file changed, 10 insertions(+), 5 deletions(-) diff --git a/gourmet/plugins/spellcheck/reccard_spellcheck_plugin.py b/gourmet/plugins/spellcheck/reccard_spellcheck_plugin.py index d7c7b1f72..2f9bd657f 100644 --- a/gourmet/plugins/spellcheck/reccard_spellcheck_plugin.py +++ b/gourmet/plugins/spellcheck/reccard_spellcheck_plugin.py @@ -1,4 +1,9 @@ -import gtk, gtkspell +import gtk + +try: + import gtkspell +except: + import gtkspellcheck from gourmet.plugin import RecEditorPlugin, UIPlugin @@ -14,7 +19,10 @@ def activate (self, recEditor): for module in self.pluggable.modules: tvs = harvest_textviews(module.main) for tv in tvs: - gtkspell.Spell(tv) + try: + gtkspell.Spell(tv) + except: + gtkspellcheck.spellcheck.SpellChecker(tv) def harvest_textviews (widget): if isinstance(widget,gtk.TextView): @@ -27,6 +35,3 @@ def harvest_textviews (widget): elif hasattr(widget,'get_child'): tvs.extend(harvest_textviews(widget.get_child())) return tvs - - -