mirror of
https://git.mirrors.martin98.com/https://github.com/Ultimaker/Cura
synced 2025-08-14 01:15:51 +08:00
Prevent machines without an extruder from showing "undefined" in the workspace dialog
This fixes #5572
This commit is contained in:
parent
13c56d40e7
commit
2dd4a30586
@ -153,6 +153,8 @@ UM.Dialog
|
|||||||
{
|
{
|
||||||
height: childrenRect.height
|
height: childrenRect.height
|
||||||
width: parent.width
|
width: parent.width
|
||||||
|
property string variantName: Cura.MachineManager.activeVariantNames[modelData] !== undefined ? Cura.MachineManager.activeVariantNames[modelData]: ""
|
||||||
|
property string materialName: Cura.MachineManager.getExtruder(modelData).material.name !== undefined ? Cura.MachineManager.getExtruder(modelData).material.name : ""
|
||||||
Label
|
Label
|
||||||
{
|
{
|
||||||
text: {
|
text: {
|
||||||
@ -175,14 +177,30 @@ UM.Dialog
|
|||||||
{
|
{
|
||||||
width: parent.width
|
width: parent.width
|
||||||
height: childrenRect.height
|
height: childrenRect.height
|
||||||
|
|
||||||
Label
|
Label
|
||||||
{
|
{
|
||||||
text: catalog.i18nc("@action:label", "%1 & material").arg(Cura.MachineManager.activeDefinitionVariantsName)
|
text:
|
||||||
|
{
|
||||||
|
if(variantName !== "" && materialName !== "")
|
||||||
|
{
|
||||||
|
return catalog.i18nc("@action:label", "%1 & material").arg(Cura.MachineManager.activeDefinitionVariantsName)
|
||||||
|
}
|
||||||
|
return catalog.i18nc("@action:label", "Material")
|
||||||
|
}
|
||||||
width: Math.floor(scroll.width / 3) | 0
|
width: Math.floor(scroll.width / 3) | 0
|
||||||
}
|
}
|
||||||
Label
|
Label
|
||||||
{
|
{
|
||||||
text: Cura.MachineManager.activeVariantNames[modelData] + ", " + Cura.MachineManager.getExtruder(modelData).material.name
|
text:
|
||||||
|
{
|
||||||
|
if(variantName !== "" && materialName !== "")
|
||||||
|
{
|
||||||
|
return variantName + ", " + materialName
|
||||||
|
}
|
||||||
|
return materialName
|
||||||
|
}
|
||||||
|
|
||||||
width: Math.floor(scroll.width / 3) | 0
|
width: Math.floor(scroll.width / 3) | 0
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user