[gnome-clocks] Small cleanup



commit 7146b87c67ce692386b9737b50523c75c9f54847
Author: Paolo Borelli <pborelli gnome org>
Date:   Fri Aug 17 00:16:23 2012 +0200

    Small cleanup

 gnomeclocks/clocks.py |    3 ++-
 gnomeclocks/timer.py  |   12 ++----------
 2 files changed, 4 insertions(+), 11 deletions(-)
---
diff --git a/gnomeclocks/clocks.py b/gnomeclocks/clocks.py
index c2e0fb9..08bc34d 100644
--- a/gnomeclocks/clocks.py
+++ b/gnomeclocks/clocks.py
@@ -408,7 +408,6 @@ class Timer (Clock):
         self.timerbox.show_all()
 
     def end_timer_screen(self):
-        #self.timer_screen.rightButton.get_style_context ().add_class ("clocks-lap")
         self.timer_screen.leftLabel.set_markup(TIMER_BUTTON_MARKUP % (_("Pause")))
         self.timerbox.remove(self.timer_screen)
         self.show_timer_welcome_screen()
@@ -427,6 +426,7 @@ class Timer (Clock):
             self.time = (hours * 60 * 60) + (minutes * 60) + seconds
             self.state = Timer.State.RUNNING
             self.g_id = GObject.timeout_add(1000, self.count)
+            self.start_timer_screen()
 
     def reset(self):
         self.state = Timer.State.STOPPED
@@ -441,6 +441,7 @@ class Timer (Clock):
         self.g_id = 0
 
     def cont(self):
+        self.state = Timer.State.RUNNING
         self.g_id = GObject.timeout_add(1000, self.count)
 
     def count(self):
diff --git a/gnomeclocks/timer.py b/gnomeclocks/timer.py
index 479b594..6e69bdb 100644
--- a/gnomeclocks/timer.py
+++ b/gnomeclocks/timer.py
@@ -107,9 +107,6 @@ class TimerScreen (Gtk.Box):
         self.rightLabel = Gtk.Label ()
         self.rightButton.add (self.rightLabel)
 
-        #self.leftButton.get_style_context ().add_class ("clocks-stop")
-        #self.rightButton.get_style_context ().add_class ("clocks-lap")
-
         hbox.pack_start (self.leftButton, True, True, 0)
         hbox.pack_start (Gtk.Box(), True, True, 24)
         hbox.pack_start (self.rightButton, True, True, 0)
@@ -130,18 +127,14 @@ class TimerScreen (Gtk.Box):
         self.timer.reset()
 
     def _on_left_button_clicked(self, widget):
-        if self.timer.state == 1: #Pause
-            self.timer.state = 2
+        if self.timer.state == 1:
             self.timer.pause()
             self.leftLabel.set_markup(TIMER_BUTTON_MARKUP % (_("Continue")))
-            #self.leftButton.get_style_context ().remove_class ("clocks-stop")
             self.leftButton.get_style_context ().add_class ("clocks-go")
-        elif self.timer.state == 2: #Continue
-            self.timer.state = 1
+        elif self.timer.state == 2:
             self.timer.cont()
             self.leftLabel.set_markup(TIMER_BUTTON_MARKUP % (_("Pause")))
             self.leftButton.get_style_context ().remove_class ("clocks-go")
-            #self.leftButton.get_style_context ().add_class ("clocks-lap")
 
 class TimerWelcomeScreen (Gtk.Box):
     def __init__ (self, timer):
@@ -199,4 +192,3 @@ class TimerWelcomeScreen (Gtk.Box):
     def _on_start_clicked(self, data):
         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]