mirror of
https://git.mirrors.martin98.com/https://github.com/Ultimaker/Cura
synced 2025-08-12 11:49:01 +08:00
Merge remote-tracking branch 'origin/4.4'
This commit is contained in:
commit
d13683f4db
@ -2,6 +2,7 @@ import collections
|
|||||||
from typing import Dict, Optional
|
from typing import Dict, Optional
|
||||||
|
|
||||||
from UM.i18n import i18nCatalog
|
from UM.i18n import i18nCatalog
|
||||||
|
from typing import Dict, Optional
|
||||||
catalog = i18nCatalog("cura")
|
catalog = i18nCatalog("cura")
|
||||||
|
|
||||||
|
|
||||||
|
@ -339,11 +339,11 @@ class ContainerManager(QObject):
|
|||||||
# \return A list of names of materials with the same GUID.
|
# \return A list of names of materials with the same GUID.
|
||||||
@pyqtSlot("QVariant", bool, result = "QStringList")
|
@pyqtSlot("QVariant", bool, result = "QStringList")
|
||||||
def getLinkedMaterials(self, material_node: "MaterialNode", exclude_self: bool = False) -> List[str]:
|
def getLinkedMaterials(self, material_node: "MaterialNode", exclude_self: bool = False) -> List[str]:
|
||||||
same_guid = ContainerRegistry.getInstance().findInstanceContainersMetadata(guid = material_node.guid)
|
same_guid = ContainerRegistry.getInstance().findInstanceContainersMetadata(GUID = material_node.guid)
|
||||||
if exclude_self:
|
if exclude_self:
|
||||||
return [metadata["name"] for metadata in same_guid if metadata["base_file"] != material_node.base_file]
|
return list({meta["name"] for meta in same_guid if meta["base_file"] != material_node.base_file})
|
||||||
else:
|
else:
|
||||||
return [metadata["name"] for metadata in same_guid]
|
return list({meta["name"] for meta in same_guid})
|
||||||
|
|
||||||
## Unlink a material from all other materials by creating a new GUID
|
## Unlink a material from all other materials by creating a new GUID
|
||||||
# \param material_id \type{str} the id of the material to create a new GUID for.
|
# \param material_id \type{str} the id of the material to create a new GUID for.
|
||||||
|
@ -46,7 +46,7 @@ TabView
|
|||||||
{
|
{
|
||||||
return ""
|
return ""
|
||||||
}
|
}
|
||||||
return linkedMaterials.join(", ");
|
return linkedMaterials;
|
||||||
}
|
}
|
||||||
|
|
||||||
function getApproximateDiameter(diameter)
|
function getApproximateDiameter(diameter)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user