mirror of
https://github.com/ankitects/anki.git
synced 2025-09-20 23:12:21 -04:00
spaced check is expensive, don't do it in status, and don't redraw on init
This commit is contained in:
parent
986d605a44
commit
d504e754b0
1 changed files with 1 additions and 6 deletions
|
@ -137,7 +137,6 @@ class StatusView(object):
|
||||||
self.timer = QClickableLabel()
|
self.timer = QClickableLabel()
|
||||||
self.timer.setText("00:00")
|
self.timer.setText("00:00")
|
||||||
self.addWidget(self.timer)
|
self.addWidget(self.timer)
|
||||||
self.redraw()
|
|
||||||
|
|
||||||
def addWidget(self, w, stretch=0):
|
def addWidget(self, w, stretch=0):
|
||||||
self.statusbar.addWidget(w, stretch)
|
self.statusbar.addWidget(w, stretch)
|
||||||
|
@ -188,7 +187,6 @@ class StatusView(object):
|
||||||
new = stats['new']
|
new = stats['new']
|
||||||
stats['new1'] = '<font color=#0000ff>%s</font>' % new
|
stats['new1'] = '<font color=#0000ff>%s</font>' % new
|
||||||
self.remText.setText(remStr % stats)
|
self.remText.setText(remStr % stats)
|
||||||
stats['spaced'] = self.main.deck.spacedCardCount()
|
|
||||||
stats['new2'] = self.main.deck.newCount
|
stats['new2'] = self.main.deck.newCount
|
||||||
self.remText.setToolTip("<h1>" +_(
|
self.remText.setToolTip("<h1>" +_(
|
||||||
"Remaining cards") + "</h1><p/>" +
|
"Remaining cards") + "</h1><p/>" +
|
||||||
|
@ -203,10 +201,7 @@ class StatusView(object):
|
||||||
stats['new']) % stats['new'] + "<br><br>" +
|
stats['new']) % stats['new'] + "<br><br>" +
|
||||||
ngettext("There is <b>%d</b> new card in total.", \
|
ngettext("There is <b>%d</b> new card in total.", \
|
||||||
"There are <b>%d</b> new cards in total.",\
|
"There are <b>%d</b> new cards in total.",\
|
||||||
stats['new2']) % stats['new2'] + "<br>" +
|
stats['new2']) % stats['new2'])
|
||||||
ngettext("There is <b>%d</b> delayed card.", \
|
|
||||||
"There are <b>%d</b> delayed cards.", \
|
|
||||||
stats['spaced']) % stats['spaced'])
|
|
||||||
# eta
|
# eta
|
||||||
self.etaText.setText(_("ETA: <b>%(timeLeft)s</b>") % stats)
|
self.etaText.setText(_("ETA: <b>%(timeLeft)s</b>") % stats)
|
||||||
# retention & progress bars
|
# retention & progress bars
|
||||||
|
|
Loading…
Reference in a new issue