Dynamic reconfig of gtkspell option works again
This commit is contained in:
parent
c0297ac445
commit
1048936e21
|
@ -37,6 +37,7 @@ import dialogs
|
||||||
import vcard
|
import vcard
|
||||||
import cell_renderer_image
|
import cell_renderer_image
|
||||||
import message_control
|
import message_control
|
||||||
|
import chat_control
|
||||||
|
|
||||||
try:
|
try:
|
||||||
import gtkspell
|
import gtkspell
|
||||||
|
@ -541,27 +542,28 @@ class PreferencesWindow:
|
||||||
gajim.interface.save_config()
|
gajim.interface.save_config()
|
||||||
gajim.interface.msg_win_mgr.reconfig()
|
gajim.interface.msg_win_mgr.reconfig()
|
||||||
|
|
||||||
def apply_speller(self, kind):
|
def apply_speller(self):
|
||||||
for acct in gajim.connections:
|
for acct in gajim.connections:
|
||||||
windows = gajim.interface.instances[acct][kind]
|
for ctrl in gajim.interface.msg_win_mgr.controls():
|
||||||
jids = windows.keys()
|
if isinstance(ctrl, chat_control.ChatControlBase):
|
||||||
for jid in jids:
|
try:
|
||||||
if jid == 'tabbed':
|
spell_obj = gtkspell.get_from_text_view(ctrl.msg_textview)
|
||||||
continue
|
except:
|
||||||
window = windows[jid]
|
spell_obj = None
|
||||||
textview = window.message_textviews[jid]
|
|
||||||
gtkspell.Spell(textview)
|
|
||||||
|
|
||||||
def remove_speller(self, kind):
|
print "Current: ", spell_obj
|
||||||
|
if not spell_obj:
|
||||||
|
gtkspell.Spell(ctrl.msg_textview)
|
||||||
|
|
||||||
|
def remove_speller(self):
|
||||||
for acct in gajim.connections:
|
for acct in gajim.connections:
|
||||||
windows = gajim.interface.instances[acct][kind]
|
for ctrl in gajim.interface.msg_win_mgr.controls():
|
||||||
jids = windows.keys()
|
if isinstance(ctrl, chat_control.ChatControlBase):
|
||||||
for jid in jids:
|
try:
|
||||||
if jid == 'tabbed':
|
spell_obj = gtkspell.get_from_text_view(ctrl.msg_textview)
|
||||||
continue
|
except:
|
||||||
window = windows[jid]
|
spell_obj = None
|
||||||
textview = window.message_textviews[jid]
|
print "Current: ", spell_obj
|
||||||
spell_obj = gtkspell.get_from_text_view(textview)
|
|
||||||
if spell_obj:
|
if spell_obj:
|
||||||
spell_obj.detach()
|
spell_obj.detach()
|
||||||
|
|
||||||
|
@ -570,11 +572,9 @@ class PreferencesWindow:
|
||||||
gajim.config.set('use_speller', active)
|
gajim.config.set('use_speller', active)
|
||||||
gajim.interface.save_config()
|
gajim.interface.save_config()
|
||||||
if active:
|
if active:
|
||||||
self.apply_speller('chats')
|
self.apply_speller()
|
||||||
self.apply_speller('gc')
|
|
||||||
else:
|
else:
|
||||||
self.remove_speller('chats')
|
self.remove_speller()
|
||||||
self.remove_speller('gc')
|
|
||||||
|
|
||||||
def update_print_time(self):
|
def update_print_time(self):
|
||||||
'''Update time in Opened Chat Windows'''
|
'''Update time in Opened Chat Windows'''
|
||||||
|
|
Loading…
Reference in New Issue