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
This commit is contained in:
fieldOfView 2016-10-11 16:36:32 +02:00
parent 95fabbaf6d
commit 34630fa646
2 changed files with 16 additions and 1 deletions

View File

@ -492,6 +492,21 @@ class MachineManager(QObject):
return quality.getMetaDataEntry("quality_type") return quality.getMetaDataEntry("quality_type")
return "" 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) @pyqtProperty(str, notify = activeQualityChanged)
def activeQualityChangesId(self): def activeQualityChangesId(self):
if self._global_container_stack: if self._global_container_stack:

View File

@ -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 enabled: !extrudersList.visible || base.currentExtruderIndex > -1