From edbe87c7aca4c505f4b042f60488eae4fd113215 Mon Sep 17 00:00:00 2001 From: Pootle daemon Date: Thu, 21 Jul 2011 16:35:25 +0000 Subject: Merge branch 'master' of git.sugarlabs.org:stopwatch/stopwatch --- diff --git a/NEWS b/NEWS index c5528e4..5e689b6 100644 --- a/NEWS +++ b/NEWS @@ -1,3 +1,7 @@ +9 + +*Disable idle suspend on opening journal entry with running timer by James Cameron + 8 *New templates for langs diff --git a/activity/activity.info b/activity/activity.info index d5c6c2a..45f1834 100644 --- a/activity/activity.info +++ b/activity/activity.info @@ -1,7 +1,7 @@ [Activity] name = StopWatch bundle_id = org.laptop.StopWatchActivity -class = activity.StopWatchActivity +exec = activity.StopWatchActivity icon = activity-stopwatch -activity_version = 8 +activity_version = 9 show_launcher = yes diff --git a/setup.py b/setup.py index 530f97c..530f97c 100644..100755 --- a/setup.py +++ b/setup.py diff --git a/stopwatch.py b/stopwatch.py index d24f0e3..ddb4c3c 100644 --- a/stopwatch.py +++ b/stopwatch.py @@ -123,7 +123,10 @@ class WatchModel(): timeval = event_time - timeval return self._set_state((timeval, s)) - + + def is_running(self): + return self._state[1] == WatchModel.STATE_RUNNING + def _set_state(self, q): self._logger.debug("_set_state") if self._state != q: @@ -442,6 +445,8 @@ class GUIView(): def set_state(self,states): for i in xrange(GUIView.NUM_WATCHES): self._watches[i].reset(states[i][0], states[i][1]) + if self._watches[i].is_running(): + suspend.inhibit() def get_marks(self): return [list(m) for m in self._markers] -- cgit v0.9.1