Merge branch '3.3' of github.com:Ultimaker/Cura into 3.3

This commit is contained in:
Diego Prado Gesto 2018-04-12 14:59:38 +02:00
commit e2d6e18ac9
2 changed files with 15 additions and 6 deletions

View File

@ -926,6 +926,8 @@ class MachineManager(QObject):
ExtruderManager.getInstance().extrudersChanged.emit(self._global_container_stack.getId()) ExtruderManager.getInstance().extrudersChanged.emit(self._global_container_stack.getId())
# Make sure the front end reflects changes # Make sure the front end reflects changes
self.forceUpdateAllSettings() self.forceUpdateAllSettings()
# Also trigger the build plate compatibility to update
self.activeMaterialChanged.emit()
def _onMachineNameChanged(self): def _onMachineNameChanged(self):
self.globalContainerChanged.emit() self.globalContainerChanged.emit()
@ -1016,15 +1018,23 @@ class MachineManager(QObject):
self.activeQualityGroupChanged.emit() self.activeQualityGroupChanged.emit()
self.activeQualityChangesGroupChanged.emit() self.activeQualityChangesGroupChanged.emit()
def _fixQualityChangesGroupToNotSupported(self, quality_changes_group):
nodes = [quality_changes_group.node_for_global] + list(quality_changes_group.nodes_for_extruders.values())
containers = [n.getContainer() for n in nodes if n is not None]
for container in containers:
container.setMetaDataEntry("quality_type", "not_supported")
quality_changes_group.quality_type = "not_supported"
def _setQualityChangesGroup(self, quality_changes_group): def _setQualityChangesGroup(self, quality_changes_group):
quality_type = quality_changes_group.quality_type quality_type = quality_changes_group.quality_type
# A custom quality can be created based on "not supported". # A custom quality can be created based on "not supported".
# In that case, do not set quality containers to empty. # In that case, do not set quality containers to empty.
if quality_type == "not_supported": quality_group = None
quality_group = None if quality_type != "not_supported":
else:
quality_group_dict = self._quality_manager.getQualityGroups(self._global_container_stack) quality_group_dict = self._quality_manager.getQualityGroups(self._global_container_stack)
quality_group = quality_group_dict[quality_type] quality_group = quality_group_dict.get(quality_type)
if quality_group is None:
self._fixQualityChangesGroupToNotSupported(quality_changes_group)
quality_changes_container = self._empty_quality_changes_container quality_changes_container = self._empty_quality_changes_container
if quality_changes_group.node_for_global: if quality_changes_group.node_for_global:

View File

@ -51,8 +51,7 @@ Menu
MenuItem MenuItem
{ {
text: model.name text: model.name
checkable: model.available checkable: true
enabled: model.available
checked: Cura.MachineManager.activeQualityOrQualityChangesName == model.name checked: Cura.MachineManager.activeQualityOrQualityChangesName == model.name
exclusiveGroup: group exclusiveGroup: group
onTriggered: Cura.MachineManager.setQualityChangesGroup(model.quality_changes_group) onTriggered: Cura.MachineManager.setQualityChangesGroup(model.quality_changes_group)