[hamster-applet/gnome-2-32] handle no-data situation



commit b97799e72f75a967c2b19337669b7b2470b3caac
Author: Toms Bauģis <toms baugis gmail com>
Date:   Mon Sep 6 01:31:05 2010 +0100

    handle no-data situation

 src/hamster/overview_totals.py |   10 +++++++---
 1 files changed, 7 insertions(+), 3 deletions(-)
---
diff --git a/src/hamster/overview_totals.py b/src/hamster/overview_totals.py
index 9263a5a..d232a7e 100644
--- a/src/hamster/overview_totals.py
+++ b/src/hamster/overview_totals.py
@@ -208,9 +208,13 @@ class TotalsBox(gtk.VBox):
             self.get_widget("totals_by_category").set_size_request(-1, 10)
             self.category_chart.plot([],[])
 
-        self.get_widget("totals_by_activity").set_size_request(10,10)
-        self.get_widget("totals_by_activity").set_size_request(-1, len(self.activity_sums[0]) * 20)
-        self.activity_chart.plot(*self.activity_sums)
+        if self.activity_sums:
+            self.get_widget("totals_by_activity").set_size_request(10,10)
+            self.get_widget("totals_by_activity").set_size_request(-1, len(self.activity_sums[0]) * 20)
+            self.activity_chart.plot(*self.activity_sums)
+        else:
+            self.get_widget("totals_by_category").set_size_request(-1, 10)
+            self.activity_chart.plot([],[])
 
         self.get_widget("totals_by_tag").set_size_request(10,10)
         if self.tag_sums:



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]