Block opening a non-new project in a non-existing location (#1300)
This commit is contained in:
@@ -251,6 +251,9 @@ class NWProject(QObject):
|
|||||||
"""
|
"""
|
||||||
self.clearProject()
|
self.clearProject()
|
||||||
if not self._storage.openProjectInPlace(projPath):
|
if not self._storage.openProjectInPlace(projPath):
|
||||||
|
self.mainGui.makeAlert(self.tr(
|
||||||
|
"Could not open project with path: {0}"
|
||||||
|
).format(projPath), nwAlert.ERROR)
|
||||||
return False
|
return False
|
||||||
|
|
||||||
logger.info("Opening project: %s", projPath)
|
logger.info("Opening project: %s", projPath)
|
||||||
|
|||||||
@@ -102,6 +102,10 @@ class NWStorage:
|
|||||||
# but it can point to a folder containing files
|
# but it can point to a folder containing files
|
||||||
inPath = inPath.parent
|
inPath = inPath.parent
|
||||||
|
|
||||||
|
if not (inPath.is_dir() or newProject):
|
||||||
|
# If the project is not new, the folder must already exist.
|
||||||
|
return False
|
||||||
|
|
||||||
self._storagePath = inPath
|
self._storagePath = inPath
|
||||||
self._runtimePath = inPath
|
self._runtimePath = inPath
|
||||||
self._lockFilePath = inPath / nwFiles.PROJ_LOCK
|
self._lockFilePath = inPath / nwFiles.PROJ_LOCK
|
||||||
@@ -114,7 +118,9 @@ class NWStorage:
|
|||||||
return True
|
return True
|
||||||
|
|
||||||
def openProjectArchive(self, path): # pragma: no cover
|
def openProjectArchive(self, path): # pragma: no cover
|
||||||
pass
|
"""Placeholder for later implementation. See #977.
|
||||||
|
"""
|
||||||
|
return False
|
||||||
|
|
||||||
def runPostSaveTasks(self, autoSave=False): # pragma: no cover
|
def runPostSaveTasks(self, autoSave=False): # pragma: no cover
|
||||||
"""Run tasks after the project has been saved.
|
"""Run tasks after the project has been saved.
|
||||||
|
|||||||
Reference in New Issue
Block a user