hamster-applet r797 - trunk/hamster



Author: tbaugis
Date: Tue Feb 24 18:42:04 2009
New Revision: 797
URL: http://svn.gnome.org/viewvc/hamster-applet?rev=797&view=rev

Log:
fixed bug that hindered editing ongoing activity

Modified:
   trunk/hamster/edit_activity.py

Modified: trunk/hamster/edit_activity.py
==============================================================================
--- trunk/hamster/edit_activity.py	(original)
+++ trunk/hamster/edit_activity.py	Tue Feb 24 18:42:04 2009
@@ -200,8 +200,6 @@
         graph_y = 1
         graph_height = self.height - 15
 
-
-        
         context.set_source_rgb(1, 1, 1)
         context.rectangle(0, graph_y-1, self.width, graph_height)
         context.fill()
@@ -209,7 +207,6 @@
         context.rectangle(0, graph_y-1, self.width-1, graph_height)
         context.stroke()
 
-        
         context.set_source_rgb(0.86, 0.86, 0.86)
         for fact in self.facts:
             start_minutes = fact["start_time"].hour * 60 \
@@ -283,6 +280,12 @@
             self.get_widget("save_button").set_label("gtk-save")
             self.window.set_title(_("Update activity"))
 
+            if not end_date:
+                if start_date.date() == dt.date.today():
+                    end_date = dt.datetime.now()
+                else:
+                    end_date = end_date or start_date + dt.timedelta(minutes = 30)
+
         elif fact_date and fact_date != dt.date.today():
             # we are asked to add task in some day, but time has not
             # been specified - two things we can do



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