diff --git a/plugins/SliceInfoPlugin/MoreInfoWindow.qml b/plugins/SliceInfoPlugin/MoreInfoWindow.qml index 50276ec25c..247df4b025 100644 --- a/plugins/SliceInfoPlugin/MoreInfoWindow.qml +++ b/plugins/SliceInfoPlugin/MoreInfoWindow.qml @@ -88,7 +88,7 @@ Window right: parent.right } - textArea.text: manager.getExampleData() + textArea.text: (manager === null) ? "" : manager.getExampleData() textArea.textFormat: Text.RichText textArea.wrapMode: Text.Wrap textArea.readOnly: true diff --git a/resources/qml/JobSpecs.qml b/resources/qml/JobSpecs.qml index e48d3facda..097100e217 100644 --- a/resources/qml/JobSpecs.qml +++ b/resources/qml/JobSpecs.qml @@ -14,7 +14,7 @@ Item id: base property bool activity: CuraApplication.platformActivity - property string fileBaseName: PrintInformation.baseName + property string fileBaseName: (PrintInformation === null) ? "" : PrintInformation.baseName UM.I18nCatalog { @@ -80,7 +80,7 @@ Item height: UM.Theme.getSize("jobspecs_line").height width: Math.max(__contentWidth + UM.Theme.getSize("default_margin").width, 50) maximumLength: 120 - text: PrintInformation.jobName + text: (PrintInformation === null) ? "" : PrintInformation.jobName horizontalAlignment: TextInput.AlignLeft property string textBeforeEdit: "" diff --git a/resources/qml/Menus/MaterialMenu.qml b/resources/qml/Menus/MaterialMenu.qml index 73c1baf2c0..c101f56da5 100644 --- a/resources/qml/Menus/MaterialMenu.qml +++ b/resources/qml/Menus/MaterialMenu.qml @@ -13,11 +13,19 @@ Menu title: catalog.i18nc("@label:category menu label", "Material") property int extruderIndex: 0 - property string currentRootMaterialId: Cura.MachineManager.currentRootMaterialId[extruderIndex] - property var activeExtruder: Cura.MachineManager.activeMachine.extruderList[extruderIndex] - property bool isActiveExtruderEnabled: activeExtruder === undefined ? false : activeExtruder.isEnabled + property string currentRootMaterialId: + { + var value = Cura.MachineManager.currentRootMaterialId[extruderIndex] + return (value === undefined) ? "" : value + } + property var activeExtruder: + { + var activeMachine = Cura.MachineManager.activeMachine + return (activeMachine === null) ? null : activeMachine.extruderList[extruderIndex] + } + property bool isActiveExtruderEnabled: activeExtruder === null ? false : activeExtruder.isEnabled - property string activeMaterialId: activeExtruder === undefined ? false : activeExtruder.material.id + property string activeMaterialId: activeExtruder === null ? false : activeExtruder.material.id property bool updateModels: true Cura.FavoriteMaterialsModel diff --git a/resources/qml/Menus/NozzleMenu.qml b/resources/qml/Menus/NozzleMenu.qml index 2734e40489..3ec48ab302 100644 --- a/resources/qml/Menus/NozzleMenu.qml +++ b/resources/qml/Menus/NozzleMenu.qml @@ -28,12 +28,22 @@ Menu text: model.hotend_name checkable: true checked: { + var activeMachine = Cura.MachineManager.activeMachine + if (activeMachine === null) + { + return false + } var extruder = Cura.MachineManager.activeMachine.extruderList[extruderIndex] return (extruder === undefined) ? false : (extruder.variant.name == model.hotend_name) } exclusiveGroup: group enabled: { + var activeMachine = Cura.MachineManager.activeMachine + if (activeMachine === null) + { + return false + } var extruder = Cura.MachineManager.activeMachine.extruderList[extruderIndex] return (extruder === undefined) ? false : extruder.isEnabled } diff --git a/resources/qml/Menus/SettingsMenu.qml b/resources/qml/Menus/SettingsMenu.qml index 0afbccd5ca..4e62c4d4e0 100644 --- a/resources/qml/Menus/SettingsMenu.qml +++ b/resources/qml/Menus/SettingsMenu.qml @@ -22,7 +22,7 @@ Menu Menu { title: modelData.name - property var extruder: Cura.MachineManager.activeMachine.extruderList[model.index] + property var extruder: (base.activeMachine === null) ? null : activeMachine.extruderList[model.index] NozzleMenu { title: Cura.MachineManager.activeDefinitionVariantsName; visible: Cura.MachineManager.activeMachine.hasVariants; extruderIndex: index } MaterialMenu { title: catalog.i18nc("@title:menu", "&Material"); visible: Cura.MachineManager.activeMachine.hasMaterials; extruderIndex: index }