From d4052568be4950f08290445793dddb721db115bb Mon Sep 17 00:00:00 2001 From: "Veronica K. B. Olsen" <1619840+vkbo@users.noreply.github.com> Date: Thu, 20 Aug 2020 20:36:33 +0200 Subject: [PATCH] Make sure new replace items in project settings are inserted at the top --- nw/gui/projsettings.py | 2 +- tests/test_gui.py | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/nw/gui/projsettings.py b/nw/gui/projsettings.py index 066c618f..52d82809 100644 --- a/nw/gui/projsettings.py +++ b/nw/gui/projsettings.py @@ -617,7 +617,7 @@ class GuiProjectEditReplace(QWidget): saveKey = "" % (self.listBox.topLevelItemCount() + 1) newVal = "" newItem = QTreeWidgetItem([saveKey, newVal]) - self.listBox.addTopLevelItem(newItem) + self.listBox.insertTopLevelItem(0, newItem) return True def _delEntry(self): diff --git a/tests/test_gui.py b/tests/test_gui.py index cb6aa05e..4b0d1107 100644 --- a/tests/test_gui.py +++ b/tests/test_gui.py @@ -372,8 +372,8 @@ def testProjectEditor(qtbot, nwTempGUI, nwRef, nwTemp): projFile = path.join(nwTempGUI, "nwProject.nwx") assert cmpFiles(projFile, path.join(nwRef, "gui", "2_nwProject.nwx"), [2, 8, 9, 10]) - nwGUI.closeMain() # qtbot.stopForInteraction() + nwGUI.closeMain() @pytest.mark.gui def testItemEditor(qtbot, nwTempGUI, nwRef, nwTemp):