Browse Source

Merge commit 'imrehg/features'

master
Julio Biason 16 years ago
parent
commit
5895f733b3
  1. 31
      mitterlib/ui/ui_pygtk.py

31
mitterlib/ui/ui_pygtk.py

@ -72,7 +72,7 @@ class _IdleObject(gobject.GObject):
gobject.GObject.__init__(self) gobject.GObject.__init__(self)
def emit(self, *args): def emit(self, *args):
gobject.idle_add(gobject.GObject.emit,self,*args) gobject.idle_add(gobject.GObject.emit, self, *args)
class _WorkerThread(threading.Thread, _IdleObject): class _WorkerThread(threading.Thread, _IdleObject):
@ -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):
@ -601,7 +618,6 @@ class Interface(object):
# ------------------------------------------------------------ # ------------------------------------------------------------
# Widget callback functions # Widget callback functions
# ------------------------------------------------------------ # ------------------------------------------------------------
def _count_chars(self, text_buffer): def _count_chars(self, text_buffer):
"""Count the number of chars in the edit field and update the """Count the number of chars in the edit field and update the
label that shows the available space.""" label that shows the available space."""
@ -775,7 +791,6 @@ class Interface(object):
# ------------------------------------------------------------ # ------------------------------------------------------------
# Required functions for all interfaces # Required functions for all interfaces
# ------------------------------------------------------------ # ------------------------------------------------------------
def __init__(self, connection, options): def __init__(self, connection, options):
"""Start the interface. `connection` is the :class:`Networks` object """Start the interface. `connection` is the :class:`Networks` object
with all the available networks. `options` is the :class:`ConfigOpt` with all the available networks. `options` is the :class:`ConfigOpt`
@ -887,4 +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