From 845d2534e670366a92fd93be92a078a4a188ff9f Mon Sep 17 00:00:00 2001 From: Aleksey Lim Date: Fri, 7 May 2010 20:02:31 +0000 Subject: [PATCH] Reset timeout delay on every TitleEntry change #1948 --- src/sugar/activity/widgets.py | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/src/sugar/activity/widgets.py b/src/sugar/activity/widgets.py index 2867666f..6cfd33bd 100644 --- a/src/sugar/activity/widgets.py +++ b/src/sugar/activity/widgets.py @@ -202,9 +202,10 @@ class TitleEntry(gtk.ToolItem): self.entry.set_text(jobject['title']) def __title_changed_cb(self, entry, activity): - if not self._update_title_sid: - self._update_title_sid = gobject.timeout_add_seconds( - 1, self.__update_title_cb, activity) + if self._update_title_sid is not None: + gobject.source_remove(self._update_title_sid) + self._update_title_sid = gobject.timeout_add_seconds( + 1, self.__update_title_cb, activity) def __update_title_cb(self, activity): title = self.entry.get_text()