mirror of
https://git.mirrors.martin98.com/https://github.com/Ultimaker/Cura
synced 2025-08-13 07:29:03 +08:00
Prevent multiple machines having the same custom name
Caused by container vs containerstack confusion Fixes CURA-1606 and CURA-1649
This commit is contained in:
parent
ead91db062
commit
c21475abd7
@ -179,8 +179,8 @@ class MachineManagerModel(QObject):
|
|||||||
i = 1
|
i = 1
|
||||||
|
|
||||||
# Check both the id and the name, because they may not be the same and it is better if they are both unique
|
# Check both the id and the name, because they may not be the same and it is better if they are both unique
|
||||||
while UM.Settings.ContainerRegistry.getInstance().findContainers(None, id = unique_name) or \
|
while UM.Settings.ContainerRegistry.getInstance().findContainerStacks(id = unique_name, type = "machine") or \
|
||||||
UM.Settings.ContainerRegistry.getInstance().findContainers(None, name = unique_name):
|
UM.Settings.ContainerRegistry.getInstance().findContainerStacks(name = unique_name, type = "machine"):
|
||||||
i += 1
|
i += 1
|
||||||
unique_name = "%s #%d" % (name, i)
|
unique_name = "%s #%d" % (name, i)
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user