Browse Source

ui_pygtk: initial spell checking support for the update box

master
Gergely Imreh 16 years ago
parent
commit
78351349a3
  1. 26
      mitterlib/ui/ui_pygtk.py

26
mitterlib/ui/ui_pygtk.py

@ -484,6 +484,23 @@ class Interface(object):
update_area = gtk.VBox(True, 0) update_area = gtk.VBox(True, 0)
update_area.pack_start(update_box) update_area.pack_start(update_box)
""" Spell checking the update box """
spell_check_enabled = self._options[self.NAMESPACE]['spell_check']
if spell_check_enabled:
try:
import gtkspell
import locale
self.spell_check_support = True
language = locale.getlocale()[0]
self.spell_check = gtkspell.Spell(self._update_text, language)
_log.debug('Spell checking turned on with language: %s' \
% (language))
except:
self._options[self.NAMESPACE]['spell_check'] = False
self.spell_check_support = False
_log.debug('Error initializing spell checking: ' \
'spell checking disabled')
return update_area return update_area
def _create_statusbar(self): def _create_statusbar(self):
@ -885,3 +902,12 @@ class Interface(object):
default='blue', default='blue',
conflict_group='interface', conflict_group='interface',
is_cmd_option=False) is_cmd_option=False)
options.add_option(
group=self.NAMESPACE,
option='spell_check',
help='Spell checking update text',
type='boolean',
metavar='SPELL',
default=False,
conflict_group='interface',
is_cmd_option=False)

Loading…
Cancel
Save