we now save speller_language per contact. For #2387
This commit is contained in:
parent
a8beb10825
commit
be90361641
|
@ -184,6 +184,10 @@ class ChatControlBase(MessageControl):
|
||||||
except:
|
except:
|
||||||
del langs[lang]
|
del langs[lang]
|
||||||
# now set the one the user selected
|
# now set the one the user selected
|
||||||
|
lang = gajim.config.get_per('contacts', self.contact.jid,
|
||||||
|
'speller_language')
|
||||||
|
if not lang:
|
||||||
|
# use the default one
|
||||||
lang = gajim.config.get('speller_language')
|
lang = gajim.config.get('speller_language')
|
||||||
if lang:
|
if lang:
|
||||||
self.msg_textview.lang = lang
|
self.msg_textview.lang = lang
|
||||||
|
@ -207,7 +211,8 @@ class ChatControlBase(MessageControl):
|
||||||
def on_msg_textview_populate_popup(self, textview, menu):
|
def on_msg_textview_populate_popup(self, textview, menu):
|
||||||
'''we override the default context menu and we prepend an option to switch languages'''
|
'''we override the default context menu and we prepend an option to switch languages'''
|
||||||
def _on_select_dictionary(widget, lang):
|
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)
|
spell = gtkspell.get_from_text_view(self.msg_textview)
|
||||||
self.msg_textview.lang = lang
|
self.msg_textview.lang = lang
|
||||||
spell.set_language(lang)
|
spell.set_language(lang)
|
||||||
|
|
|
@ -296,7 +296,8 @@ class Config:
|
||||||
'state_muc_directed_msg_color': [ opt_color, 'red2' ],
|
'state_muc_directed_msg_color': [ opt_color, 'red2' ],
|
||||||
}, {}),
|
}, {}),
|
||||||
'contacts': ({
|
'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': ({
|
'notifications': ({
|
||||||
'event': [opt_str, ''],
|
'event': [opt_str, ''],
|
||||||
|
|
Loading…
Reference in New Issue