[clocks] seconds fix



commit d445f4770c0a4ff738a88fa4d75c3c303477ba2e
Author: Eslam Mostafa <cseslam gmail com>
Date:   Fri Jun 8 00:57:16 2012 +0200

    seconds fix
    
    Signed-off-by: Seif Lotfy <seif lotfy collabora co uk>

 clocks.py |    5 +++--
 timer.py  |    8 ++++----
 2 files changed, 7 insertions(+), 6 deletions(-)
---
diff --git a/clocks.py b/clocks.py
index 47f9afa..ead55e3 100644
--- a/clocks.py
+++ b/clocks.py
@@ -33,7 +33,7 @@ import pytz, time, os
 STOPWATCH_LABEL_MARKUP = "<span font_desc=\"64.0\">%02i:%04.1f</span>"
 STOPWATCH_BUTTON_MARKUP = "<span font_desc=\"24.0\">%s</span>"
 
-TIMER_LABEL_MARKUP = "<span font_desc=\"64.0\">%02i:%02i</span>"
+TIMER_LABEL_MARKUP = "<span font_desc=\"64.0\">%02i:%02i:%02i</span>"
 TIMER = "<span font_desc=\"64.0\">%02i</span>"
 TIMER_BUTTON_MARKUP = "<span font_desc=\"24.0\">%s</span>"
 
@@ -311,6 +311,7 @@ class Timer (Clock):
 		if self.g_id == 0: 
 			hours = self.timer_welcome_screen.hours.get_value()
 			minutes = self.timer_welcome_screen.minutes.get_value()
+			self.timer_screen.timerLabel.set_markup (TIMER_LABEL_MARKUP%(hours, minutes, 60))
 			self.time = (hours * 60 * 60) + (minutes * 60) 
 			self.state = 1
 			self.g_id = GObject.timeout_add(1000, self.count)
@@ -334,7 +335,7 @@ class Timer (Clock):
 		minutes, sec = divmod(self.time, 60)
 		hours, minutes = divmod(minutes, 60)
 
-		self.timer_screen.timerLabel.set_markup (TIMER_LABEL_MARKUP%(hours, minutes))
+		self.timer_screen.timerLabel.set_markup (TIMER_LABEL_MARKUP%(hours, minutes, sec))
 		if hours == 00 and minutes == 00 and sec == 00:
 			return False
 		else:
diff --git a/timer.py b/timer.py
index 24119de..2c74c35 100644
--- a/timer.py
+++ b/timer.py
@@ -21,7 +21,7 @@
 from gi.repository import Gtk, Gio
 
 TIMER = "<span font_desc=\"64.0\">%02i</span>"
-TIMER_LABEL_MARKUP = "<span font_desc=\"64.0\">%02i:%02i</span>"
+TIMER_LABEL_MARKUP = "<span font_desc=\"64.0\">%02i:%02i:%02i</span>"
 TIMER = "<span font_desc=\"64.0\">%02i</span>"
 TIMER_BUTTON_MARKUP = "<span font_desc=\"24.0\">%s</span>"
 
@@ -102,7 +102,7 @@ class TimerScreen (Gtk.Box):
 
 		self.timerLabel = Gtk.Label ()
 		self.timerLabel.set_alignment (0.5, 0.5)
-		self.timerLabel.set_markup (TIMER_LABEL_MARKUP%(0,0))
+		self.timerLabel.set_markup (TIMER_LABEL_MARKUP%(0,0,0))
 
 		hbox = Gtk.Box()		
 		self.leftButton = Gtk.Button ()
@@ -201,6 +201,6 @@ class TimerWelcomeScreen (Gtk.Box):
 		
 
 	def _on_start_clicked(self, data):
-		if self.timer.state == 0:
-			self.timer.start_timer_screen()
+		if self.timer.state == 0:			
 			self.timer.start()
+			self.timer.start_timer_screen()



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