|
|
|
@ -484,6 +484,23 @@ class Interface(object):
|
|
|
|
|
update_area = gtk.VBox(True, 0) |
|
|
|
|
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 |
|
|
|
|
|
|
|
|
|
def _create_statusbar(self): |
|
|
|
@ -601,7 +618,6 @@ class Interface(object):
|
|
|
|
|
# ------------------------------------------------------------ |
|
|
|
|
# Widget callback functions |
|
|
|
|
# ------------------------------------------------------------ |
|
|
|
|
|
|
|
|
|
def _count_chars(self, text_buffer): |
|
|
|
|
"""Count the number of chars in the edit field and update the |
|
|
|
|
label that shows the available space.""" |
|
|
|
@ -775,7 +791,6 @@ class Interface(object):
|
|
|
|
|
# ------------------------------------------------------------ |
|
|
|
|
# Required functions for all interfaces |
|
|
|
|
# ------------------------------------------------------------ |
|
|
|
|
|
|
|
|
|
def __init__(self, connection, options): |
|
|
|
|
"""Start the interface. `connection` is the :class:`Networks` object |
|
|
|
|
with all the available networks. `options` is the :class:`ConfigOpt` |
|
|
|
@ -887,4 +902,12 @@ class Interface(object):
|
|
|
|
|
default='blue', |
|
|
|
|
conflict_group='interface', |
|
|
|
|
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) |
|
|
|
|