From 9c5e169f2bca0b0101ce8e8d78ff9ddb821c4d67 Mon Sep 17 00:00:00 2001 From: Jaime van Kessel Date: Tue, 1 Mar 2016 16:24:43 +0100 Subject: [PATCH] Loaded profiles are now marked as dirty so they are saved correctly CURA-936 --- plugins/GCodeProfileReader/GCodeProfileReader.py | 5 ++++- plugins/LegacyProfileReader/LegacyProfileReader.py | 2 +- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/plugins/GCodeProfileReader/GCodeProfileReader.py b/plugins/GCodeProfileReader/GCodeProfileReader.py index b90c01ddf4..140547a05c 100644 --- a/plugins/GCodeProfileReader/GCodeProfileReader.py +++ b/plugins/GCodeProfileReader/GCodeProfileReader.py @@ -66,7 +66,10 @@ class GCodeProfileReader(ProfileReader): profile = Profile(machine_manager = Application.getInstance().getMachineManager(), read_only = False) try: profile.unserialise(serialised) - except Exception as e: #Not a valid g-code file. + profile.setType(None) #Force type to none so it's correctly added. + profile.setReadOnly(False) + profile.setDirty(True) + except Exception as e: #Not a valid g-comachine_instance_profilede file. Logger.log("e", "Unable to serialise the profile: %s", str(e)) return None return profile \ No newline at end of file diff --git a/plugins/LegacyProfileReader/LegacyProfileReader.py b/plugins/LegacyProfileReader/LegacyProfileReader.py index 1d1c3126e9..661646bf64 100644 --- a/plugins/LegacyProfileReader/LegacyProfileReader.py +++ b/plugins/LegacyProfileReader/LegacyProfileReader.py @@ -124,5 +124,5 @@ class LegacyProfileReader(ProfileReader): if len(profile.getChangedSettings()) == 0: Logger.log("i", "A legacy profile was imported but everything evaluates to the defaults, creating an empty profile.") - + profile.setDirty(True) return profile \ No newline at end of file