From 34630fa646f13f683b4778fbbe1a2be688e1fadf Mon Sep 17 00:00:00 2001 From: fieldOfView Date: Tue, 11 Oct 2016 16:36:32 +0200 Subject: [PATCH] Also show the "unsupported" warning when a custom profile is selected ...by making sure we're looking at the quality container (not quality_changes) of the active extruder/stack CURA-2271 --- cura/Settings/MachineManager.py | 15 +++++++++++++++ resources/qml/SidebarHeader.qml | 2 +- 2 files changed, 16 insertions(+), 1 deletion(-) diff --git a/cura/Settings/MachineManager.py b/cura/Settings/MachineManager.py index 7508fc6952..6c038a2ee7 100644 --- a/cura/Settings/MachineManager.py +++ b/cura/Settings/MachineManager.py @@ -492,6 +492,21 @@ class MachineManager(QObject): return quality.getMetaDataEntry("quality_type") return "" + ## Get the Quality ID associated with the currently active extruder + # Note that this only returns the "quality", not the "quality_changes" + # \returns QualityID (string) if found, empty string otherwise + # \sa activeQualityId() + # \todo Ideally, this method would be named activeQualityId(), and the other one + # would be named something like activeQualityOrQualityChanges() for consistency + @pyqtProperty(str, notify = activeQualityChanged) + def activeQualityContainerId(self): + # We're using the active stack instead of the global stack in case the list of qualities differs per extruder + if self._active_container_stack: + quality = self._active_container_stack.findContainer(type = "quality") + if quality: + return quality.getId() + return "" + @pyqtProperty(str, notify = activeQualityChanged) def activeQualityChangesId(self): if self._global_container_stack: diff --git a/resources/qml/SidebarHeader.qml b/resources/qml/SidebarHeader.qml index 3e36cfbaa0..e8f4aa8e47 100644 --- a/resources/qml/SidebarHeader.qml +++ b/resources/qml/SidebarHeader.qml @@ -244,7 +244,7 @@ Column } } - property var valueWarning: Cura.MachineManager.activeQualityId == "empty_quality" + property var valueWarning: Cura.MachineManager.activeQualityContainerId == "empty_quality" enabled: !extrudersList.visible || base.currentExtruderIndex > -1