new learn early handling, add tooltips

This commit is contained in:
Damien Elmes 2009-05-06 14:14:38 +09:00
parent b715059bfd
commit a9e7ecff12
2 changed files with 17 additions and 3 deletions

View file

@ -863,7 +863,13 @@ To upgrade an old deck, download Anki 0.9.8.7."""))
def _showToolTip(self, msg):
QToolTip.showText(
self.mainWin.statusbar.mapToGlobal(QPoint(0, -40)),
msg)
"""\
<table cellpadding=10>
<tr>
<td><img src=":/icons/help-hint.png"></td>
<td>%s</td>
</tr>
</table>""" % msg)
def save(self, required=False):
if not self.deck.path:
@ -1644,12 +1650,16 @@ it to your friends.
##########################################################################
def onLearnMore(self):
self.deck.extraNewCards += self.config['extraNewCards']
self.deck.newEarly = True
self.reset()
self.showToolTip(_("""\
<h1>Learning More</h1>Click the clock in the toolbar to finish."""))
def onReviewEarly(self):
self.deck.reviewEarly = True
self.reset()
self.showToolTip(_("""\
<h1>Reviewing Early</h1>Click the clock in the toolbar to finish."""))
# Language handling
##########################################################################

View file

@ -175,7 +175,11 @@ class StatusView(object):
remStr += "%(failed1)s&nbsp;&nbsp;%(rev1)s&nbsp;&nbsp;<u>%(new1)s</u>"
stats['failed1'] = '<font color=#990000>%s</font>' % stats['failed']
stats['rev1'] = '<font color=#000000>%s</font>' % stats['rev']
stats['new1'] = '<font color=#0000ff>%s</font>' % stats['new']
if self.main.deck.newEarly:
new = self.main.deck.newCount
else:
new = stats['new']
stats['new1'] = '<font color=#0000ff>%s</font>' % new
self.remText.setText(remStr % stats)
stats['spaced'] = self.main.deck.spacedCardCount()
stats['new2'] = self.main.deck.newCount