update card stats when transitioning to finished screen, too

This commit is contained in:
Damien Elmes 2010-02-01 03:37:39 +09:00
parent a1728ffec4
commit d28096241a

View file

@ -342,6 +342,7 @@ Please do not file a bug report with Anki.<br>""")
self.bodyView.setState(state) self.bodyView.setState(state)
# focus finish button # focus finish button
self.mainWin.finishButton.setFocus() self.mainWin.finishButton.setFocus()
runHook('deckFinished')
elif state == "showQuestion": elif state == "showQuestion":
self.reviewingStarted = True self.reviewingStarted = True
if self.deck.mediaDir(): if self.deck.mediaDir():
@ -1691,6 +1692,7 @@ learnt today")
def onCardStats(self): def onCardStats(self):
addHook("showQuestion", self.onCardStats) addHook("showQuestion", self.onCardStats)
addHook("deckFinished", self.onCardStats)
txt = "" txt = ""
if self.currentCard: if self.currentCard:
txt += _("<h1>Current card</h1>") txt += _("<h1>Current card</h1>")
@ -1705,6 +1707,7 @@ learnt today")
def removeCardStatsHook(self): def removeCardStatsHook(self):
"Remove the update hook if the help menu was changed." "Remove the update hook if the help menu was changed."
removeHook("showQuestion", self.onCardStats) removeHook("showQuestion", self.onCardStats)
removeHook("deckFinished", self.onCardStats)
def onShowGraph(self): def onShowGraph(self):
if ui.utils.pyQtBroken: if ui.utils.pyQtBroken: