mirror of
https://github.com/Ultimaker/Cura.git
synced 2025-07-07 15:07:28 -06:00
Merge branch 'master' of https://github.com/Ultimaker/Cura
This commit is contained in:
commit
701ac7f91e
4 changed files with 41 additions and 3 deletions
|
@ -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)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue