Ticket #1948: 0001-Reset-timeout-delay-on-every-TitleEntry-change-1948.patch

File 0001-Reset-timeout-delay-on-every-TitleEntry-change-1948.patch, 1.0 KB (added by alsroot, 10 years ago)
  • src/sugar/activity/widgets.py

    From 873ed4340103093098342817b7139e2b02c82d8a Mon Sep 17 00:00:00 2001
    From: Aleksey Lim <alsroot@member.fsf.org>
    Date: Fri, 7 May 2010 20:02:31 +0000
    Subject: Reset timeout delay on every TitleEntry change #1948
    
    
    diff --git a/src/sugar/activity/widgets.py b/src/sugar/activity/widgets.py
    index 2867666..6cfd33b 100644
    a b class TitleEntry(gtk.ToolItem): 
    202202        self.entry.set_text(jobject['title'])
    203203
    204204    def __title_changed_cb(self, entry, activity):
    205         if not self._update_title_sid:
    206             self._update_title_sid = gobject.timeout_add_seconds(
    207                     1, self.__update_title_cb, activity)
     205        if self._update_title_sid is not None:
     206            gobject.source_remove(self._update_title_sid)
     207        self._update_title_sid = gobject.timeout_add_seconds(
     208                1, self.__update_title_cb, activity)
    208209
    209210    def __update_title_cb(self, activity):
    210211        title = self.entry.get_text()