From b002e367e3fdd35991200270766dbe2804f3f66c Mon Sep 17 00:00:00 2001 From: Ghostkeeper Date: Thu, 16 Feb 2017 12:47:12 +0100 Subject: [PATCH] Only update bed temperature on switching to tab The problem was that the bed temperature for pre-heat was being updated when focus was lost. It now only updates on component being completed. Since print monitor is a component that is switched out with a Loader, it is completed every time the monitor tab is clicked, thus causing this update. It is not pretty to be dependent on this, but it's quite practical considering the alternatives. This causes the pre-heat temperature to not update when you switch machines. Whether this is desirable or not is up for debate. In any case the bed temperature is now always equal for all machines so it doesn't matter anyway. Contributes to issue CURA-3161. --- resources/qml/PrintMonitor.qml | 34 ++++++++++------------------------ 1 file changed, 10 insertions(+), 24 deletions(-) diff --git a/resources/qml/PrintMonitor.qml b/resources/qml/PrintMonitor.qml index 0b9d73081b..773410e967 100644 --- a/resources/qml/PrintMonitor.qml +++ b/resources/qml/PrintMonitor.qml @@ -232,33 +232,19 @@ Column anchors.right: parent.right anchors.verticalCenter: parent.verticalCenter - Binding + Component.onCompleted: { - target: preheatTemperatureInput - property: "text" - value: + if ((bedTemperature.resolve != "None" && bedTemperature.resolve) && (bedTemperature.stackLevels[0] != 0) && (bedTemperature.stackLevels[0] != 1)) { - // Stacklevels - // 0: user -> unsaved change - // 1: quality changes -> saved change - // 2: quality - // 3: material -> user changed material in materialspage - // 4: variant - // 5: machine_changes - // 6: machine - 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 bedTemperature.resolve; - } - else - { - return bedTemperature.properties.value; - } + // 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). + text = bedTemperature.resolve; + } + else + { + text = bedTemperature.properties.value; } - when: !preheatTemperatureInput.activeFocus } } }