mirror of
https://github.com/Ultimaker/Cura.git
synced 2025-11-29 22:01:14 -07:00
Fixed XML setMetaDataEntry for changing too much meta data. Contributes to CURA-2159
This commit is contained in:
parent
717437647b
commit
fb3f03b446
3 changed files with 9 additions and 1 deletions
|
|
@ -38,13 +38,16 @@ class XmlMaterialProfile(UM.Settings.InstanceContainer):
|
||||||
def setMetaDataEntry(self, key, value):
|
def setMetaDataEntry(self, key, value):
|
||||||
if self.isReadOnly():
|
if self.isReadOnly():
|
||||||
return
|
return
|
||||||
|
if self.getMetaDataEntry(key, None) == value:
|
||||||
|
# Prevent loop caused by for loop.
|
||||||
|
return
|
||||||
|
|
||||||
super().setMetaDataEntry(key, value)
|
super().setMetaDataEntry(key, value)
|
||||||
|
|
||||||
basefile = self.getMetaDataEntry("base_file", self._id) #if basefile is self.id, this is a basefile.
|
basefile = self.getMetaDataEntry("base_file", self._id) #if basefile is self.id, this is a basefile.
|
||||||
# Update all containers that share GUID and basefile
|
# Update all containers that share GUID and basefile
|
||||||
for container in UM.Settings.ContainerRegistry.getInstance().findInstanceContainers(base_file = basefile):
|
for container in UM.Settings.ContainerRegistry.getInstance().findInstanceContainers(base_file = basefile):
|
||||||
container.setMetaData(copy.deepcopy(self._metadata))
|
container.setMetaDataEntry(key, value)
|
||||||
|
|
||||||
## Overridden from InstanceContainer, similar to setMetaDataEntry.
|
## Overridden from InstanceContainer, similar to setMetaDataEntry.
|
||||||
# without this function the setName would only set the name of the specific nozzle / material / machine combination container
|
# without this function the setName would only set the name of the specific nozzle / material / machine combination container
|
||||||
|
|
|
||||||
|
|
@ -19,6 +19,10 @@ UM.ManagementPage
|
||||||
filter:
|
filter:
|
||||||
{
|
{
|
||||||
var result = { "type": "material" }
|
var result = { "type": "material" }
|
||||||
|
CuraApplication.log(" # filterMaterialsByMachine " + Cura.MachineManager.filterMaterialsByMachine);
|
||||||
|
CuraApplication.log(" # filterQualityByMachine " + Cura.MachineManager.filterQualityByMachine);
|
||||||
|
CuraApplication.log(" # Cura.MachineManager.activeDefinitionId " + Cura.MachineManager.activeDefinitionId);
|
||||||
|
CuraApplication.log(" # Cura.MachineManager.activeVariantId " + Cura.MachineManager.activeVariantId);
|
||||||
if(Cura.MachineManager.filterMaterialsByMachine)
|
if(Cura.MachineManager.filterMaterialsByMachine)
|
||||||
{
|
{
|
||||||
result.definition = Cura.MachineManager.activeDefinitionId
|
result.definition = Cura.MachineManager.activeDefinitionId
|
||||||
|
|
|
||||||
|
|
@ -21,6 +21,7 @@ UM.ManagementPage
|
||||||
filter:
|
filter:
|
||||||
{
|
{
|
||||||
var result = { "type": "quality*", "extruder": null };
|
var result = { "type": "quality*", "extruder": null };
|
||||||
|
CuraApplication.log(" ## filterQualityByMachine " + Cura.MachineManager.filterQualityByMachine);
|
||||||
if(Cura.MachineManager.filterQualityByMachine)
|
if(Cura.MachineManager.filterQualityByMachine)
|
||||||
{
|
{
|
||||||
result.definition = Cura.MachineManager.activeQualityDefinitionId;
|
result.definition = Cura.MachineManager.activeQualityDefinitionId;
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue