From b4f1d0ec7726e992cb411574938686e81da4b2a8 Mon Sep 17 00:00:00 2001 From: Veronica Berglyd Olsen <1619840+vkbo@users.noreply.github.com> Date: Tue, 31 Dec 2024 00:59:25 +0100 Subject: [PATCH] Fix bug in status label import --- novelwriter/dialogs/projectsettings.py | 1 + tests/test_dialogs/test_dlg_projectsettings.py | 2 ++ 2 files changed, 3 insertions(+) diff --git a/novelwriter/dialogs/projectsettings.py b/novelwriter/dialogs/projectsettings.py index a1ad9acf..af288006 100644 --- a/novelwriter/dialogs/projectsettings.py +++ b/novelwriter/dialogs/projectsettings.py @@ -570,6 +570,7 @@ class _StatusPage(NFixedPage): for row in csv.reader(fo): if entry := self._store.fromRaw(row): self._addItem(None, entry) + self._changed = True except Exception as exc: SHARED.error("Could not read file.", exc=exc) return diff --git a/tests/test_dialogs/test_dlg_projectsettings.py b/tests/test_dialogs/test_dlg_projectsettings.py index 93714a81..34a960a6 100644 --- a/tests/test_dialogs/test_dlg_projectsettings.py +++ b/tests/test_dialogs/test_dlg_projectsettings.py @@ -362,6 +362,7 @@ def testDlgProjSettings_StatusImportExport(qtbot, monkeypatch, nwGUI, projPath, status._importLabels() assert status.listBox.topLevelItemCount() == 4 + assert status.changed is False # Import File with monkeypatch.context() as mp: @@ -369,6 +370,7 @@ def testDlgProjSettings_StatusImportExport(qtbot, monkeypatch, nwGUI, projPath, status._importLabels() assert status.listBox.topLevelItemCount() == 8 + assert status.changed is True item4 = status.listBox.topLevelItem(4) assert item4 is not None