From 54c7c5a4633b16a2e506f8a977bfd59cac7f0122 Mon Sep 17 00:00:00 2001 From: Veronica Berglyd Olsen <1619840+vkbo@users.noreply.github.com> Date: Thu, 4 Jul 2024 16:19:04 +0200 Subject: [PATCH] Add path info to open project error dialogs (#1944) --- novelwriter/core/project.py | 18 ++++++++++++++---- 1 file changed, 14 insertions(+), 4 deletions(-) diff --git a/novelwriter/core/project.py b/novelwriter/core/project.py index bd269fa4e..f018cfd7f 100644 --- a/novelwriter/core/project.py +++ b/novelwriter/core/project.py @@ -254,13 +254,23 @@ def openProject(self, projPath: str | Path, clearLock: bool = False) -> bool: status = self._storage.initProjectStorage(projPath, clearLock) if status != NWStorageOpen.READY: if status == NWStorageOpen.UNKOWN: - SHARED.error(self.tr("Not a known project file format.")) + SHARED.error( + self.tr("Not a known project file format."), + info=self.tr("Path: {0}").format(str(projPath)) + ) elif status == NWStorageOpen.NOT_FOUND: - SHARED.error(self.tr("Project file not found.")) + SHARED.error( + self.tr("Project file not found."), + info=self.tr("Path: {0}").format(str(projPath)) + ) + elif status == NWStorageOpen.FAILED: + SHARED.error( + self.tr("Failed to open project."), + info=self.tr("Path: {0}").format(str(projPath)), + exc=self._storage.exc + ) elif status == NWStorageOpen.LOCKED: self._state = NWProjectState.LOCKED - elif status == NWStorageOpen.FAILED: - SHARED.error(self.tr("Failed to open project."), exc=self._storage.exc) return False # Read Project XML