From 8278bcec9efa1086c19881e453963ced382d2354 Mon Sep 17 00:00:00 2001 From: "Veronica K. B. Olsen" Date: Sun, 11 Aug 2019 19:42:42 +0200 Subject: [PATCH] Make the auto-replace list in project settings sorted --- nw/gui/projecteditor.py | 3 +++ sample/sampleNovel/nwProject.nwx | 3 ++- 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/nw/gui/projecteditor.py b/nw/gui/projecteditor.py index 88da6ca6..5ba2e558 100644 --- a/nw/gui/projecteditor.py +++ b/nw/gui/projecteditor.py @@ -336,6 +336,9 @@ class GuiProjectEditReplace(QWidget): newItem = QTreeWidgetItem(["<%s>" % aKey, aVal]) self.listBox.addTopLevelItem(newItem) + self.listBox.sortByColumn(0, Qt.AscendingOrder) + self.listBox.setSortingEnabled(True) + self.editKey = QLineEdit() self.editValue = QLineEdit() self.saveButton = QPushButton(QIcon.fromTheme("document-save"),"") diff --git a/sample/sampleNovel/nwProject.nwx b/sample/sampleNovel/nwProject.nwx index 5f27329d..e0347637 100644 --- a/sample/sampleNovel/nwProject.nwx +++ b/sample/sampleNovel/nwProject.nwx @@ -1,5 +1,5 @@ - + Sample Project Sample Project @@ -14,6 +14,7 @@ 581 B + E D