Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/Ultimaker/Cura.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJaime van Kessel <nallath@gmail.com>2020-08-06 17:59:30 +0300
committerJaime van Kessel <nallath@gmail.com>2020-08-06 17:59:30 +0300
commiteb17e146bc88a4b314bb59ee44d64c47ed08580b (patch)
tree4576b14adda01d41c3afe0f3103dcadcaaf156a5
parentc9239ed32ec5ba42f0d30e1c350dc053b74882f7 (diff)
Fix some quality_changes being incorrectly shown for some configurations
CURA-7589
-rw-r--r--cura/Machines/MachineNode.py16
-rw-r--r--cura/Machines/Models/QualityManagementModel.py3
2 files changed, 16 insertions, 3 deletions
diff --git a/cura/Machines/MachineNode.py b/cura/Machines/MachineNode.py
index d487ea57f2..d4706ae5ef 100644
--- a/cura/Machines/MachineNode.py
+++ b/cura/Machines/MachineNode.py
@@ -135,9 +135,7 @@ class MachineNode(ContainerNode):
groups_by_name[name] = QualityChangesGroup(name, quality_type = quality_changes["quality_type"],
intent_category = quality_changes.get("intent_category", "default"),
parent = CuraApplication.getInstance())
- # CURA-6882
- # Custom qualities are always available, even if they are based on the "not supported" profile.
- groups_by_name[name].is_available = True
+
elif groups_by_name[name].intent_category == "default": # Intent category should be stored as "default" if everything is default or as the intent if any of the extruder have an actual intent.
groups_by_name[name].intent_category = quality_changes.get("intent_category", "default")
@@ -146,6 +144,18 @@ class MachineNode(ContainerNode):
else: # Global profile.
groups_by_name[name].metadata_for_global = quality_changes
+ quality_groups = self.getQualityGroups(variant_names, material_bases, extruder_enabled)
+ for quality_changes_group in groups_by_name.values():
+ if quality_changes_group.quality_type not in quality_groups:
+ if quality_changes_group.quality_type == "not_supported":
+ # Quality changes based on an empty profile are always available.
+ quality_changes_group.is_available = True
+ else:
+ quality_changes_group.is_available = False
+ else:
+ # Quality changes group is available iff the quality group it depends on is available. Irrespective of whether the intent category is available.
+ quality_changes_group.is_available = quality_groups[quality_changes_group.quality_type].is_available
+
return list(groups_by_name.values())
def preferredGlobalQuality(self) -> "QualityNode":
diff --git a/cura/Machines/Models/QualityManagementModel.py b/cura/Machines/Models/QualityManagementModel.py
index 3fbd935916..099d71ab03 100644
--- a/cura/Machines/Models/QualityManagementModel.py
+++ b/cura/Machines/Models/QualityManagementModel.py
@@ -365,6 +365,9 @@ class QualityManagementModel(ListModel):
# CURA-6913 Note that custom qualities can be based on "not supported", so the quality group can be None.
quality_group = quality_group_dict.get(quality_changes_group.quality_type)
quality_type = quality_changes_group.quality_type
+
+ if not quality_changes_group.is_available:
+ continue
item = {"name": quality_changes_group.name,
"is_read_only": False,
"quality_group": quality_group,