Add "Create" button to create a new, unique material.

The new custom material is still based on generic_pla, but it gets a new GUID and uses itself as base_file so it is not conjoined to another material.
This commit is contained in:
fieldOfView 2017-04-27 11:19:46 +02:00
parent d0a95426cb
commit 02b978272f
2 changed files with 45 additions and 0 deletions

View file

@ -135,6 +135,23 @@ UM.ManagementPage
}
},
Button
{
text: catalog.i18nc("@action:button", "Create")
iconName: "list-add"
onClicked:
{
var material_id = Cura.ContainerManager.createMaterial()
if(material_id == "")
{
return
}
if(Cura.MachineManager.hasMaterials)
{
Cura.MachineManager.setActiveMaterial(material_id)
}
}
},
Button
{
text: catalog.i18nc("@action:button", "Duplicate");
iconName: "list-add";