diff --git a/ankiqt/ui/cardlist.py b/ankiqt/ui/cardlist.py index 2cfd6ce26..5368a8545 100644 --- a/ankiqt/ui/cardlist.py +++ b/ankiqt/ui/cardlist.py @@ -123,12 +123,22 @@ class DeckModel(QAbstractTableModel): sort = "" if isinstance(self.sortKey, types.StringType): # card property - sort = "order by cards." + self.sortKey + if self.sortKey == "fact": + sort = "order by facts.created, cards.created" + else: + sort = "order by cards." + self.sortKey if self.sortKey in ("question", "answer"): sort += " collate nocase" - query = ("select id from cards ") - if ads: - query += "where %s " % ads + if self.sortKey == "fact": + query = """ +select cards.id from cards, facts +where cards.factId = facts.id """ + if ads: + query += ads + " " + else: + query = "select id from cards " + if ads: + query += "where %s " % ads query += sort else: # field value @@ -345,7 +355,8 @@ class EditDeck(QMainWindow): self.dialog.tagList.setFixedWidth(130) self.dialog.tagList.clear() self.dialog.tagList.addItems(QStringList( - [_(''), _('No tags')] + self.alltags)) + [_(''), _('No tags')] + + [x.replace("_", " ") for x in self.alltags])) self.dialog.tagList.view().setFixedWidth(200) def drawSort(self): @@ -358,6 +369,7 @@ class EditDeck(QMainWindow): _("Interval"), _("Reps"), _("Ease"), + _("Fact Created"), ] self.sortFields = sorted(self.deck.allFields()) self.sortList.extend([_("'%s'") % f for f in self.sortFields]) @@ -384,8 +396,10 @@ class EditDeck(QMainWindow): self.sortKey = "reps" elif idx == 7: self.sortKey = "factor" + elif idx == 8: + self.sortKey = "fact" else: - self.sortKey = ("field", self.sortFields[idx-8]) + self.sortKey = ("field", self.sortFields[idx-9]) self.rebuildSortIndex(self.sortKey) self.sortIndex = idx self.deck.setVar('sortIndex', idx) diff --git a/ankiqt/ui/status.py b/ankiqt/ui/status.py index e5bdc0c16..044359029 100644 --- a/ankiqt/ui/status.py +++ b/ankiqt/ui/status.py @@ -70,6 +70,7 @@ class StatusView(object): self.sep1.setShown(shown) self.sep2.setShown(shown) self.sep3.setShown(shown) + self.statusbar.hideOrShow() # Setup and teardown ########################################################################## @@ -182,15 +183,15 @@ class StatusView(object): ngettext("There is %d failed card due soon.", \ "There are %d failed cards due soon.", \ stats['failed']) % stats['failed'] + "
" + - ngettext("There is %d card awaiting review.", + ngettext("There is %d card awaiting review.", "There are %d cards awaiting review.", \ - stats['rev']) % stats['rev'] + "
" + + stats['rev']) % stats['rev'] + "
" + ngettext("There is %d new card due today.", \ "There are %d new cards due today.",\ - stats['new']) % stats['new'] + "

" + + stats['new']) % stats['new'] + "

" + ngettext("There is %d new card in total.", \ "There are %d new cards in total.",\ - stats['new2']) % stats['new2'] + "
" + + stats['new2']) % stats['new2'] + "
" + ngettext("There is %d delayed card.", \ "There are %d delayed cards.", \ stats['spaced']) % stats['spaced'])