mirror of
https://github.com/Ultimaker/Cura.git
synced 2025-07-18 20:28:01 -06:00
Fix qml error when there is no connected printer
Also fixes code style
This commit is contained in:
parent
9ad0fd2b83
commit
ff847aa329
3 changed files with 33 additions and 15 deletions
|
@ -119,11 +119,17 @@ Item
|
||||||
onClicked: manager.loadConfigurationFromPrinter()
|
onClicked: manager.loadConfigurationFromPrinter()
|
||||||
|
|
||||||
function isClusterPrinter() {
|
function isClusterPrinter() {
|
||||||
var clusterSize = Cura.MachineManager.printerOutputDevices[0].clusterSize
|
if(Cura.MachineManager.printerOutputDevices.length == 0)
|
||||||
// This is a non cluster printer or the cluster it is just one printer
|
{
|
||||||
if (typeof clusterSize == "undefined" || clusterSize == 1)
|
return false;
|
||||||
return false
|
}
|
||||||
return true
|
var clusterSize = Cura.MachineManager.printerOutputDevices[0].clusterSize;
|
||||||
|
// This is not a cluster printer or the cluster it is just one printer
|
||||||
|
if(clusterSize == undefined || clusterSize == 1)
|
||||||
|
{
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
return true;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -16,11 +16,17 @@ Menu
|
||||||
property bool printerConnected: Cura.MachineManager.printerOutputDevices.length != 0
|
property bool printerConnected: Cura.MachineManager.printerOutputDevices.length != 0
|
||||||
property bool isClusterPrinter:
|
property bool isClusterPrinter:
|
||||||
{
|
{
|
||||||
var clusterSize = Cura.MachineManager.printerOutputDevices[0].clusterSize
|
if(Cura.MachineManager.printerOutputDevices.length == 0)
|
||||||
// This is a non cluster printer or the cluster it is just one printer
|
{
|
||||||
if (typeof clusterSize == "undefined" || clusterSize == 1)
|
return false;
|
||||||
return false
|
}
|
||||||
return true
|
var clusterSize = Cura.MachineManager.printerOutputDevices[0].clusterSize;
|
||||||
|
// This is not a cluster printer or the cluster it is just one printer
|
||||||
|
if(clusterSize == undefined || clusterSize == 1)
|
||||||
|
{
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
UM.SettingPropertyProvider
|
UM.SettingPropertyProvider
|
||||||
|
|
|
@ -16,11 +16,17 @@ Menu
|
||||||
property bool printerConnected: Cura.MachineManager.printerOutputDevices.length != 0
|
property bool printerConnected: Cura.MachineManager.printerOutputDevices.length != 0
|
||||||
property bool isClusterPrinter:
|
property bool isClusterPrinter:
|
||||||
{
|
{
|
||||||
var clusterSize = Cura.MachineManager.printerOutputDevices[0].clusterSize
|
if(Cura.MachineManager.printerOutputDevices.length == 0)
|
||||||
// This is a non cluster printer or the cluster it is just one printer
|
{
|
||||||
if (typeof clusterSize == "undefined" || clusterSize == 1)
|
return false;
|
||||||
return false
|
}
|
||||||
return true
|
var clusterSize = Cura.MachineManager.printerOutputDevices[0].clusterSize;
|
||||||
|
// This is not a cluster printer or the cluster it is just one printer
|
||||||
|
if(clusterSize == undefined || clusterSize == 1)
|
||||||
|
{
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
MenuItem
|
MenuItem
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue