Fix some QML warnings on closing Cura

CURA-8683
This commit is contained in:
Jaime van Kessel 2022-01-11 11:52:43 +01:00
parent 3d0e71fe7e
commit 6644bff2be
2 changed files with 10 additions and 10 deletions

View File

@ -18,7 +18,7 @@ Cura.ExpandablePopup
id: base
property var extrudersModel: CuraApplication.getExtrudersModel()
property var activeMachine: Cura.MachineManager.activeMachine
UM.I18nCatalog
{
id: catalog
@ -32,7 +32,7 @@ Cura.ExpandablePopup
}
contentPadding: UM.Theme.getSize("default_lining").width
enabled: Cura.MachineManager.activeMachine ? Cura.MachineManager.activeMachine.hasMaterials || Cura.MachineManager.activeMachine.hasVariants || Cura.MachineManager.activeMachine.hasVariantBuildplates : false; //Only let it drop down if there is any configuration that you could change.
enabled: activeMachine ? activeMachine.hasMaterials || activeMachine.hasVariants || activeMachine.hasVariantBuildplates : false; //Only let it drop down if there is any configuration that you could change.
headerItem: Item
{
@ -43,7 +43,7 @@ Cura.ExpandablePopup
anchors.bottom: parent.bottom
anchors.left: parent.left
width: parent.width - UM.Theme.getSize("standard_arrow").width
visible: Cura.MachineManager.activeMachine ? Cura.MachineManager.activeMachine.hasMaterials : false
visible: activeMachine ? activeMachine.hasMaterials : false
Repeater
{
model: extrudersModel
@ -55,9 +55,9 @@ Cura.ExpandablePopup
Layout.maximumWidth: Math.round(parent.width / extrudersModel.count)
Layout.fillHeight: true
property var extruderStack: Cura.MachineManager.activeMachine.extruders[model.index]
property var extruderStack: activeMachine ? activeMachine.extruders[model.index]: null
property bool valueWarning: !Cura.ExtruderManager.getExtruderHasQualityForMaterial(extruderStack)
property bool valueError: Cura.ContainerManager.getContainerMetaDataEntry(extruderStack.material.id, "compatible", "") != "True"
property bool valueError: activeMachine ? Cura.ContainerManager.getContainerMetaDataEntry(extruderStack.material.id, "compatible", "") != "True" : false
// Extruder icon. Shows extruder index and has the same color as the active material.
Cura.ExtruderIcon
@ -223,7 +223,7 @@ Cura.ExpandablePopup
{
id: variantLabel
visible: Cura.MachineManager.activeMachine ? Cura.MachineManager.activeMachine.hasVariants : false
visible: activeMachine ? activeMachine.hasVariants : false
text: model.variant
elide: Text.ElideRight
@ -242,7 +242,7 @@ Cura.ExpandablePopup
elide: Text.ElideRight
font: UM.Theme.getFont("medium")
visible: Cura.MachineManager.activeMachine ? !Cura.MachineManager.activeMachine.hasMaterials && (Cura.MachineManager.activeMachine.hasVariants || Cura.MachineManager.activeMachine.hasVariantBuildplates) : false
visible: activeMachine ? !activeMachine.hasMaterials && (activeMachine.hasVariants || activeMachine.hasVariantBuildplates) : false
anchors
{
@ -267,7 +267,7 @@ Cura.ExpandablePopup
onVisibleChanged:
{
is_connected = Cura.MachineManager.activeMachine.hasRemoteConnection && Cura.MachineManager.printerConnected && Cura.MachineManager.printerOutputDevices[0].uniqueConfigurations.length > 0 //Re-evaluate.
is_connected = activeMachine.hasRemoteConnection && Cura.MachineManager.printerConnected && Cura.MachineManager.printerOutputDevices[0].uniqueConfigurations.length > 0 //Re-evaluate.
// If the printer is not connected or does not have configurations, we switch always to the custom mode. If is connected instead, the auto mode
// or the previous state is selected

View File

@ -34,7 +34,7 @@ UM.Menu
{
return false
}
var extruder = Cura.MachineManager.activeMachine.extruderList[extruderIndex]
var extruder = activeMachine.extruderList[extruderIndex]
return (extruder === undefined) ? false : (extruder.variant.name == model.hotend_name)
}
enabled:
@ -43,7 +43,7 @@ UM.Menu
{
return false
}
var extruder = Cura.MachineManager.activeMachine.extruderList[extruderIndex]
var extruder = activeMachine.extruderList[extruderIndex]
return (extruder === undefined) ? false : extruder.isEnabled
}
onTriggered:Cura.MachineManager.setVariant(nozzleMenu.extruderIndex, model.container_node)