mirror of
https://github.com/Ultimaker/Cura.git
synced 2025-08-05 13:03:59 -06: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
1 changed files with 21 additions and 3 deletions
|
@ -153,7 +153,9 @@ UM.Dialog
|
|||
{
|
||||
height: childrenRect.height
|
||||
width: parent.width
|
||||
Label
|
||||
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
|
||||
{
|
||||
text: {
|
||||
var extruder = Number(modelData)
|
||||
|
@ -175,14 +177,30 @@ UM.Dialog
|
|||
{
|
||||
width: parent.width
|
||||
height: childrenRect.height
|
||||
|
||||
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
|
||||
}
|
||||
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
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue