add enter/space to proceed from overview

This commit is contained in:
Damien Elmes 2011-03-24 09:05:56 +09:00
parent f561bd1473
commit 05432e1b32
2 changed files with 4 additions and 5 deletions

View file

@ -25,7 +25,9 @@ class Overview(object):
def _keyHandler(self, evt): def _keyHandler(self, evt):
txt = evt.text() txt = evt.text()
if txt == "1": if txt == "1" or evt.key() in (Qt.Key_Enter,
Qt.Key_Return,
Qt.Key_Space):
self._linkHandler("studysel") self._linkHandler("studysel")
elif txt == "2": elif txt == "2":
self._linkHandler("studyall") self._linkHandler("studyall")
@ -119,7 +121,7 @@ $(function () {
buf += line % ( buf += line % (
"<a href=chgrp>%s</a>" % _("Selected Groups"), "<a href=chgrp>%s</a>" % _("Selected Groups"),
counts[0], counts[1], counts[0], counts[1],
but("studysel", _("Study"), "1", "gbut") + but("studysel", _("Study"), _("1, enter, space"), "gbut") +
but("cramsel", _("Cram"), "3")) but("cramsel", _("Cram"), "3"))
buf += line % ( buf += line % (
_("Whole Deck"), _("Whole Deck"),

View file

@ -484,13 +484,10 @@ div#filler {
self.mw.form.statusbar.hideOrShow() self.mw.form.statusbar.hideOrShow()
# fixme: only show progress for reviews, and only when revs due? # fixme: only show progress for reviews, and only when revs due?
# fixme: learn cards are appearing too soon
# fixme: learn cards not appearing after 30 secs
def _updateRemaining(self): def _updateRemaining(self):
counts = list(self.mw.deck.sched.counts()) counts = list(self.mw.deck.sched.counts())
idx = self.mw.deck.sched.countIdx(self.card) idx = self.mw.deck.sched.countIdx(self.card)
counts[idx] = "<u>%s</u>" % (counts[idx]+1) counts[idx] = "<u>%s</u>" % (counts[idx]+1)
buf = _("N:<b>%s</b> L:<b>%s</b> R:<b>%s</b>") % tuple(counts)
space = "&nbsp;" * 2 space = "&nbsp;" * 2
ctxt = '<font color="#000099">%s</font>' % counts[0] ctxt = '<font color="#000099">%s</font>' % counts[0]
ctxt += space + '<font color="#990000">%s</font>' % counts[1] ctxt += space + '<font color="#990000">%s</font>' % counts[1]