mirror of
https://github.com/Ultimaker/Cura.git
synced 2025-07-06 22:47:29 -06:00
First ask the printer which profiles it already has
Only let the printer have one profile per GUID and make sure it's the one with the highest version. Contributes to issue CURA-5034.
This commit is contained in:
parent
0da7ad3946
commit
2dcb185a32
2 changed files with 57 additions and 13 deletions
|
@ -331,9 +331,9 @@ class XmlMaterialProfile(InstanceContainer):
|
|||
stream = io.BytesIO()
|
||||
tree = ET.ElementTree(root)
|
||||
# this makes sure that the XML header states encoding="utf-8"
|
||||
tree.write(stream, encoding="utf-8", xml_declaration=True)
|
||||
tree.write(stream, encoding = "utf-8", xml_declaration=True)
|
||||
|
||||
return stream.getvalue().decode('utf-8')
|
||||
return stream.getvalue().decode("utf-8")
|
||||
|
||||
# Recursively resolve loading inherited files
|
||||
def _resolveInheritance(self, file_name):
|
||||
|
@ -349,7 +349,7 @@ class XmlMaterialProfile(InstanceContainer):
|
|||
def _loadFile(self, file_name):
|
||||
path = Resources.getPath(CuraApplication.getInstance().ResourceTypes.MaterialInstanceContainer, file_name + ".xml.fdm_material")
|
||||
|
||||
with open(path, encoding="utf-8") as f:
|
||||
with open(path, encoding = "utf-8") as f:
|
||||
contents = f.read()
|
||||
|
||||
self._inherited_files.append(path)
|
||||
|
@ -955,7 +955,7 @@ class XmlMaterialProfile(InstanceContainer):
|
|||
def _addSettingElement(self, builder, instance):
|
||||
key = instance.definition.key
|
||||
if key in self.__material_settings_setting_map.values():
|
||||
# Setting has a key in the stabndard namespace
|
||||
# Setting has a key in the standard namespace
|
||||
key = UM.Dictionary.findKey(self.__material_settings_setting_map, instance.definition.key)
|
||||
tag_name = "setting"
|
||||
elif key not in self.__material_properties_setting_map.values() and key not in self.__material_metadata_setting_map.values():
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue