Changing the material is now possible

CURA-1278
This commit is contained in:
Jaime van Kessel 2016-05-12 17:38:43 +02:00
parent 89c0644e4b
commit f5e63f2e71
2 changed files with 17 additions and 4 deletions

View file

@ -201,14 +201,14 @@ Item
exclusiveGroup: materialSelectionMenuGroup;
onTriggered:
{
UM.MachineManager.setActiveMaterial(machineMaterialsModel.getItem(index).name);
if (typeof(model) !== "undefined" && !model.active) {
Cura.MachineManager.setActiveMaterial(model.id);
/*if (typeof(model) !== "undefined" && !model.active) {
//Selecting a material was canceled; undo menu selection
materialSelectionInstantiator.model.setProperty(index, "active", false);
var activeMaterialName = UM.MachineManager.activeMaterial;
var activeMaterialName = Cura.MachineManager.activeMaterialName
var activeMaterialIndex = materialSelectionInstantiator.model.find("name", activeMaterialName);
materialSelectionInstantiator.model.setProperty(activeMaterialIndex, "active", true);
}
}*/
}
}
onObjectAdded: materialSelectionMenu.insertItem(index, object)