mirror of
https://git.mirrors.martin98.com/https://github.com/Ultimaker/Cura
synced 2025-08-20 19:29:09 +08:00
Prevent qml warning when no printer is connected
This commit is contained in:
parent
b914aefac6
commit
0af26cc4a7
@ -20,8 +20,12 @@ Menu
|
||||
id: automaticMaterial
|
||||
text:
|
||||
{
|
||||
var materialName = Cura.MachineManager.printerOutputDevices[0].materialNames[extruderIndex];
|
||||
return catalog.i18nc("@title:menuitem %1 is the value from the printer", "Automatic: %1").arg(materialName);
|
||||
if(printerConnected && Cura.MachineManager.printerOutputDevices[0].materialNames.length > extruderIndex)
|
||||
{
|
||||
var materialName = Cura.MachineManager.printerOutputDevices[0].materialNames[extruderIndex];
|
||||
return catalog.i18nc("@title:menuitem %1 is the value from the printer", "Automatic: %1").arg(materialName);
|
||||
}
|
||||
return "";
|
||||
}
|
||||
visible: printerConnected && Cura.MachineManager.printerOutputDevices[0].materialNames.length > extruderIndex
|
||||
onTriggered:
|
||||
|
@ -20,8 +20,12 @@ Menu
|
||||
id: automaticNozzle
|
||||
text:
|
||||
{
|
||||
var nozzleName = Cura.MachineManager.printerOutputDevices[0].hotendIds[extruderIndex];
|
||||
return catalog.i18nc("@title:menuitem %1 is the value from the printer", "Automatic: %1").arg(nozzleName);
|
||||
if(printerConnected && Cura.MachineManager.printerOutputDevices[0].hotendIds.length > extruderIndex)
|
||||
{
|
||||
var nozzleName = Cura.MachineManager.printerOutputDevices[0].hotendIds[extruderIndex];
|
||||
return catalog.i18nc("@title:menuitem %1 is the value from the printer", "Automatic: %1").arg(nozzleName);
|
||||
}
|
||||
return "";
|
||||
}
|
||||
visible: printerConnected && Cura.MachineManager.printerOutputDevices[0].hotendIds.length > extruderIndex
|
||||
onTriggered:
|
||||
|
Loading…
x
Reference in New Issue
Block a user