mirror of
https://github.com/Ultimaker/Cura.git
synced 2025-07-15 18:57:52 -06: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
1 changed files with 2 additions and 2 deletions
|
@ -179,8 +179,8 @@ class MachineManagerModel(QObject):
|
|||
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
|
||||
while UM.Settings.ContainerRegistry.getInstance().findContainers(None, id = unique_name) or \
|
||||
UM.Settings.ContainerRegistry.getInstance().findContainers(None, name = unique_name):
|
||||
while UM.Settings.ContainerRegistry.getInstance().findContainerStacks(id = unique_name, type = "machine") or \
|
||||
UM.Settings.ContainerRegistry.getInstance().findContainerStacks(name = unique_name, type = "machine"):
|
||||
i += 1
|
||||
unique_name = "%s #%d" % (name, i)
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue