[clocks] Fix seconds in timer, maximum seconds were set to 59, and can set seconds ony without minutes.



commit 9238d9e84359ad1b637c8a7a4c66e28cba0c490c
Author: Eslam Mostafa <cseslam gmail com>
Date:   Thu Jun 14 15:25:12 2012 +0200

    Fix seconds in timer, maximum seconds were set to 59, and can set seconds ony without minutes.
    
    Signed-off-by: Seif Lotfy <seif lotfy com>

 clocks.py  |    2 +-
 timer.py   |    7 ++++---
 widgets.py |    1 +
 3 files changed, 6 insertions(+), 4 deletions(-)
---
diff --git a/clocks.py b/clocks.py
index 5f35804..c131aa7 100644
--- a/clocks.py
+++ b/clocks.py
@@ -327,7 +327,7 @@ class Timer (Clock):
 		self.time -= 1
 		minutes, seconds = divmod(self.time, 60)
 		hours, minutes = divmod(minutes, 60)
-		#seconds, minutes = divmod(hours, 0.60)
+		#minutes, seconds = divmod(hours, 60)
 
 		self.timer_screen.timerLabel.set_markup (TIMER_LABEL_MARKUP%(hours, minutes, seconds))
 		if hours == 00 and minutes == 00 and seconds == 00:
diff --git a/timer.py b/timer.py
index 5689144..f2232be 100644
--- a/timer.py
+++ b/timer.py
@@ -74,7 +74,7 @@ class Spinner(Gtk.Box):
 			else:
 				value += 1
 		elif self.vType == 'seconds':
-			if value == 60:
+			if value == 59:
 				value = 0
 			else:
 				value += 1
@@ -95,7 +95,7 @@ class Spinner(Gtk.Box):
 				value -= 1			
 		elif self.vType == 'seconds':
 			if value == 0:
-				value = 60
+				value = 59
 			else:
 				value -= 1
 		self.set_value(value)
@@ -207,7 +207,8 @@ class TimerWelcomeScreen (Gtk.Box):
 	def update_start_button_status(self):
 		hours = self.hours.get_value()
 		minutes = self.minutes.get_value()
-		if hours == 0 and minutes == 0:
+		seconds = self.seconds.get_value()
+		if hours == 0 and minutes == 0 and seconds == 0:
 			self.startButton.set_sensitive(False)
 		else:
 			self.startButton.set_sensitive(True)
diff --git a/widgets.py b/widgets.py
index a6c6d8e..52c1214 100644
--- a/widgets.py
+++ b/widgets.py
@@ -200,6 +200,7 @@ class DigitalClockDrawing (Gtk.DrawingArea):
     def __init__(self):
         Gtk.DrawingArea.__init__(self)
         #self.set_size_request(width,height)
+        
         self.pango_context = None
         self.ctx = None
         self.pixbuf = None



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