diff options
author | A.Sasin <a.sasin@ultimaker.com> | 2017-09-29 14:52:00 +0300 |
---|---|---|
committer | A.Sasin <a.sasin@ultimaker.com> | 2017-09-29 14:52:00 +0300 |
commit | 3082038261c113d5b45f9ec7fc4b3fb305427ef3 (patch) | |
tree | 80cbc87c971cf3323062ee3f6848daab42f6b5e2 /cura | |
parent | 89de83254dc02daf39cd97cc62b56d019761f429 (diff) |
Fixed code style and machine default name is retrieved from machine definition
CURA-4345
Diffstat (limited to 'cura')
-rw-r--r-- | cura/Settings/CuraStackBuilder.py | 6 | ||||
-rwxr-xr-x | cura/Settings/MachineManager.py | 6 |
2 files changed, 6 insertions, 6 deletions
diff --git a/cura/Settings/CuraStackBuilder.py b/cura/Settings/CuraStackBuilder.py index 32d6cd3cd7..7a48b1657e 100644 --- a/cura/Settings/CuraStackBuilder.py +++ b/cura/Settings/CuraStackBuilder.py @@ -21,7 +21,7 @@ class CuraStackBuilder: # # \return The new global stack or None if an error occurred. @classmethod - def createMachine(cls, name: str, definition_id: str, default_name: str) -> Optional[GlobalStack]: + def createMachine(cls, name: str, definition_id: str) -> Optional[GlobalStack]: registry = ContainerRegistry.getInstance() definitions = registry.findDefinitionContainers(id = definition_id) if not definitions: @@ -29,7 +29,7 @@ class CuraStackBuilder: return None machine_definition = definitions[0] - generated_name = registry.createUniqueName("machine", "", default_name, machine_definition.name) + generated_name = registry.createUniqueName("machine", "", machine_definition.name, machine_definition.name) # Make sure the new name does not collide with any definition or (quality) profile # createUniqueName() only looks at other stacks, but not at definitions or quality profiles # Note that we don't go for uniqueName() immediately because that function matches with ignore_case set to true @@ -45,7 +45,7 @@ class CuraStackBuilder: ) # after creating a global stack can be set custom defined name - if(name != generated_name): + if name != generated_name: name = registry.createUniqueName("machine", "", name, machine_definition.name) if registry.findContainers(id = name): name = registry.uniqueName(name) diff --git a/cura/Settings/MachineManager.py b/cura/Settings/MachineManager.py index ce9cdc7de7..4a321d0529 100755 --- a/cura/Settings/MachineManager.py +++ b/cura/Settings/MachineManager.py @@ -352,9 +352,9 @@ class MachineManager(QObject): if containers: Application.getInstance().setGlobalContainerStack(containers[0]) - @pyqtSlot(str, str, str) - def addMachine(self, name: str, definition_id: str, default_name: str) -> None: - new_stack = CuraStackBuilder.createMachine(name, definition_id, default_name) + @pyqtSlot(str, str) + def addMachine(self, name: str, definition_id: str) -> None: + new_stack = CuraStackBuilder.createMachine(name, definition_id) if new_stack: Application.getInstance().setGlobalContainerStack(new_stack) else: |