[hamster-applet] calculate totals when we need the data, not on expose
- From: Toms Baugis <tbaugis src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [hamster-applet] calculate totals when we need the data, not on expose
- Date: Sat, 15 May 2010 23:25:41 +0000 (UTC)
commit e5c71bf503d054f08a1bda3a92a5d63f37ca0c7d
Author: Toms Bauģis <toms baugis gmail com>
Date: Sun May 16 00:20:29 2010 +0100
calculate totals when we need the data, not on expose
src/hamster/overview_totals.py | 7 ++++++-
1 files changed, 6 insertions(+), 1 deletions(-)
---
diff --git a/src/hamster/overview_totals.py b/src/hamster/overview_totals.py
index a83d3f7..ea1bc3a 100644
--- a/src/hamster/overview_totals.py
+++ b/src/hamster/overview_totals.py
@@ -89,6 +89,7 @@ class TotalsBox(gtk.VBox):
self.category_chart.selected_keys.append(key)
self.selected_categories.append(key)
+ self.calculate_totals()
self.do_charts()
def on_activity_clicked(self, widget, key):
@@ -98,6 +99,7 @@ class TotalsBox(gtk.VBox):
else:
self.activity_chart.selected_keys.append(key)
self.selected_activities.append(key)
+ self.calculate_totals()
self.do_charts()
def on_tag_clicked(self, widget, key):
@@ -107,6 +109,7 @@ class TotalsBox(gtk.VBox):
else:
self.tag_chart.selected_keys.append(key)
self.selected_tags.append(key)
+ self.calculate_totals()
self.do_charts()
@@ -130,6 +133,7 @@ class TotalsBox(gtk.VBox):
self.get_widget("no_data_label").hide()
self.get_widget("charts").show()
self.get_widget("total_hours").show()
+ self.calculate_totals()
self.do_charts()
else:
self.get_widget("no_data_label").show()
@@ -137,7 +141,7 @@ class TotalsBox(gtk.VBox):
self.get_widget("total_hours").hide()
- def do_charts(self):
+ def calculate_totals(self):
if not self.facts:
return
@@ -202,6 +206,7 @@ class TotalsBox(gtk.VBox):
self.tag_sums = zip(*tag_sums)
+ def do_charts(self):
self.get_widget("totals_by_category").set_size_request(10,10)
if self.category_sums:
self.get_widget("totals_by_category").set_size_request(280, len(self.category_sums[0]) * 20)
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]