Reverted a previous workaround that fixed errors when selecting material and variants in the application menus - CURA-4386 CURA-4379

This commit is contained in:
Diego Prado Gesto 2017-09-29 09:40:54 +02:00
parent afb83fac88
commit f0e89b7e01

View file

@ -66,7 +66,15 @@ Menu
checkable: true
checked: model.id == Cura.MachineManager.allActiveMaterialIds[ExtruderManager.extruderIds[extruderIndex]]
exclusiveGroup: group
onTriggered: Cura.MachineManager.setActiveMaterial(model.id)
onTriggered:
{
// This workaround is done because of the application menus for materials and variants for multiextrusion printers.
// The extruder menu would always act on the correspoding extruder only, instead of acting on the extruder selected in the UI.
var activeExtruderIndex = ExtruderManager.activeExtruderIndex;
ExtruderManager.setActiveExtruderIndex(extruderIndex);
Cura.MachineManager.setActiveMaterial(model.id);
ExtruderManager.setActiveExtruderIndex(activeExtruderIndex);
}
}
onObjectAdded: menu.insertItem(index, object)
onObjectRemoved: menu.removeItem(object)
@ -101,7 +109,15 @@ Menu
checkable: true
checked: model.id == Cura.MachineManager.allActiveMaterialIds[ExtruderManager.extruderIds[extruderIndex]]
exclusiveGroup: group
onTriggered: Cura.MachineManager.setActiveMaterial(model.id)
onTriggered:
{
// This workaround is done because of the application menus for materials and variants for multiextrusion printers.
// The extruder menu would always act on the correspoding extruder only, instead of acting on the extruder selected in the UI.
var activeExtruderIndex = ExtruderManager.activeExtruderIndex;
ExtruderManager.setActiveExtruderIndex(extruderIndex);
Cura.MachineManager.setActiveMaterial(model.id);
ExtruderManager.setActiveExtruderIndex(activeExtruderIndex);
}
}
onObjectAdded: brandMaterialsMenu.insertItem(index, object)
onObjectRemoved: brandMaterialsMenu.removeItem(object)