show the original deck too when a card is in a cram deck

This commit is contained in:
Damien Elmes 2012-03-19 22:48:53 +09:00
parent b8ae9f06a8
commit d79ca13dd7

View file

@ -227,6 +227,12 @@ class DataModel(QAbstractTableModel):
return _("(new)") return _("(new)")
return "%d%%" % (c.factor/10) return "%d%%" % (c.factor/10)
elif type == "deck": elif type == "deck":
if c.odid:
# in a cram deck
return "%s (%s)" % (
self.browser.mw.col.decks.name(c.did),
self.browser.mw.col.decks.name(c.odid))
# normal deck
return self.browser.mw.col.decks.name(c.did) return self.browser.mw.col.decks.name(c.did)
def question(self, c): def question(self, c):
@ -518,7 +524,7 @@ class Browser(QMainWindow):
def onSortChanged(self, idx, ord): def onSortChanged(self, idx, ord):
type = self.model.activeCols[idx] type = self.model.activeCols[idx]
noSort = ("question", "answer", "template", "deck", "ndeck") noSort = ("question", "answer", "template", "deck")
if type in noSort: if type in noSort:
showInfo(_("Sorting on this column is not supported. Please " showInfo(_("Sorting on this column is not supported. Please "
"choose another.")) "choose another."))