mirror of
https://github.com/Ultimaker/Cura.git
synced 2025-07-16 03:07:53 -06:00
Update containerStackId for limit_to_extruder settings when active machine has been changed
CURA-4105
This commit is contained in:
parent
927ba20401
commit
96f8e70e40
1 changed files with 26 additions and 0 deletions
|
@ -266,6 +266,32 @@ Item
|
|||
containerStackId: Cura.MachineManager.activeMachineId
|
||||
key: model.key
|
||||
watchedProperties: [ "limit_to_extruder" ]
|
||||
|
||||
// When the activeMachineId got changed, the binding for limit_to_extruder which updates
|
||||
// provider.containerStackId doesn't get triggered. This handle makes sure that will happen.
|
||||
onContainerStackIdChanged:
|
||||
{
|
||||
if(!model.settable_per_extruder || machineExtruderCount.properties.value == 1)
|
||||
{
|
||||
//Not settable per extruder or there only is global, so we must pick global.
|
||||
provider.containerStackId = Cura.MachineManager.activeMachineId;
|
||||
return;
|
||||
}
|
||||
if(inheritStackProvider.properties.limit_to_extruder != null && inheritStackProvider.properties.limit_to_extruder >= 0)
|
||||
{
|
||||
//We have limit_to_extruder, so pick that stack.
|
||||
provider.containerStackId = ExtruderManager.extruderIds[String(inheritStackProvider.properties.limit_to_extruder)];
|
||||
return;
|
||||
}
|
||||
if(ExtruderManager.activeExtruderStackId)
|
||||
{
|
||||
//We're on an extruder tab. Pick the current extruder.
|
||||
provider.containerStackId = ExtruderManager.activeExtruderStackId;
|
||||
return;
|
||||
}
|
||||
//No extruder tab is selected. Pick the global stack. Shouldn't happen any more since we removed the global tab.
|
||||
provider.containerStackId = Cura.MachineManager.activeMachineId;
|
||||
}
|
||||
}
|
||||
|
||||
UM.SettingPropertyProvider
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue