mirror of
https://github.com/Ultimaker/Cura.git
synced 2025-07-07 06:57:28 -06:00
Solve material properties not being saved. CURA-2586
This commit is contained in:
parent
ff270642c0
commit
94ccd4b04b
1 changed files with 12 additions and 1 deletions
|
@ -39,7 +39,7 @@ class XmlMaterialProfile(UM.Settings.InstanceContainer):
|
||||||
if self.isReadOnly():
|
if self.isReadOnly():
|
||||||
return
|
return
|
||||||
if self.getMetaDataEntry(key, None) == value:
|
if self.getMetaDataEntry(key, None) == value:
|
||||||
# Prevent loop caused by for loop.
|
# Prevent recursion caused by for loop.
|
||||||
return
|
return
|
||||||
|
|
||||||
super().setMetaDataEntry(key, value)
|
super().setMetaDataEntry(key, value)
|
||||||
|
@ -69,6 +69,17 @@ class XmlMaterialProfile(UM.Settings.InstanceContainer):
|
||||||
for container in containers:
|
for container in containers:
|
||||||
container.setName(new_name)
|
container.setName(new_name)
|
||||||
|
|
||||||
|
## Overridden from InstanceContainer, to set dirty to base file as well.
|
||||||
|
def setDirty(self, dirty):
|
||||||
|
super().setDirty(dirty)
|
||||||
|
base_file = self.getMetaDataEntry("base_file", None)
|
||||||
|
if base_file is not None and base_file != self._id:
|
||||||
|
containers = UM.Settings.ContainerRegistry.getInstance().findContainers(id=base_file)
|
||||||
|
if containers:
|
||||||
|
base_container = containers[0]
|
||||||
|
if not base_container.isReadOnly():
|
||||||
|
base_container.setDirty(dirty)
|
||||||
|
|
||||||
## Overridden from InstanceContainer
|
## Overridden from InstanceContainer
|
||||||
# def setProperty(self, key, property_name, property_value, container = None):
|
# def setProperty(self, key, property_name, property_value, container = None):
|
||||||
# if self.isReadOnly():
|
# if self.isReadOnly():
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue