WIP Fix an error in which the current selected material was not

correctly selected when there is more than one brand (stupid mistake).
Also fix problems when the user changes some material information.

Contributes to CURA-5682.
This commit is contained in:
Diego Prado Gesto 2018-09-14 10:51:56 +02:00
parent 6dc53cc60a
commit 972f0bef43
3 changed files with 53 additions and 25 deletions

View file

@ -13,16 +13,17 @@ Item
{
id: detailsPanel
property var currentItem: base.currentItem
property var currentItem: null
onCurrentItemChanged: updateMaterialPropertiesObject()
onCurrentItemChanged:
{
// When the current item changes, the detail view needs to be updated
updateMaterialPropertiesObject()
materialDetailsView.currentMaterialNode = currentItem.container_node
}
function updateMaterialPropertiesObject()
{
if (currentItem === null)
{
return
}
materialProperties.name = currentItem.name || "Unknown"
materialProperties.guid = currentItem.GUID
materialProperties.container_id = currentItem.id
@ -71,8 +72,6 @@ Item
properties: materialProperties
containerId: currentItem != null ? currentItem.id : ""
currentMaterialNode: currentItem.container_node
}
QtObject