save speller_language per room. Fixes #2387
This commit is contained in:
parent
be90361641
commit
7759dd9289
|
@ -184,7 +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,
|
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')
|
'speller_language')
|
||||||
if not lang:
|
if not lang:
|
||||||
# use the default one
|
# use the default one
|
||||||
|
@ -211,7 +214,12 @@ 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_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)
|
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
|
||||||
|
@ -1076,12 +1084,12 @@ class ChatControl(ChatControlBase):
|
||||||
tt = _('OpenPGP Encryption')
|
tt = _('OpenPGP Encryption')
|
||||||
|
|
||||||
# restore gpg pref
|
# restore gpg pref
|
||||||
gpg_pref = gajim.config.get_per('contacts',
|
gpg_pref = gajim.config.get_per('contacts', self.contact.jid,
|
||||||
self.contact.get_full_jid(), 'gpg_enabled')
|
'gpg_enabled')
|
||||||
if gpg_pref == None:
|
if gpg_pref == None:
|
||||||
gajim.config.add_per('contacts', self.contact.get_full_jid())
|
gajim.config.add_per('contacts', self.contact.jid)
|
||||||
gpg_pref = gajim.config.get_per('contacts',
|
gpg_pref = gajim.config.get_per('contacts', self.contact.jid,
|
||||||
self.contact.get_full_jid(), 'gpg_enabled')
|
'gpg_enabled')
|
||||||
tb.set_active(gpg_pref)
|
tb.set_active(gpg_pref)
|
||||||
|
|
||||||
else:
|
else:
|
||||||
|
|
|
@ -299,6 +299,9 @@ class Config:
|
||||||
'gpg_enabled': [ opt_bool, True, _('Do we have GPG enabled for this contact')],
|
'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')],
|
'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': ({
|
'notifications': ({
|
||||||
'event': [opt_str, ''],
|
'event': [opt_str, ''],
|
||||||
'recipient_type': [opt_str, 'all'],
|
'recipient_type': [opt_str, 'all'],
|
||||||
|
|
Loading…
Reference in New Issue