mirror of
https://github.com/Ultimaker/Cura.git
synced 2025-07-18 04:07:57 -06:00
Start implementing a createQualityChanges method in ContainerManager
It will be used to create the quality change containers from the existing user containers. Contributes to CURA-2006
This commit is contained in:
parent
0934ae70a8
commit
9ef709962f
1 changed files with 22 additions and 0 deletions
|
@ -381,6 +381,28 @@ class ContainerManager(QObject):
|
||||||
extruder.getTop().clear()
|
extruder.getTop().clear()
|
||||||
|
|
||||||
global_stack.getTop().clear()
|
global_stack.getTop().clear()
|
||||||
|
|
||||||
|
@pyqtSlot()
|
||||||
|
def createQualityChanges(self):
|
||||||
|
global_stack = UM.Application.getInstance().getGlobalContainerStack()
|
||||||
|
|
||||||
|
user_container = global_stack.getTop()
|
||||||
|
quality_container = global_stack.findContainer(type = "quality")
|
||||||
|
if not quality_container:
|
||||||
|
return
|
||||||
|
|
||||||
|
unique_name = UM.Settings.ContainerRegistry.getInstance().uniqueName(quality_container.getName())
|
||||||
|
unique_id = unique_name.lower()
|
||||||
|
unique_id.replace(" ", "_")
|
||||||
|
|
||||||
|
quality_changes = user_container.duplicate()
|
||||||
|
quality_changes.setMetaDataEntry("type", "quality_changes")
|
||||||
|
quality_changes.setMetaDataEntry("quality_base", quality_container.getId())
|
||||||
|
|
||||||
|
UM.Settings.ContainerRegistry.getInstance().addContainer(quality_changes)
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
# Factory function, used by QML
|
# Factory function, used by QML
|
||||||
@staticmethod
|
@staticmethod
|
||||||
def createContainerManager(engine, js_engine):
|
def createContainerManager(engine, js_engine):
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue