[hamster-applet] don't do anything if nothing has happened



commit 94dbc3b9ac81679a4abdcddaf0c5f75366fb3d2b
Author: Toms Bauģis <toms baugis gmail com>
Date:   Thu Aug 19 12:48:12 2010 +0100

    don't do anything if nothing has happened

 src/hamster/client.py              |    3 ++-
 src/hamster/overview_activities.py |    3 ++-
 2 files changed, 4 insertions(+), 2 deletions(-)
---
diff --git a/src/hamster/client.py b/src/hamster/client.py
index a96588d..9a027f1 100644
--- a/src/hamster/client.py
+++ b/src/hamster/client.py
@@ -194,7 +194,8 @@ class Storage(gobject.GObject):
 
         # TODO - the parsing should happen just once and preferably here
         # we should feed (serialized_activity, start_time, end_time) into AddFact and others
-        checker.check_fact_based(activity_name, tags, start_time, end_time, category_name, description)
+        if new_id:
+            checker.check_fact_based(activity_name, tags, start_time, end_time, category_name, description)
 
         return new_id
 
diff --git a/src/hamster/overview_activities.py b/src/hamster/overview_activities.py
index 3bcdce7..da49bb4 100644
--- a/src/hamster/overview_activities.py
+++ b/src/hamster/overview_activities.py
@@ -185,7 +185,8 @@ class OverviewBox(gtk.VBox):
                                           end_time,
                                           fact.category_name,
                                           fact.description)
-        self.fact_tree.select_fact(new_id)
+        if new_id:
+            self.fact_tree.select_fact(new_id)
 
 if __name__ == "__main__":
     gtk.window_set_default_icon_name("hamster-applet")



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