enable sorting on the extra browser columns

This commit is contained in:
Damien Elmes 2020-03-21 07:55:53 +10:00
parent 5debd3e0f8
commit 63ce44aaa7

View file

@ -917,31 +917,11 @@ QTableView {{ gridline-color: {grid} }}
def _onSortChanged(self, idx, ord):
type = self.model.activeCols[idx]
noSort = ("question", "answer", "template", "deck", "note", "noteTags")
noSort = ("question", "answer")
if type in noSort:
if type == "template":
showInfo(
_(
"""\
This column can't be sorted on, but you can search for individual card types, \
such as 'card:1'."""
)
)
elif type == "deck":
showInfo(
_(
"""\
This column can't be sorted on, but you can search for specific decks \
by clicking on one on the left."""
)
)
else:
showInfo(
_(
"Sorting on this column is not supported. Please "
"choose another."
)
)
showInfo(
_("Sorting on this column is not supported. Please " "choose another.")
)
type = self.col.conf["sortType"]
if self.col.conf["sortType"] != type:
self.col.conf["sortType"] = type