Web   ·   Wiki   ·   Activities   ·   Blog   ·   Lists   ·   Chat   ·   Meeting   ·   Bugs   ·   Git   ·   Translate   ·   Archive   ·   People   ·   Donate
summaryrefslogtreecommitdiffstats
path: root/chess.py
diff options
context:
space:
mode:
authorAneesh Dogra <lionaneesh@gmail.com>2012-12-21 04:11:01 (GMT)
committer Aneesh Dogra <lionaneesh@gmail.com>2012-12-21 04:30:39 (GMT)
commit4414e550c96d74a4851aa370d8fac92cdef78977 (patch)
tree7538f36258841126597499432c6273963678efd7 /chess.py
parentc15ec94388b4aa280797de783dbffaa8547b33d4 (diff)
Add a Timer (threaded) event which pops out an alert when the time exceeds.
Diffstat (limited to 'chess.py')
-rw-r--r--chess.py6
1 files changed, 6 insertions, 0 deletions
diff --git a/chess.py b/chess.py
index 30a1369..d09f9cb 100644
--- a/chess.py
+++ b/chess.py
@@ -133,6 +133,7 @@ class Gnuchess():
stdin=subprocess.PIPE,
stdout=subprocess.PIPE,
stderr=subprocess.STDOUT)
+ self._activity.timer.set_sensitive(False)
if my_move == HINT:
level = 'hard\nbook on\n' # may as well get a good hint
@@ -260,6 +261,11 @@ class Gnuchess():
self._flash_tile([self._xy_to_file_and_rank(
self.black[4].get_xy())])
else:
+ if self._activity.timer.get_text().isdigit() and \
+ (self._activity.time_interval >= 2):
+ self._activity.stopwatch(self._activity.time_interval,
+ self._activity.alert_time)
+
if len(self.move_list) % 2 == 0:
self._activity.status.set_label(_("It is White's move."))
else: