mirror of
https://github.com/ankitects/anki.git
synced 2025-09-20 06:52:21 -04:00
Merge branch 'master' of git://ichi2.net/ankiqt
This commit is contained in:
commit
60baf9efd8
2 changed files with 25 additions and 10 deletions
|
@ -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(
|
||||
[_('<Tag filter>'), _('No tags')] + self.alltags))
|
||||
[_('<Tag filter>'), _('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)
|
||||
|
|
|
@ -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 <b>%d</b> failed card due soon.", \
|
||||
"There are <b>%d</b> failed cards due soon.", \
|
||||
stats['failed']) % stats['failed'] + "<br>" +
|
||||
ngettext("There is <b>%d</b> card awaiting review.",
|
||||
ngettext("There is <b>%d</b> card awaiting review.",
|
||||
"There are <b>%d</b> cards awaiting review.", \
|
||||
stats['rev']) % stats['rev'] + "<br>" +
|
||||
stats['rev']) % stats['rev'] + "<br>" +
|
||||
ngettext("There is <b>%d</b> new card due today.", \
|
||||
"There are <b>%d</b> new cards due today.",\
|
||||
stats['new']) % stats['new'] + "<br><br>" +
|
||||
stats['new']) % stats['new'] + "<br><br>" +
|
||||
ngettext("There is <b>%d</b> new card in total.", \
|
||||
"There are <b>%d</b> new cards in total.",\
|
||||
stats['new2']) % stats['new2'] + "<br>" +
|
||||
stats['new2']) % stats['new2'] + "<br>" +
|
||||
ngettext("There is <b>%d</b> delayed card.", \
|
||||
"There are <b>%d</b> delayed cards.", \
|
||||
stats['spaced']) % stats['spaced'])
|
||||
|
|
Loading…
Reference in a new issue