This commit is contained in:
Diego Prado Gesto 2018-02-01 09:05:32 +01:00
commit 701ac7f91e
4 changed files with 41 additions and 3 deletions

View file

@ -459,7 +459,7 @@ class ContainerManager(QObject):
# \return \type{Dict} dict with a 'status' key containing the string 'success' or 'error', and a 'message' key
# containing a message for the user
@pyqtSlot(QUrl, result = "QVariantMap")
def importContainer(self, file_url_or_string: Union[QUrl, str]) -> Dict[str, str]:
def importMaterialContainer(self, file_url_or_string: Union[QUrl, str]) -> Dict[str, str]:
if not file_url_or_string:
return { "status": "error", "message": "Invalid path"}
@ -490,8 +490,9 @@ class ContainerManager(QObject):
container.deserialize(f.read())
except PermissionError:
return { "status": "error", "message": "Permission denied when trying to read the file"}
except Exception as ex:
return {"status": "error", "message": str(ex)}
container.setName(container_id)
container.setDirty(True)
self._container_registry.addContainer(container)