mirror of
https://git.mirrors.martin98.com/https://github.com/Ultimaker/Cura
synced 2025-08-13 22:56:01 +08:00
When import multi extrusion profile, they now all get the same name
CURA-2462
This commit is contained in:
parent
fc69b110f3
commit
829d341f7f
@ -144,12 +144,14 @@ class CuraContainerRegistry(ContainerRegistry):
|
|||||||
self._configureProfile(profile, name_seed)
|
self._configureProfile(profile, name_seed)
|
||||||
return { "status": "ok", "message": catalog.i18nc("@info:status", "Successfully imported profile {0}", profile.getName()) }
|
return { "status": "ok", "message": catalog.i18nc("@info:status", "Successfully imported profile {0}", profile.getName()) }
|
||||||
else:
|
else:
|
||||||
|
new_name = self.createUniqueName("quality_changes", "", name_seed, catalog.i18nc("@label", "Custom profile"))
|
||||||
for profile in profile_or_list:
|
for profile in profile_or_list:
|
||||||
profile.setDirty(True) # Ensure the profiles are correctly saved
|
profile.setDirty(True) # Ensure the profiles are correctly saved
|
||||||
if profile.getId() != "":
|
if profile.getId() != "":
|
||||||
container_registry.addContainer(profile)
|
container_registry.addContainer(profile)
|
||||||
else:
|
else:
|
||||||
self._configureProfile(profile, name_seed)
|
self._configureProfile(profile, name_seed)
|
||||||
|
profile.setName(new_name)
|
||||||
|
|
||||||
if len(profile_or_list) == 1:
|
if len(profile_or_list) == 1:
|
||||||
return {"status": "ok", "message": catalog.i18nc("@info:status", "Successfully imported profile {0}", profile_or_list[0].getName())}
|
return {"status": "ok", "message": catalog.i18nc("@info:status", "Successfully imported profile {0}", profile_or_list[0].getName())}
|
||||||
@ -160,12 +162,11 @@ class CuraContainerRegistry(ContainerRegistry):
|
|||||||
#If it hasn't returned by now, none of the plugins loaded the profile successfully.
|
#If it hasn't returned by now, none of the plugins loaded the profile successfully.
|
||||||
return { "status": "error", "message": catalog.i18nc("@info:status", "Profile {0} has an unknown file type.", file_name)}
|
return { "status": "error", "message": catalog.i18nc("@info:status", "Profile {0} has an unknown file type.", file_name)}
|
||||||
|
|
||||||
def _configureProfile(self, profile, name_seed):
|
def _configureProfile(self, profile, id_seed):
|
||||||
profile.setReadOnly(False)
|
profile.setReadOnly(False)
|
||||||
|
|
||||||
new_name = self.createUniqueName("quality_changes", "", name_seed, catalog.i18nc("@label", "Custom profile"))
|
new_id = self.createUniqueName("quality_changes", "", id_seed, catalog.i18nc("@label", "Custom profile"))
|
||||||
profile.setName(new_name)
|
profile._id = new_id
|
||||||
profile._id = new_name
|
|
||||||
|
|
||||||
if self._machineHasOwnQualities():
|
if self._machineHasOwnQualities():
|
||||||
profile.setDefinition(self._activeDefinition())
|
profile.setDefinition(self._activeDefinition())
|
||||||
|
Loading…
x
Reference in New Issue
Block a user