From cd87adbe718bec1907783f51d6114e307dce9839 Mon Sep 17 00:00:00 2001 From: Damien Elmes Date: Wed, 22 Apr 2009 21:37:42 +0900 Subject: [PATCH] fix new count where cards are suspended, highlight type in blue too --- anki/deck.py | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/anki/deck.py b/anki/deck.py index ac4407f2a..14bc73c7e 100644 --- a/anki/deck.py +++ b/anki/deck.py @@ -647,7 +647,10 @@ type = 0 and isDue = 1 and combinedDue <= :now""", now=time.time()) def nextDueMsg(self): next = self.earliestTime() if next: - newCardsTomorrow = min(self.newCount, self.newCardsPerDay) + newCount = self.s.scalar(""" +select count() from cards where type = 2 +and priority in (1,2,3,4)""") + newCardsTomorrow = min(newCount, self.newCardsPerDay) cards = self.cardsDueBy(time.time() + 86400) msg = _('''\ @@ -696,15 +699,15 @@ and priority in (1,2,3,4) and type in (0, 1)""", time=time) spaceSusp = "" c= self.newSpacedCount() if c: - spaceSusp += ngettext('There is %d delayed new card.', - 'There are %d delayed new cards.', + spaceSusp += ngettext('There is %d delayed new card.', + 'There are %d delayed new cards.', c) % c c2 = self.suspendedCardCount() if c2: if c: spaceSusp += "
" - spaceSusp += ngettext('There is %d suspended card.', - 'There are %d suspended cards.', + spaceSusp += ngettext('There is %d suspended card.', + 'There are %d suspended cards.', c2) % c2 if spaceSusp: spaceSusp = "

" + spaceSusp