mirror of
https://git.mirrors.martin98.com/https://github.com/Ultimaker/Cura
synced 2025-05-25 07:39:25 +08:00
Add supress signals when renaming profiles
This fixes the situation where sometimes a signal was emitted while we were still in the process of changing things CURA-6842
This commit is contained in:
parent
485b94fe06
commit
eb963d7cbf
@ -127,13 +127,12 @@ class QualityManagementModel(ListModel):
|
|||||||
# have no container for the global stack, because "my_profile" just got renamed to "my_new_profile". This results
|
# have no container for the global stack, because "my_profile" just got renamed to "my_new_profile". This results
|
||||||
# in crashes because the rest of the system assumes that all data in a QualityChangesGroup will be correct.
|
# in crashes because the rest of the system assumes that all data in a QualityChangesGroup will be correct.
|
||||||
#
|
#
|
||||||
# Renaming the container for the global stack in the end seems to be ok, because the assumption is mostly based
|
# This is why we use the "supress_signals" flag for the set name. This basically makes the change silent.
|
||||||
# on the quality changes container for the global stack.
|
|
||||||
for metadata in quality_changes_group.metadata_per_extruder.values():
|
for metadata in quality_changes_group.metadata_per_extruder.values():
|
||||||
extruder_container = cast(InstanceContainer, container_registry.findContainers(id = metadata["id"])[0])
|
extruder_container = cast(InstanceContainer, container_registry.findContainers(id = metadata["id"])[0])
|
||||||
extruder_container.setName(new_name)
|
extruder_container.setName(new_name, supress_signals=True)
|
||||||
global_container = cast(InstanceContainer, container_registry.findContainers(id = quality_changes_group.metadata_for_global["id"])[0])
|
global_container = cast(InstanceContainer, container_registry.findContainers(id = quality_changes_group.metadata_for_global["id"])[0])
|
||||||
global_container.setName(new_name)
|
global_container.setName(new_name, supress_signals=True)
|
||||||
|
|
||||||
quality_changes_group.name = new_name
|
quality_changes_group.name = new_name
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user