Fix material update upon extruder-compatible diameter change

CURA-5834

Material models and the material container on an extruder need to be
updated when the extruder's compatible diameter gets changes.
This commit is contained in:
Lipu Fei 2018-10-19 13:48:50 +02:00
parent ea10d5e608
commit 97e6354c13
6 changed files with 59 additions and 20 deletions

View file

@ -408,6 +408,10 @@ Cura.MachineAction
manager.updateMaterialForDiameter(settingsTabs.currentIndex - 1);
}
}
function setValueFunction(value)
{
Cura.MachineManager.activeStack.compatibleMaterialDiameter = value;
}
property bool isExtruderSetting: true
}
@ -564,6 +568,7 @@ Cura.MachineAction
property bool _forceUpdateOnChange: (typeof(forceUpdateOnChange) === 'undefined') ? false : forceUpdateOnChange
property string _label: (typeof(label) === 'undefined') ? "" : label
property string _tooltip: (typeof(tooltip) === 'undefined') ? propertyProvider.properties.description : tooltip
property var _setValueFunction: (typeof(setValueFunction) === 'undefined') ? undefined : setValueFunction
UM.SettingPropertyProvider
{
@ -616,7 +621,14 @@ Cura.MachineAction
{
if (propertyProvider && text != propertyProvider.properties.value)
{
propertyProvider.setPropertyValue("value", text);
if (_setValueFunction !== undefined)
{
_setValueFunction(text);
}
else
{
propertyProvider.setPropertyValue("value", text);
}
if(_forceUpdateOnChange)
{
manager.forceUpdate();