Merge branch '2.7'

This commit is contained in:
Ghostkeeper 2017-08-28 16:21:40 +02:00
commit 7a8956fd0e
No known key found for this signature in database
GPG key ID: C5F96EE2BC0F7E75
10 changed files with 9171 additions and 43 deletions

View file

@ -135,6 +135,8 @@ Item {
}
}
// Specialty provider that only watches global_inherits (we cant filter on what property changed we get events
// so we bypass that to make a dedicated provider).
UM.SettingPropertyProvider
{
id: provider
@ -146,8 +148,6 @@ Item {
removeUnusedValue: false
}
// Specialty provider that only watches global_inherits (we cant filter on what property changed we get events
// so we bypass that to make a dedicated provider).
UM.SettingPropertyProvider
{
id: inheritStackProvider
@ -156,36 +156,42 @@ Item {
watchedProperties: [ "limit_to_extruder" ]
}
Binding
Connections
{
target: provider
property: "containerStackId"
when: model.settable_per_extruder || (inheritStackProvider.properties.limit_to_extruder != null && inheritStackProvider.properties.limit_to_extruder >= 0);
value:
target: inheritStackProvider
onPropertiesChanged:
{
// associate this binding with Cura.MachineManager.activeMachineId in the beginning so this
// binding will be triggered when activeMachineId is changed too.
// Otherwise, if this value only depends on the extruderIds, it won't get updated when the
// machine gets changed.
var activeMachineId = Cura.MachineManager.activeMachineId;
provider.forcePropertiesChanged();
}
}
if(!model.settable_per_extruder || machineExtruderCount.properties.value == 1)
Connections
{
target: UM.ActiveTool
onPropertiesChanged:
{
// the values cannot be bound with UM.ActiveTool.properties.getValue() calls,
// so here we connect to the signal and update the those values.
if (typeof UM.ActiveTool.properties.getValue("SelectedObjectId") !== "undefined")
{
//Not settable per extruder or there only is global, so we must pick global.
return activeMachineId;
const selectedObjectId = UM.ActiveTool.properties.getValue("SelectedObjectId");
if (addedSettingsModel.visibilityHandler.selectedObjectId != selectedObjectId)
{
addedSettingsModel.visibilityHandler.selectedObjectId = selectedObjectId;
}
}
if(inheritStackProvider.properties.limit_to_extruder != null && inheritStackProvider.properties.limit_to_extruder >= 0)
if (typeof UM.ActiveTool.properties.getValue("ContainerID") !== "undefined")
{
//We have limit_to_extruder, so pick that stack.
return ExtruderManager.extruderIds[String(inheritStackProvider.properties.limit_to_extruder)];
const containerId = UM.ActiveTool.properties.getValue("ContainerID");
if (provider.containerStackId != containerId)
{
provider.containerStackId = containerId;
}
if (inheritStackProvider.containerStackId != containerId)
{
inheritStackProvider.containerStackId = containerId;
}
}
if(UM.ActiveTool.properties.getValue("ContainerID"))
{
//We're on an extruder tab. Pick the current extruder.
return UM.ActiveTool.properties.getValue("ContainerID");
}
//No extruder tab is selected. Pick the global stack. Shouldn't happen any more since we removed the global tab.
return activeMachineId;
}
}
}