mirror of
https://github.com/Ultimaker/Cura.git
synced 2025-07-16 11:17:49 -06:00
Fix creating variants
This commit is contained in:
parent
c8cedb301a
commit
78475d68b3
1 changed files with 3 additions and 4 deletions
|
@ -40,10 +40,10 @@ class MachineSettingsAction(MachineAction):
|
||||||
if variant and variant.getId() == "empty_variant":
|
if variant and variant.getId() == "empty_variant":
|
||||||
# There is an empty variant that we can use to store the machine settings
|
# There is an empty variant that we can use to store the machine settings
|
||||||
container_index = global_container_stack.getContainerIndex(variant)
|
container_index = global_container_stack.getContainerIndex(variant)
|
||||||
machine_settings_variant = self._createMachineVariant(global_container_stack, container_index)
|
machine_settings_variant = self._createMachineSettingsVariant(global_container_stack, container_index)
|
||||||
else:
|
else:
|
||||||
# Add a second variant before the current variant to store the machine settings
|
# Add a second variant before the current variant to store the machine settings
|
||||||
machine_settings_variant = self._createMachineVariant(global_container_stack)
|
machine_settings_variant = self._createMachineSettingsVariant(global_container_stack)
|
||||||
|
|
||||||
# Notify the UI in which container to store the machine settings data
|
# Notify the UI in which container to store the machine settings data
|
||||||
container_index = global_container_stack.getContainerIndex(machine_settings_variant)
|
container_index = global_container_stack.getContainerIndex(machine_settings_variant)
|
||||||
|
@ -68,8 +68,7 @@ class MachineSettingsAction(MachineAction):
|
||||||
if container_index:
|
if container_index:
|
||||||
global_container_stack.replaceContainer(container_index, machine_settings_variant)
|
global_container_stack.replaceContainer(container_index, machine_settings_variant)
|
||||||
else:
|
else:
|
||||||
index = len(global_container_stack.getContainers()) - 1
|
global_container_stack.insertContainer(-1, machine_settings_variant)
|
||||||
global_container_stack.insertContainer(index, machine_settings_variant)
|
|
||||||
return machine_settings_variant
|
return machine_settings_variant
|
||||||
|
|
||||||
containerIndexChanged = pyqtSignal()
|
containerIndexChanged = pyqtSignal()
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue