we now save speller_language per contact. For #2387

This commit is contained in:
Yann Leboulanger 2006-09-12 07:18:43 +00:00
parent a8beb10825
commit be90361641
2 changed files with 9 additions and 3 deletions

View File

@ -184,7 +184,11 @@ class ChatControlBase(MessageControl):
except:
del langs[lang]
# now set the one the user selected
lang = gajim.config.get('speller_language')
lang = gajim.config.get_per('contacts', self.contact.jid,
'speller_language')
if not lang:
# use the default one
lang = gajim.config.get('speller_language')
if lang:
self.msg_textview.lang = lang
spell.set_language(lang)
@ -207,7 +211,8 @@ class ChatControlBase(MessageControl):
def on_msg_textview_populate_popup(self, textview, menu):
'''we override the default context menu and we prepend an option to switch languages'''
def _on_select_dictionary(widget, lang):
gajim.config.set('speller_language', lang)
gajim.config.set_per('contacts', self.contact.jid, 'speller_language',
lang)
spell = gtkspell.get_from_text_view(self.msg_textview)
self.msg_textview.lang = lang
spell.set_language(lang)

View File

@ -296,7 +296,8 @@ class Config:
'state_muc_directed_msg_color': [ opt_color, 'red2' ],
}, {}),
'contacts': ({
'gpg_enabled': [ opt_bool, True ],
'gpg_enabled': [ opt_bool, True, _('Do we have GPG enabled for this contact')],
'speller_language': [ opt_str, '', _('Language for which we want to check misspeller words')],
}, {}),
'notifications': ({
'event': [opt_str, ''],