From 73a4c4e1b9f425a8c382417995820ad6d3efe9a1 Mon Sep 17 00:00:00 2001 From: Yann Leboulanger Date: Fri, 12 Feb 2010 20:41:21 +0100 Subject: [PATCH] fix acronyms expander plugin --- plugins/acronyms_expander.py | 17 +++++++---------- 1 file changed, 7 insertions(+), 10 deletions(-) diff --git a/plugins/acronyms_expander.py b/plugins/acronyms_expander.py index 6dec95614..69e2448e5 100644 --- a/plugins/acronyms_expander.py +++ b/plugins/acronyms_expander.py @@ -27,6 +27,7 @@ Acronyms expander plugin. import sys import gtk +import gobject from plugins import GajimPlugin from plugins.helpers import log, log_calls @@ -70,19 +71,15 @@ class AcronymsExpanderPlugin(GajimPlugin): t = tb.get_text(tb.get_start_iter(), tb.get_end_iter()) #log.debug('%s %d'%(t, len(t))) if t and t[-1] == INVOKER: - #log.debug("changing msg text") + #log.debug('changing msg text') base,sep,head=t[:-1].rpartition(INVOKER) - #log.debug('%s | %s | %s'%(base, sep, head)) + log.debug('%s | %s | %s'%(base, sep, head)) if head in ACRONYMS: head = ACRONYMS[head] - log.debug("head: %s"%(head)) - t = "".join((base, sep, head, INVOKER)) - #log.debug("turning off notify") - tb.freeze_notify() + #log.debug('head: %s'%(head)) + t = ''.join((base, sep, head, INVOKER)) #log.debug("setting text: '%s'"%(t)) - tb.set_text(t) - #log.debug("turning on notify") - tb.thaw_notify() + gobject.idle_add(tb.set_text, t) @log_calls('AcronymsExpanderPlugin') def connect_with_chat_control_base(self, chat_control): @@ -101,4 +98,4 @@ class AcronymsExpanderPlugin(GajimPlugin): d = chat_control.acronyms_expander_plugin_data tv = chat_control.msg_textview tv.get_buffer().disconnect(d['h_id']) - \ No newline at end of file +