From dfa183a4613c0262273e856b3eca04222ea1ba1f Mon Sep 17 00:00:00 2001 From: Simone Gaiarin Date: Sat, 4 Oct 2014 20:09:22 +0200 Subject: [PATCH 1/2] Remove unuseful statement, it does nothing --- aqt/customstudy.py | 1 - 1 file changed, 1 deletion(-) diff --git a/aqt/customstudy.py b/aqt/customstudy.py index af820be4e..430d79e7c 100644 --- a/aqt/customstudy.py +++ b/aqt/customstudy.py @@ -53,7 +53,6 @@ class CustomStudy(QDialog): return ""+str(num)+"" if idx == RADIO_NEW: new = self.mw.col.sched.totalNewForCurrentDeck() - self.deck['newToday'] tit = _("New cards in deck: %s") % plus(new) pre = _("Increase today's new card limit by") sval = min(new, self.deck.get('extendNew', 10)) From b52159edd0a891d0ad5cfdf6820312498e4cf5d9 Mon Sep 17 00:00:00 2001 From: Simone Gaiarin Date: Sat, 4 Oct 2014 22:01:21 +0200 Subject: [PATCH 2/2] Improve usability of increase new/review card limit dialog *Show to the user the number of card left in the deck exceeding the ones under review *Fix spin box max value accordingly --- aqt/customstudy.py | 14 +++++++++++--- 1 file changed, 11 insertions(+), 3 deletions(-) diff --git a/aqt/customstudy.py b/aqt/customstudy.py index 430d79e7c..d16007513 100644 --- a/aqt/customstudy.py +++ b/aqt/customstudy.py @@ -23,6 +23,7 @@ class CustomStudy(QDialog): QDialog.__init__(self, mw) self.mw = mw self.deck = self.mw.col.decks.current() + self.conf = self.mw.col.decks.getConf(self.deck['conf']) self.form = f = aqt.forms.customstudy.Ui_Dialog() f.setupUi(self) self.setWindowModality(Qt.WindowModal) @@ -53,15 +54,22 @@ class CustomStudy(QDialog): return ""+str(num)+"" if idx == RADIO_NEW: new = self.mw.col.sched.totalNewForCurrentDeck() - tit = _("New cards in deck: %s") % plus(new) + # get the number of new cards in deck that exceed the new cards limit + newUnderLearning = min(new, self.conf['new']['perDay'] - self.deck['newToday'][1]) + newExceeding = min(new, new - newUnderLearning) + tit = _("New cards in deck over today limit: %s") % plus(newExceeding) pre = _("Increase today's new card limit by") sval = min(new, self.deck.get('extendNew', 10)) - smax = new + smax = newExceeding elif idx == RADIO_REV: rev = self.mw.col.sched.totalRevForCurrentDeck() - tit = _("Reviews due in deck: %s") % plus(rev) + # get the number of review due in deck that exceed the review due limit + revUnderLearning = min(rev, self.conf['rev']['perDay'] - self.deck['revToday'][1]) + revExceeding = min(rev, rev - revUnderLearning) + tit = _("Reviews due in deck over today limit: %s") % plus(revExceeding) pre = _("Increase today's review limit by") sval = min(rev, self.deck.get('extendRev', 10)) + smax = revExceeding elif idx == RADIO_FORGOT: pre = _("Review cards forgotten in last") post = _("days")