Fix sample project creation
This commit is contained in:
@@ -331,20 +331,19 @@ class ProjectBuilder:
|
|||||||
logger.error("Invalid call to buildProject function")
|
logger.error("Invalid call to buildProject function")
|
||||||
return False
|
return False
|
||||||
|
|
||||||
path = data.get("path", None)
|
path = data.get("path", None) or None
|
||||||
if path is None:
|
if isinstance(path, (str, Path)):
|
||||||
SHARED.error("A project path is required.")
|
self._path = Path(path).resolve()
|
||||||
return False
|
if data.get("sample", False):
|
||||||
|
return self._extractSampleProject(self._path)
|
||||||
|
elif data.get("template"):
|
||||||
|
return True
|
||||||
|
else:
|
||||||
|
return self._buildAndPopulate(self._path, data)
|
||||||
|
|
||||||
if data.get("sample", False):
|
SHARED.error("A project path is required.")
|
||||||
self._path = path
|
|
||||||
return self._extractSampleProject(path)
|
|
||||||
elif data.get("template"):
|
|
||||||
pass
|
|
||||||
else:
|
|
||||||
self._buildAndPopulate(path, data)
|
|
||||||
|
|
||||||
return True
|
return False
|
||||||
|
|
||||||
##
|
##
|
||||||
# Internal Functions
|
# Internal Functions
|
||||||
@@ -475,7 +474,6 @@ class ProjectBuilder:
|
|||||||
"Failed to create a new example project."
|
"Failed to create a new example project."
|
||||||
), exc=exc)
|
), exc=exc)
|
||||||
return False
|
return False
|
||||||
|
|
||||||
else:
|
else:
|
||||||
SHARED.error(self.tr(
|
SHARED.error(self.tr(
|
||||||
"Failed to create a new example project. "
|
"Failed to create a new example project. "
|
||||||
|
|||||||
@@ -175,7 +175,7 @@ class GuiWelcome(QDialog):
|
|||||||
@pyqtSlot()
|
@pyqtSlot()
|
||||||
@pyqtSlot(Path)
|
@pyqtSlot(Path)
|
||||||
def _setProjectPath(self, path: Path | None = None) -> None:
|
def _setProjectPath(self, path: Path | None = None) -> None:
|
||||||
"""Set the path variable for the project to open."""
|
"""Emit a project open signal."""
|
||||||
if isinstance(path, Path):
|
if isinstance(path, Path):
|
||||||
self.openProjectRequest.emit(path)
|
self.openProjectRequest.emit(path)
|
||||||
self.close()
|
self.close()
|
||||||
|
|||||||
Reference in New Issue
Block a user