[hamster-applet] on-demand style of refresh, when activities change
- From: Toms Baugis <tbaugis src gnome org>
- To: svn-commits-list gnome org
- Cc:
- Subject: [hamster-applet] on-demand style of refresh, when activities change
- Date: Fri, 20 Nov 2009 18:53:58 +0000 (UTC)
commit 4b08607493008554a7954df9131f85c1b51a26e0
Author: Toms Bauģis <toms baugis gmail com>
Date: Fri Nov 20 18:53:10 2009 +0000
on-demand style of refresh, when activities change
hamster/widgets/activityentry.py | 14 +++++++++-----
1 files changed, 9 insertions(+), 5 deletions(-)
---
diff --git a/hamster/widgets/activityentry.py b/hamster/widgets/activityentry.py
index e6bbf01..506f1b9 100644
--- a/hamster/widgets/activityentry.py
+++ b/hamster/widgets/activityentry.py
@@ -161,19 +161,23 @@ class ActivityEntry(gtk.Entry):
self.set_text("%s%s" % (self.filter, prefix))
self.select_region(len(self.filter), len(self.filter) + prefix_length)
+ def refresh_activities(self):
+ # scratch activities and categories so that they get repopulated on demand
+ self.activities = None
+ self.categories = None
def populate_suggestions(self):
- self.activities = self.activities or runtime.storage.get_autocomplete_activities()
- self.categories = self.categories or runtime.storage.get_category_list()
-
if self.get_selection_bounds():
cursor = self.get_selection_bounds()[0]
else:
cursor = self.get_position()
-
- if self.filter == self.get_text()[:cursor]:
+ if self.activities and self.categories and self.filter == self.get_text()[:cursor]:
return #same thing, no need to repopulate
+
+ self.activities = self.activities or runtime.storage.get_autocomplete_activities()
+ self.categories = self.categories or runtime.storage.get_category_list()
+
self.filter = self.get_text()[:cursor]
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]