Add path info to open project error dialogs (#1944)

This commit is contained in:
Veronica Berglyd Olsen
2024-07-04 16:19:04 +02:00
parent d5bcee14f5
commit 54c7c5a463
+14 -4
View File
@@ -254,13 +254,23 @@ class NWProject:
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