[gnome-games] sudoku: Fix timer problems. Bug #562782
- From: Thomas Hindoe Paaboel Andersen <thomashpa src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnome-games] sudoku: Fix timer problems. Bug #562782
- Date: Mon, 29 Mar 2010 21:21:36 +0000 (UTC)
commit ebddb026569a1b9035cb2ce551fc1c4827b9fa89
Author: Jim Ross <jimbo dimensia com>
Date: Thu Mar 25 22:35:02 2010 -0400
sudoku: Fix timer problems. Bug #562782
gnome-sudoku/src/lib/saver.py | 2 +-
gnome-sudoku/src/lib/timer.py | 8 ++++++--
2 files changed, 7 insertions(+), 3 deletions(-)
---
diff --git a/gnome-sudoku/src/lib/saver.py b/gnome-sudoku/src/lib/saver.py
index e68894f..8e15f04 100644
--- a/gnome-sudoku/src/lib/saver.py
+++ b/gnome-sudoku/src/lib/saver.py
@@ -47,7 +47,7 @@ def super_setattr (obj, attr, val):
def jar_game (ui):
jar = {} # what we will pickle
- ui.timer.finish_timing()
+ ui.timer.mark_timing()
jar['game'] = ui.gsd.grid.to_string()
jar['trackers'] = ui.gsd.trackers
jar['tracking'] = ui.gsd.__trackers_tracking__
diff --git a/gnome-sudoku/src/lib/timer.py b/gnome-sudoku/src/lib/timer.py
index dfaa4fa..bd5e2de 100644
--- a/gnome-sudoku/src/lib/timer.py
+++ b/gnome-sudoku/src/lib/timer.py
@@ -131,14 +131,18 @@ class ActiveTimer (gobject.GObject):
self.__absolute_start_time__ = time.time()
self.resume_timing()
- def finish_timing (self):
+ def mark_timing(self):
self.pause_timing()
- self.timer_running = False
if self.active_time < 1:
self.active_time = 1
# dirty hack: never let total time be less than active time
if self.active_time > self.total_time:
self.total_time = self.active_time
+ self.resume_timing()
+
+ def finish_timing (self):
+ self.mark_timing()
+ self.timer_running = False
def active_time_string (self):
return format_time(self.active_time)
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]