From be9036164194a6885ee34426e1f3c588795a4de1 Mon Sep 17 00:00:00 2001 From: Yann Leboulanger Date: Tue, 12 Sep 2006 07:18:43 +0000 Subject: [PATCH] we now save speller_language per contact. For #2387 --- src/chat_control.py | 9 +++++++-- src/common/config.py | 3 ++- 2 files changed, 9 insertions(+), 3 deletions(-) diff --git a/src/chat_control.py b/src/chat_control.py index 3b6d809eb..28ab084cf 100644 --- a/src/chat_control.py +++ b/src/chat_control.py @@ -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) diff --git a/src/common/config.py b/src/common/config.py index 1fdbed955..0e0ebb9cd 100644 --- a/src/common/config.py +++ b/src/common/config.py @@ -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, ''],