From f6ece126c31f62e0984f6a5b31f35e827c3f2dc8 Mon Sep 17 00:00:00 2001 From: Ghostkeeper Date: Wed, 8 Jun 2016 12:22:45 +0200 Subject: [PATCH] Don't re-create user profile if one is loaded from files The user profiles are also saved because they are added to the container registry. So if one exists for this extruder, don't create a new blank name, but use the pre-loaded one which contained the user settings the user had before he closed down Cura previously. Contributes to issues CURA-340 and CURA-1278. --- cura/ExtruderManager.py | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/cura/ExtruderManager.py b/cura/ExtruderManager.py index 8219066eca..a5960be552 100644 --- a/cura/ExtruderManager.py +++ b/cura/ExtruderManager.py @@ -147,12 +147,15 @@ class ExtruderManager(QObject): self._container_stack.addContainer(self._quality) """ - #Add an empty user profile. - user_profile = UM.Settings.InstanceContainer(extruder_train_id + "_current_settings") - user_profile.addMetaDataEntry("type", "user") - user_profile.setDefinition(machine_definition) + user_profile = container_registry.findInstanceContainers(id = extruder_train_id + "_current_settings") + if user_profile: #There was already a user profile, loaded from settings. + user_profile = user_profile[0] + else: + user_profile = UM.Settings.InstanceContainer(extruder_train_id + "_current_settings") #Add an empty user profile. + user_profile.addMetaDataEntry("type", "user") + user_profile.setDefinition(machine_definition) + container_registry.addContainer(user_profile) container_stack.addContainer(user_profile) - container_registry.addContainer(user_profile) container_stack.setNextStack(UM.Application.getInstance().getGlobalContainerStack())