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

This commit is contained in:
Diego Prado Gesto 2018-12-07 13:47:58 +01:00
parent e74258c26b
commit 15f81da95b
2 changed files with 17 additions and 1 deletions

View File

@ -1536,6 +1536,10 @@ class MachineManager(QObject):
name = self._current_quality_group.name name = self._current_quality_group.name
return 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: def _updateUponMaterialMetadataChange(self) -> None:
if self._global_container_stack is None: if self._global_container_stack is None:
return return

View File

@ -13,7 +13,19 @@ RowLayout
Cura.IconWithText Cura.IconWithText
{ {
source: UM.Theme.getIcon("category_layer_height") 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 UM.SettingPropertyProvider
{ {