From b1a8b28e87415c4f71d43a7c39dd79d027a252d4 Mon Sep 17 00:00:00 2001 From: Ghostkeeper Date: Mon, 6 Feb 2017 15:44:40 +0100 Subject: [PATCH] Bind default pre-heat temperature to current build plate temperature Currently the setting 'resets' when you go out of the print monitor mode. That wasn't the original intention but it works kind of nicely. We'll bring it up in a meeting whether this needs to be changed. Contributes to issue CURA-3161. --- resources/qml/PrintMonitor.qml | 23 ++++++++++++++--------- 1 file changed, 14 insertions(+), 9 deletions(-) diff --git a/resources/qml/PrintMonitor.qml b/resources/qml/PrintMonitor.qml index b28944f008..49f49502a6 100644 --- a/resources/qml/PrintMonitor.qml +++ b/resources/qml/PrintMonitor.qml @@ -236,12 +236,12 @@ Column anchors.right: parent.right anchors.verticalCenter: parent.verticalCenter - text: "60" //TODO: Bind this to the default. - /*Binding + Binding { target: preheatTemperatureInput property: "text" - value: { + value: + { // Stacklevels // 0: user -> unsaved change // 1: quality changes -> saved change @@ -250,17 +250,20 @@ Column // 4: variant // 5: machine_changes // 6: machine - if ((base.resolve != "None" && base.resolve) && (stackLevel != 0) && (stackLevel != 1)) { + if ((bedTemperature.resolve != "None" && bedTemperature.resolve) && (bedTemperature.stackLevels[0] != 0) && (bedTemperature.stackLevels[0] != 1)) + { // We have a resolve function. Indicates that the setting is not settable per extruder and that // we have to choose between the resolved value (default) and the global value // (if user has explicitly set this). - return base.resolve; - } else { - return propertyProvider.properties.value; + return bedTemperature.resolve; + } + else + { + return bedTemperature.properties.value; } } when: !preheatTemperatureInput.activeFocus - }*/ + } } } } @@ -270,8 +273,10 @@ Column id: bedTemperature containerStackId: Cura.MachineManager.activeMachineId key: "material_bed_temperature" - watchedProperties: ["value", "minimum_value", "maximum_value", "minimum_value_warning", "maximum_value_warning"] + watchedProperties: ["value", "minimum_value", "maximum_value", "minimum_value_warning", "maximum_value_warning", "resolve"] storeIndex: 0 + + property var resolve: Cura.MachineManager.activeStackId != Cura.MachineManager.activeMachineId ? properties.resolve : "None" } Loader