From 2cd8a92584faf219124bce7a381e29836ad573a2 Mon Sep 17 00:00:00 2001 From: Damien Elmes Date: Tue, 20 Jan 2009 01:15:33 +0900 Subject: [PATCH] redraw status every minute --- ankiqt/ui/status.py | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/ankiqt/ui/status.py b/ankiqt/ui/status.py index ff4023808..40cb38c0a 100644 --- a/ankiqt/ui/status.py +++ b/ankiqt/ui/status.py @@ -27,12 +27,16 @@ class StatusView(object): self.shown = [] self.hideBorders() self.setState("noDeck") - self.thinkingTimer = QTimer(parent) - self.thinkingTimer.start(1000) self.timer = None self.timerFlashStart = 0 + self.thinkingTimer = QTimer(parent) + self.thinkingTimer.start(1000) parent.connect(self.thinkingTimer, SIGNAL("timeout()"), self.drawTimer) + self.countTimer = QTimer(parent) + self.countTimer.start(60000) + parent.connect(self.countTimer, SIGNAL("timeout()"), + self.updateCount) addHook("showQuestion", self.flashTimer) # State control @@ -258,3 +262,8 @@ You should aim to answer each question within
self.timer.setText('%02d:%02d' % (t/60, t%60)) self.timerFlashStart = time.time() + + def updateCount(self): + if self.state in ("showQuestion", "showAnswer"): + self.main.deck.checkDue() + self.redraw()