mirror of
https://github.com/Ultimaker/Cura.git
synced 2025-07-06 14:37:29 -06:00
Add check if resulting profile is empty
If it is, a warning is logged. Contributes to issue CURA-37.
This commit is contained in:
parent
e7b2586d36
commit
f09b927288
1 changed files with 4 additions and 0 deletions
|
@ -63,6 +63,7 @@ class LegacyProfileReader(ProfileReader):
|
|||
# file could not be read or didn't contain a valid profile, \code None
|
||||
# \endcode is returned.
|
||||
def read(self, file_name):
|
||||
Logger.log("i", "Importing legacy profile from file " + file_name + ".")
|
||||
profile = Profile(machine_manager = Application.getInstance().getMachineManager(), read_only = False) #Create an empty profile.
|
||||
profile.setName("Imported Legacy Profile")
|
||||
|
||||
|
@ -120,4 +121,7 @@ class LegacyProfileReader(ProfileReader):
|
|||
if new_value != value_using_defaults and profile.getSettingValue(new_setting) != new_value: #Not equal to the default in the new Cura OR the default in the legacy Cura.
|
||||
profile.setSettingValue(new_setting, new_value) #Store the setting in the profile!
|
||||
|
||||
if len(profile.getChangedSettings()) == 0:
|
||||
Logger.log("i", "A legacy profile was imported but everything evaluates to the defaults, creating an empty profile.")
|
||||
|
||||
return profile
|
Loading…
Add table
Add a link
Reference in a new issue