Merge branch '4.2' of github.com:Ultimaker/Cura

This commit is contained in:
Jaime van Kessel 2019-07-26 12:47:13 +02:00
commit e0c2611a0a
51 changed files with 213 additions and 147 deletions

View file

@ -13,7 +13,6 @@ Item
{
id: base
property QtObject materialManager: CuraApplication.getMaterialManager()
// Keep PreferencesDialog happy
property var resetEnabled: false
property var currentItem: null
@ -49,15 +48,6 @@ Item
// When loaded, try to select the active material in the tree
Component.onCompleted: resetExpandedActiveMaterial()
Connections
{
target: Cura.MachineManager
onActiveMaterialChanged:
{
resetExpandedActiveMaterial()
}
}
// Every time the selected item has changed, notify to the details panel
onCurrentItemChanged:
{
@ -119,7 +109,7 @@ Item
onClicked:
{
forceActiveFocus();
base.newRootMaterialIdToSwitchTo = base.materialManager.createMaterial();
base.newRootMaterialIdToSwitchTo = CuraApplication.getMaterialManager().createMaterial();
base.toActivateNewMaterial = true;
}
}
@ -134,7 +124,7 @@ Item
onClicked:
{
forceActiveFocus();
base.newRootMaterialIdToSwitchTo = base.materialManager.duplicateMaterial(base.currentItem.container_node);
base.newRootMaterialIdToSwitchTo = CuraApplication.getMaterialManager().duplicateMaterial(base.currentItem.container_node);
base.toActivateNewMaterial = true;
}
}
@ -145,7 +135,7 @@ Item
id: removeMenuButton
text: catalog.i18nc("@action:button", "Remove")
iconName: "list-remove"
enabled: base.hasCurrentItem && !base.currentItem.is_read_only && !base.isCurrentItemActivated && base.materialManager.canMaterialBeRemoved(base.currentItem.container_node)
enabled: base.hasCurrentItem && !base.currentItem.is_read_only && !base.isCurrentItemActivated && CuraApplication.getMaterialManager().canMaterialBeRemoved(base.currentItem.container_node)
onClicked:
{
forceActiveFocus();
@ -294,7 +284,7 @@ Item
{
// Set the active material as the fallback. It will be selected when the current material is deleted
base.newRootMaterialIdToSwitchTo = base.active_root_material_id
base.materialManager.removeMaterial(base.currentItem.container_node);
CuraApplication.getMaterialManager().removeMaterial(base.currentItem.container_node);
}
}

View file

@ -82,10 +82,10 @@ Rectangle
{
if (materialSlot.is_favorite)
{
base.materialManager.removeFavorite(material.root_material_id)
CuraApplication.getMaterialManager().removeFavorite(material.root_material_id)
return
}
base.materialManager.addFavorite(material.root_material_id)
CuraApplication.getMaterialManager().addFavorite(material.root_material_id)
return
}
style: ButtonStyle

View file

@ -14,8 +14,6 @@ TabView
{
id: base
property QtObject materialManager: CuraApplication.getMaterialManager()
property QtObject properties
property var currentMaterialNode: null
@ -567,7 +565,7 @@ TabView
}
// update the values
base.materialManager.setMaterialName(base.currentMaterialNode, new_name)
CuraApplication.getMaterialManager().setMaterialName(base.currentMaterialNode, new_name)
properties.name = new_name
}