Skip to content
Snippets Groups Projects
Commit 7759dd92 authored by Yann Leboulanger's avatar Yann Leboulanger
Browse files

save speller_language per room. Fixes #2387

parent be903616
No related branches found
No related tags found
No related merge requests found
......@@ -184,7 +184,10 @@ class ChatControlBase(MessageControl):
except:
del langs[lang]
# now set the one the user selected
lang = gajim.config.get_per('contacts', self.contact.jid,
per_type = 'contacts'
if self.type_id == message_control.TYPE_GC:
per_type = 'rooms'
lang = gajim.config.get_per(per_type, self.contact.jid,
'speller_language')
if not lang:
# use the default one
......@@ -211,7 +214,12 @@ 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_per('contacts', self.contact.jid, 'speller_language',
per_type = 'contacts'
if self.type_id == message_control.TYPE_GC:
per_type = 'rooms'
if not gajim.config.get_per(per_type, self.contact.jid):
gajim.config.add_per(per_type, self.contact.jid)
gajim.config.set_per(per_type, self.contact.jid, 'speller_language',
lang)
spell = gtkspell.get_from_text_view(self.msg_textview)
self.msg_textview.lang = lang
......@@ -1076,12 +1084,12 @@ class ChatControl(ChatControlBase):
tt = _('OpenPGP Encryption')
# restore gpg pref
gpg_pref = gajim.config.get_per('contacts',
self.contact.get_full_jid(), 'gpg_enabled')
gpg_pref = gajim.config.get_per('contacts', self.contact.jid,
'gpg_enabled')
if gpg_pref == None:
gajim.config.add_per('contacts', self.contact.get_full_jid())
gpg_pref = gajim.config.get_per('contacts',
self.contact.get_full_jid(), 'gpg_enabled')
gajim.config.add_per('contacts', self.contact.jid)
gpg_pref = gajim.config.get_per('contacts', self.contact.jid,
'gpg_enabled')
tb.set_active(gpg_pref)
else:
......
......@@ -299,6 +299,9 @@ class Config:
'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')],
}, {}),
'rooms': ({
'speller_language': [ opt_str, '', _('Language for which we want to check misspeller words')],
}, {}),
'notifications': ({
'event': [opt_str, ''],
'recipient_type': [opt_str, 'all'],
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment