From fea0dfdfa1b3e4b989d9295d49edd07b65949787 Mon Sep 17 00:00:00 2001 From: fieldOfView Date: Mon, 10 Oct 2016 13:12:56 +0200 Subject: [PATCH 1/3] Put material selection in warning state for unsupported materials CURA-2271 --- resources/qml/SidebarHeader.qml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/resources/qml/SidebarHeader.qml b/resources/qml/SidebarHeader.qml index 9ed30477d8..3e36cfbaa0 100644 --- a/resources/qml/SidebarHeader.qml +++ b/resources/qml/SidebarHeader.qml @@ -244,6 +244,8 @@ Column } } + property var valueWarning: Cura.MachineManager.activeQualityId == "empty_quality" + enabled: !extrudersList.visible || base.currentExtruderIndex > -1 height: UM.Theme.getSize("setting_control").height From 68662561e8faae7b45e980e6db5850aae2a13976 Mon Sep 17 00:00:00 2001 From: Arjen Hiemstra Date: Mon, 10 Oct 2016 13:23:07 +0200 Subject: [PATCH 2/3] Return empty quality instead of None in QualityManager::findQualityByQualityType Contributes to CURA-2271 --- cura/QualityManager.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/cura/QualityManager.py b/cura/QualityManager.py index adf2f0423b..6deea4053e 100644 --- a/cura/QualityManager.py +++ b/cura/QualityManager.py @@ -20,6 +20,9 @@ class QualityManager: __instance = None + def __init__(self): + self._empty_quality_container = UM.Settings.ContainerRegistry.getInstance().findInstanceContainers(id = "empty_quality")[0] + ## Find a quality by name for a specific machine definition and materials. # # \param quality_name @@ -92,7 +95,8 @@ class QualityManager: if not result and material_containers and len(material_containers) == 1: basic_materials = self._getBasicMaterials(material_containers[0]) result = self._getFilteredContainersForStack(machine_definition, basic_materials, **criteria) - return result[0] if result else None + + return result[0] if result else self._empty_quality_container ## Find all suitable qualities for a combination of machine and material. # From c6afb14a091e891b60cfb2e56bf53c19bd4c4bf9 Mon Sep 17 00:00:00 2001 From: Arjen Hiemstra Date: Mon, 10 Oct 2016 13:34:45 +0200 Subject: [PATCH 3/3] Return the empty container if there are no results when listing qualities Contributes to CURA-2271 --- cura/QualityManager.py | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/cura/QualityManager.py b/cura/QualityManager.py index 6deea4053e..a304eb1db3 100644 --- a/cura/QualityManager.py +++ b/cura/QualityManager.py @@ -109,6 +109,10 @@ class QualityManager: if not result: basic_materials = self._getBasicMaterials(material_container) result = self._getFilteredContainersForStack(machine_definition, basic_materials, **criteria) + + if not result: + result = [ self._empty_quality_container ] + return result ## Find all quality changes for a machine.