Remove usages of deprecated activeMachineName

This commit is contained in:
Jaime van Kessel 2019-05-03 13:38:06 +02:00
parent 5a25f8e050
commit c3a373e2a2
3 changed files with 19 additions and 4 deletions

View file

@ -123,7 +123,18 @@ UM.Dialog
} }
Label Label
{ {
text: Cura.MachineManager.activeMachineNetworkGroupName != "" ? Cura.MachineManager.activeMachineNetworkGroupName : Cura.MachineManager.activeMachineName text:
{
if(Cura.MachineManager.activeMachineNetworkGroupName != "")
{
return Cura.MachineManager.activeMachineNetworkGroupName
}
if(Cura.MachineManager.activeMachine)
{
return Cura.MachineManager.activeMachine.name
}
return ""
}
width: Math.floor(scroll.width / 3) | 0 width: Math.floor(scroll.width / 3) | 0
} }
} }

View file

@ -200,13 +200,13 @@ Item
visible: text != "" visible: text != ""
text: text:
{ {
var caption = catalog.i18nc("@action:label", "Printer") + ": " + Cura.MachineManager.activeMachineName; var caption = catalog.i18nc("@action:label", "Printer") + ": " + Cura.MachineManager.activeMachine.name;
if (Cura.MachineManager.hasVariants) if (Cura.MachineManager.hasVariants)
{ {
var activeVariantName = "" var activeVariantName = ""
if(Cura.MachineManager.activeStack != null) if(Cura.MachineManager.activeStack != null)
{ {
activeVariantName = Cura.MachineManager.activeStack.variant.name activeVariantName = Cura.MachineManager.activeStack.variant.name
} }
caption += ", " + Cura.MachineManager.activeDefinitionVariantsName + ": " + activeVariantName; caption += ", " + Cura.MachineManager.activeDefinitionVariantsName + ": " + activeVariantName;
} }

View file

@ -32,7 +32,11 @@ Cura.ExpandablePopup
{ {
return Cura.MachineManager.activeMachineNetworkGroupName return Cura.MachineManager.activeMachineNetworkGroupName
} }
return Cura.MachineManager.activeMachineName if(Cura.MachineManager.activeStack != null)
{
return Cura.MachineManager.activeStack.name
}
return ""
} }
source: source:
{ {