Skip to content

Commit

Permalink
Merge pull request thinkle#974 from saxon-s/plugins
Browse files Browse the repository at this point in the history
Fix: Allow gtkspellcheck as alternative to gtkspell
  • Loading branch information
saxon-s authored May 14, 2020
2 parents 7a9d79b + 676ca7b commit 543cee2
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 543cee2

Please sign in to comment.