Skip to content

Commit

Permalink
Fix: Allow gtkspellcheck as alternative to gtkspell
Browse files Browse the repository at this point in the history
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 thinkle#860
  • Loading branch information
saxon-s committed May 14, 2020
1 parent 4de7a77 commit 676ca7b
Showing 1 changed file with 10 additions and 5 deletions.
15 changes: 10 additions & 5 deletions gourmet/plugins/spellcheck/reccard_spellcheck_plugin.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,9 @@
import gtk, gtkspell
import gtk

try:
import gtkspell
except:
import gtkspellcheck

from gourmet.plugin import RecEditorPlugin, UIPlugin

Expand All @@ -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):
Expand All @@ -27,6 +35,3 @@ def harvest_textviews (widget):
elif hasattr(widget,'get_child'):
tvs.extend(harvest_textviews(widget.get_child()))
return tvs



0 comments on commit 676ca7b

Please sign in to comment.