Skip to content

Commit

Permalink
Remove fallback to GtkSpell - Gspell is available everywhere now
Browse files Browse the repository at this point in the history
  • Loading branch information
innir committed Sep 4, 2020
1 parent 14f64d1 commit 8d068a5
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 16 deletions.
2 changes: 1 addition & 1 deletion README
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ Homepage: https://github.com/innir/gtranscribe
- python3-dbus
- gir1.2-gtk-3.0
- gir1.2-glib-2.0
- gir1.2-gspell-1 OR gir1.2-gtkspell3-3.0
- gir1.2-gspell-1
- gir1.2-gstreamer-1.0
- gir1.2-gst-plugins-base-1.0

Expand Down
19 changes: 4 additions & 15 deletions bin/gtranscribe
Original file line number Diff line number Diff line change
Expand Up @@ -31,14 +31,8 @@ from dbus.mainloop.glib import DBusGMainLoop
import gi
gi.require_version('Gtk', '3.0')
from gi.repository import GLib, Gtk, Gdk, GdkPixbuf
try:
gi.require_version('Gspell', '1')
from gi.repository import Gspell
SPELL_FALLBACK = False
except ValueError:
gi.require_version('GtkSpell', '3.0')
from gi.repository import GtkSpell
SPELL_FALLBACK = True
gi.require_version('Gspell', '1')
from gi.repository import Gspell

# Add project root directory to sys.path.
PROJECT_ROOT_DIRECTORY = os.path.dirname(os.path.dirname(
Expand Down Expand Up @@ -123,13 +117,8 @@ class gTranscribeWindow:
self.window.set_default_icon(icon)

self.text_view = builder.get_object("text_view")
if SPELL_FALLBACK:
schecker = GtkSpell.Checker()
schecker.set_language(locale.getdefaultlocale()[0])
schecker.attach(self.text_view)
else:
schecker = Gspell.TextView.get_from_gtk_text_view(self.text_view)
Gspell.TextView.basic_setup(schecker)
schecker = Gspell.TextView.get_from_gtk_text_view(self.text_view)
Gspell.TextView.basic_setup(schecker)
self.text_buffer = self.text_view.get_buffer()

spinbutton_jump = builder.get_object("spinbutton_jump")
Expand Down

0 comments on commit 8d068a5

Please sign in to comment.