mirror of
https://github.com/Ultimaker/Cura.git
synced 2025-07-25 15:44:04 -06:00
Fix providing of global_inherits_stack settings
I've rewritten this part and documented what each case catches. There is a base case which is not required any more since we removed the global tab, but I left it in for defense. Contributes to issue CURA-2006.
This commit is contained in:
parent
eaa7d716f5
commit
1c1bfbe114
1 changed files with 20 additions and 12 deletions
|
@ -94,21 +94,29 @@ ScrollView
|
||||||
{
|
{
|
||||||
target: provider
|
target: provider
|
||||||
property: "containerStackId"
|
property: "containerStackId"
|
||||||
when: model.settable_per_extruder || (inheritStackProvider.properties.global_inherits_stack == -1 || inheritStackProvider.properties.global_inherits_stack == null)
|
when: {
|
||||||
|
var now = model.settable_per_extruder || model.settable_per_mesh || (inheritStackProvider.properties.global_inherits_stack == null && inheritStackProvider.properties.global_inherits_stack < 0);
|
||||||
|
return now;
|
||||||
|
}
|
||||||
value:
|
value:
|
||||||
{
|
{
|
||||||
if(inheritStackProvider.properties.global_inherits_stack == -1 || inheritStackProvider.properties.global_inherits_stack == null)
|
if(!model.settable_per_extruder && !model.settable_per_mesh)
|
||||||
{
|
{
|
||||||
if( ExtruderManager.activeExtruderStackId)
|
//Not settable per extruder, so we must pick global.
|
||||||
{
|
return Cura.MachineManager.activeMachineId;
|
||||||
return ExtruderManager.activeExtruderStackId
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
return Cura.MachineManager.activeMachineId
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
return ExtruderManager.extruderIds[String(inheritStackProvider.properties.global_inherits_stack)]
|
if(inheritStackProvider.properties.global_inherits_stack != null && inheritStackProvider.properties.global_inherits_stack >= 0)
|
||||||
|
{
|
||||||
|
//We have global_inherits_stack, so pick that stack.
|
||||||
|
return ExtruderManager.extruderIds[String(inheritStackProvider.properties.global_inherits_stack)];
|
||||||
|
}
|
||||||
|
if(ExtruderManager.activeExtruderStackId)
|
||||||
|
{
|
||||||
|
//We're on an extruder tab. Pick the current extruder.
|
||||||
|
return ExtruderManager.activeExtruderStackId;
|
||||||
|
}
|
||||||
|
//No extruder tab is selected. Pick the global stack. Shouldn't happen any more since we removed the global tab.
|
||||||
|
return Cura.MachineManager.activeMachineId;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -119,7 +127,7 @@ ScrollView
|
||||||
id: inheritStackProvider
|
id: inheritStackProvider
|
||||||
containerStackId: Cura.MachineManager.activeMachineId
|
containerStackId: Cura.MachineManager.activeMachineId
|
||||||
key: model.key
|
key: model.key
|
||||||
watchedProperties: [ "global_inherits_stack"]
|
watchedProperties: [ "global_inherits_stack" ]
|
||||||
}
|
}
|
||||||
|
|
||||||
UM.SettingPropertyProvider
|
UM.SettingPropertyProvider
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue