From 182610b898ff26d320cc2a95dcdd7819e26dbefe Mon Sep 17 00:00:00 2001 From: Damien Elmes Date: Wed, 7 Jan 2009 10:16:44 +0900 Subject: [PATCH] fix open online bug, status bug --- ankiqt/ui/main.py | 4 +++- ankiqt/ui/status.py | 2 +- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/ankiqt/ui/main.py b/ankiqt/ui/main.py index a23bdd68b..d5dde9a7a 100644 --- a/ankiqt/ui/main.py +++ b/ankiqt/ui/main.py @@ -1448,7 +1448,9 @@ day = :d""", d=yesterday) self.deck.s.flush() self.deck.s.commit() if self.loadAfterSync == 2: - # special case for open online: mark temp deck as in-memory + # ugly hack for open online: mark temp deck as in-memory + self.deck.tmpMediaDir = re.sub( + "(?i)\.(anki)$", ".media", self.deck.path) self.deck.path = None self.deck.flushMod() elif not self.hideWelcome: diff --git a/ankiqt/ui/status.py b/ankiqt/ui/status.py index aec754bd2..8a9cc677e 100644 --- a/ankiqt/ui/status.py +++ b/ankiqt/ui/status.py @@ -231,7 +231,7 @@ You should aim to answer each question within
return if not self.timer: return - if self.main.state in ("showQuestion", "showAnswer"): + if self.main.deck and self.main.state in ("showQuestion", "showAnswer"): if self.main.currentCard: if self.main.deck.sessionStartTime: t = time.time() - self.main.deck.sessionStartTime