From fe3f1c155c34f2fcdce3646a7a0d64edd485417a Mon Sep 17 00:00:00 2001 From: Joris Date: Sun, 7 Jun 2020 12:39:47 +0200 Subject: Sorter tags alphabetically in dialog form --- todo/gui/tags/list.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/todo/gui/tags/list.py b/todo/gui/tags/list.py index d0374ed..857b6ff 100644 --- a/todo/gui/tags/list.py +++ b/todo/gui/tags/list.py @@ -30,7 +30,7 @@ def widget(parent, init_tags: List[int]) -> Tuple[QtWidgets.QWidget, SelectionSi list_widget.setSelectionMode(QtWidgets.QAbstractItemView.MultiSelection) layout.addWidget(list_widget) - tags = todo.db.tags.get(todo.database.cursor()) + tags = sorted(todo.db.tags.get(todo.database.cursor()), key=lambda t: t.name) for tag in tags: item = QtWidgets.QListWidgetItem(tag.name) -- cgit v1.2.3