show + if 1000 or more

This commit is contained in:
Damien Elmes 2011-04-16 11:02:52 +09:00
parent ec8f7d3856
commit d012bdc1a1
2 changed files with 8 additions and 16 deletions

View file

@ -7,6 +7,7 @@ from PyQt4.QtCore import *
from PyQt4.QtGui import *
from anki.consts import NEW_CARDS_RANDOM
from anki.hooks import addHook
from aqt.utils import limitedCount
class Overview(object):
"Deck overview."
@ -68,7 +69,6 @@ class Overview(object):
table=tbl,
fcsub=_("Reviews over next two weeks"),
fcdata=fc,
opts=self._ovOpts(),
), css)
_overviewBody = """
@ -80,7 +80,6 @@ class Overview(object):
<div id="placeholder" style="width:350px; height:100px;"></div>
<span class=sub>%(fcsub)s</span>
<p>
%(opts)s
</center>
<script>
@ -130,18 +129,6 @@ $(function () {
def _ovOpts(self):
return ""
# if self.mw.deck.qconf['newCardOrder'] == NEW_CARDS_RANDOM:
# ord = _("random")
# else:
# ord = _("order added")
# buf = """
# <table width=400>
# <tr><td><b>%s</b></td><td align=center>%s</td></tr>
# <tr><td><b>%s</b></td><td align=center>%s</td></tr>
# </table>""" % (
# _("New cards per day"), self.mw.deck.qconf['newPerDay'],
# _("New card order"), ord)
# return buf
# Data
##########################################################################
@ -151,9 +138,9 @@ $(function () {
selcnt = self.mw.deck.sched.selCounts()
allcnt = self.mw.deck.sched.allCounts()
return [
selcnt[1] + selcnt[2],
limitedCount(selcnt[1] + selcnt[2]),
selcnt[0],
allcnt[1] + allcnt[2],
limitedCount(allcnt[1] + allcnt[2]),
allcnt[0],
]

View file

@ -340,5 +340,10 @@ def maybeHideClose(bbox):
if b:
bbox.removeButton(b)
def limitedCount(count):
if count >= 1000:
return "1000+"
return str(count)
isMac = sys.platform.startswith("darwin")
isWin = sys.platform.startswith("win32")