Browse Source

Do not show the layer height in the header panel when the profile is not supported

Diego Prado Gesto 6 years ago
parent
commit
15f81da95b

+ 4 - 0
cura/Settings/MachineManager.py

@@ -1536,6 +1536,10 @@ class MachineManager(QObject):
             name = self._current_quality_group.name
         return name
 
+    @pyqtProperty(bool, notify = activeQualityGroupChanged)
+    def hasNotSupportedQuality(self) -> bool:
+        return self._current_quality_group is None and self._current_quality_changes_group is None
+
     def _updateUponMaterialMetadataChange(self) -> None:
         if self._global_container_stack is None:
             return

+ 13 - 1
resources/qml/PrintSetupSelector/PrintSetupSelectorHeader.qml

@@ -13,7 +13,19 @@ RowLayout
     Cura.IconWithText
     {
         source: UM.Theme.getIcon("category_layer_height")
-        text: Cura.MachineManager.activeStack ? Cura.MachineManager.activeQualityOrQualityChangesName + " " + layerHeight.properties.value + "mm" : ""
+        text:
+        {
+            if (Cura.MachineManager.activeStack)
+            {
+                var text = Cura.MachineManager.activeQualityOrQualityChangesName
+                if (!Cura.MachineManager.hasNotSupportedQuality)
+                {
+                    text += " " + layerHeight.properties.value + "mm"
+                }
+                return text
+            }
+            return ""
+        }
 
         UM.SettingPropertyProvider
         {