mirror of
https://github.com/ankitects/anki.git
synced 2025-09-23 08:22:24 -04:00
ensure we pass a real bool to setChecked(); fix due for lrn
This commit is contained in:
parent
a18b5c5075
commit
6af10e4d01
1 changed files with 8 additions and 6 deletions
|
@ -253,12 +253,14 @@ class DeckModel(QAbstractTableModel):
|
||||||
return s
|
return s
|
||||||
|
|
||||||
def nextDue(self, c, index):
|
def nextDue(self, c, index):
|
||||||
if c.type == 0:
|
if c.queue == 0:
|
||||||
return str(c.due) #_("(new)")
|
return str(c.due)
|
||||||
elif c.type == 1:
|
elif c.queue == 1:
|
||||||
date = c.due
|
date = c.due
|
||||||
elif c.type == 2:
|
elif c.queue == 2:
|
||||||
date = time.time() + ((c.due - self.deck.sched.today)*86400)
|
date = time.time() + ((c.due - self.deck.sched.today)*86400)
|
||||||
|
else:
|
||||||
|
return _("(susp.)")
|
||||||
return time.strftime("%Y-%m-%d", time.localtime(date))
|
return time.strftime("%Y-%m-%d", time.localtime(date))
|
||||||
|
|
||||||
# Line painter
|
# Line painter
|
||||||
|
@ -949,7 +951,7 @@ where id in %s""" % ids2str(self.selectedCards()), mod)
|
||||||
self.form.actionToggleMark.setChecked(self.isMarked())
|
self.form.actionToggleMark.setChecked(self.isMarked())
|
||||||
|
|
||||||
def isSuspended(self):
|
def isSuspended(self):
|
||||||
return self.card and self.card.queue == -1
|
return not not (self.card and self.card.queue == -1)
|
||||||
|
|
||||||
def onSuspend(self, sus):
|
def onSuspend(self, sus):
|
||||||
# focus lost hook may not have chance to fire
|
# focus lost hook may not have chance to fire
|
||||||
|
@ -963,7 +965,7 @@ where id in %s""" % ids2str(self.selectedCards()), mod)
|
||||||
self.mw.requireReset()
|
self.mw.requireReset()
|
||||||
|
|
||||||
def isMarked(self):
|
def isMarked(self):
|
||||||
return self.card and self.card.fact().hasTag("Marked")
|
return not not (self.card and self.card.fact().hasTag("Marked"))
|
||||||
|
|
||||||
def onMark(self, mark):
|
def onMark(self, mark):
|
||||||
if mark:
|
if mark:
|
||||||
|
|
Loading…
Reference in a new issue