mirror of
https://github.com/Ultimaker/Cura.git
synced 2025-07-16 11:17:49 -06:00
CURA-3507 Make quality lookup more robust
This commit is contained in:
parent
41e3336ea9
commit
55727f20e5
1 changed files with 10 additions and 5 deletions
|
@ -731,8 +731,11 @@ class MachineManager(QObject):
|
||||||
else:
|
else:
|
||||||
self._material_incompatible_message.hide()
|
self._material_incompatible_message.hide()
|
||||||
|
|
||||||
new_quality_id = old_quality.getId()
|
quality_type = None
|
||||||
quality_type = old_quality.getMetaDataEntry("quality_type")
|
new_quality_id = None
|
||||||
|
if old_quality:
|
||||||
|
new_quality_id = old_quality.getId()
|
||||||
|
quality_type = old_quality.getMetaDataEntry("quality_type")
|
||||||
if old_quality_changes:
|
if old_quality_changes:
|
||||||
quality_type = old_quality_changes.getMetaDataEntry("quality_type")
|
quality_type = old_quality_changes.getMetaDataEntry("quality_type")
|
||||||
new_quality_id = old_quality_changes.getId()
|
new_quality_id = old_quality_changes.getId()
|
||||||
|
@ -740,9 +743,11 @@ class MachineManager(QObject):
|
||||||
# See if the requested quality type is available in the new situation.
|
# See if the requested quality type is available in the new situation.
|
||||||
machine_definition = self._active_container_stack.getBottom()
|
machine_definition = self._active_container_stack.getBottom()
|
||||||
quality_manager = QualityManager.getInstance()
|
quality_manager = QualityManager.getInstance()
|
||||||
candidate_quality = quality_manager.findQualityByQualityType(quality_type,
|
candidate_quality = None
|
||||||
quality_manager.getWholeMachineDefinition(machine_definition),
|
if quality_type:
|
||||||
[material_container])
|
candidate_quality = quality_manager.findQualityByQualityType(quality_type,
|
||||||
|
quality_manager.getWholeMachineDefinition(machine_definition),
|
||||||
|
[material_container])
|
||||||
if not candidate_quality or candidate_quality.getId() == "empty_quality":
|
if not candidate_quality or candidate_quality.getId() == "empty_quality":
|
||||||
# Fall back to a quality
|
# Fall back to a quality
|
||||||
new_quality = quality_manager.findQualityByQualityType(None,
|
new_quality = quality_manager.findQualityByQualityType(None,
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue