make showing stats optional

This commit is contained in:
Damien Elmes 2009-01-14 13:47:06 +09:00
parent 8fe8072a2f
commit 8c41fabb11
2 changed files with 15 additions and 10 deletions

View file

@ -73,6 +73,7 @@ class Config(dict):
'alternativeTheme': False,
'showStudyScreen': True,
'showStudyOptions': False,
'showStudyStats': True,
'showCardTimer': True,
'created': time.time(),
'id': genID(),

View file

@ -1019,10 +1019,7 @@ day = :d""", d=yesterday)
anki.utils.fmtTimeSpan(ttoday, short=True, point=1))
h['timeTodayChg'] = str(anki.utils.fmtTimeSpan(
tyest, short=True, point=1))
self.mainWin.optionsLabel.setText(top + _("""\
<p>
<table width=300>
<tr><td>
stats1 = """\
<table>
<tr><td width=80>Cards/session:</td><td width=50><b>%(repsInSes)s</b></td>
<td>%(repsInSesChg)s</td></tr>
@ -1030,15 +1027,22 @@ day = :d""", d=yesterday)
<td>%(repsTodayChg)s</td></tr>
<tr><td>Time/day:</td><td><b>%(timeToday)s</b></td>
<td>%(timeTodayChg)s</td></tr>
</table>
</td><td>&nbsp;&nbsp;&nbsp;&nbsp;</td><td>
</table>""" % h
stats2 = """\
<table width=150>
<tr><td>Reviews today:</td><td align=right><b>%(ret)s</b></td></tr>
<tr><td width=100>Reviews today:</td><td align=right><b>%(ret)s</b></td></tr>
<tr><td>New today:</td><td align=right><b>%(new)s</b></td></tr>
<tr><td>New total:</td><td align=right>%(newof)s</td></tr>
</table>
</td></tr></table>""") % h)
</table>""" % h
if (not dyest and not dtoday) or not self.config['showStudyStats']:
stats1 = ""
else:
stats1 = (
"<td>%s</td><td>&nbsp;&nbsp;&nbsp;&nbsp;</td>" % stats1)
self.mainWin.optionsLabel.setText(top + """\
<p><table><tr>
%s
<td>%s</td></tr></table>""" % (stats1, stats2))
def showStudyScreen(self):
initial = self.deck.sessionStartTime == 0