mirror of
https://github.com/Ultimaker/Cura.git
synced 2025-07-23 06:33:55 -06:00
Merge branch 'master' into feature_local_container_server
This commit is contained in:
commit
1029d4509c
117 changed files with 15146 additions and 3512 deletions
|
@ -63,7 +63,18 @@ class ContainerManager(QObject):
|
|||
return ""
|
||||
|
||||
container = containers[0]
|
||||
new_container = self.duplicateContainerInstance(container)
|
||||
return new_container.getId()
|
||||
|
||||
## Create a duplicate of the given container instance
|
||||
#
|
||||
# This will create and add a duplicate of the container that was passed.
|
||||
#
|
||||
# \param container \type{ContainerInterface} The container to duplicate.
|
||||
#
|
||||
# \return The duplicated container, or None if duplication failed.
|
||||
def duplicateContainerInstance(self, container):
|
||||
new_container = None
|
||||
new_name = self._container_registry.uniqueName(container.getName())
|
||||
# Only InstanceContainer has a duplicate method at the moment.
|
||||
# So fall back to serialize/deserialize when no duplicate method exists.
|
||||
|
@ -74,10 +85,11 @@ class ContainerManager(QObject):
|
|||
new_container.deserialize(container.serialize())
|
||||
new_container.setName(new_name)
|
||||
|
||||
# TODO: we probably don't want to add it to the registry here!
|
||||
if new_container:
|
||||
self._container_registry.addContainer(new_container)
|
||||
|
||||
return new_container.getId()
|
||||
return new_container
|
||||
|
||||
## Change the name of a specified container to a new name.
|
||||
#
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue