mirror of
https://github.com/Ultimaker/Cura.git
synced 2025-12-11 16:00:47 -07:00
CURA-4386 CURA-4379 change stack behaviours to fix crashes
This commit is contained in:
parent
e3edc79a3e
commit
1b8766b953
6 changed files with 34 additions and 29 deletions
|
|
@ -39,11 +39,8 @@ Menu
|
|||
visible: printerConnected && Cura.MachineManager.printerOutputDevices[0].materialNames.length > extruderIndex
|
||||
onTriggered:
|
||||
{
|
||||
var activeExtruderIndex = ExtruderManager.activeExtruderIndex;
|
||||
ExtruderManager.setActiveExtruderIndex(extruderIndex);
|
||||
var materialId = Cura.MachineManager.printerOutputDevices[0].materialIds[extruderIndex];
|
||||
var items = materialsModel.items;
|
||||
// materialsModel.find cannot be used because we need to look inside the metadata property of items
|
||||
for(var i in items)
|
||||
{
|
||||
if (items[i]["metadata"]["GUID"] == materialId)
|
||||
|
|
@ -52,7 +49,6 @@ Menu
|
|||
break;
|
||||
}
|
||||
}
|
||||
ExtruderManager.setActiveExtruderIndex(activeExtruderIndex);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -70,13 +66,7 @@ Menu
|
|||
checkable: true
|
||||
checked: model.id == Cura.MachineManager.allActiveMaterialIds[ExtruderManager.extruderIds[extruderIndex]]
|
||||
exclusiveGroup: group
|
||||
onTriggered:
|
||||
{
|
||||
var activeExtruderIndex = ExtruderManager.activeExtruderIndex;
|
||||
ExtruderManager.setActiveExtruderIndex(extruderIndex);
|
||||
Cura.MachineManager.setActiveMaterial(model.id);
|
||||
ExtruderManager.setActiveExtruderIndex(activeExtruderIndex);
|
||||
}
|
||||
onTriggered: Cura.MachineManager.setActiveMaterial(model.id)
|
||||
}
|
||||
onObjectAdded: menu.insertItem(index, object)
|
||||
onObjectRemoved: menu.removeItem(object)
|
||||
|
|
@ -111,13 +101,7 @@ Menu
|
|||
checkable: true
|
||||
checked: model.id == Cura.MachineManager.allActiveMaterialIds[ExtruderManager.extruderIds[extruderIndex]]
|
||||
exclusiveGroup: group
|
||||
onTriggered:
|
||||
{
|
||||
var activeExtruderIndex = ExtruderManager.activeExtruderIndex;
|
||||
ExtruderManager.setActiveExtruderIndex(extruderIndex);
|
||||
Cura.MachineManager.setActiveMaterial(model.id);
|
||||
ExtruderManager.setActiveExtruderIndex(activeExtruderIndex);
|
||||
}
|
||||
onTriggered: Cura.MachineManager.setActiveMaterial(model.id)
|
||||
}
|
||||
onObjectAdded: brandMaterialsMenu.insertItem(index, object)
|
||||
onObjectRemoved: brandMaterialsMenu.removeItem(object)
|
||||
|
|
|
|||
|
|
@ -91,12 +91,7 @@ Column
|
|||
Connections
|
||||
{
|
||||
target: Cura.MachineManager
|
||||
onGlobalContainerChanged:
|
||||
{
|
||||
forceActiveFocus() // Changing focus applies the currently-being-typed values so it can change the displayed setting values.
|
||||
// var extruder_index = (machineExtruderCount.properties.value == 1) ? -1 : 0
|
||||
// ExtruderManager.setActiveExtruderIndex(extruder_index);
|
||||
}
|
||||
onGlobalContainerChanged: forceActiveFocus() // Changing focus applies the currently-being-typed values so it can change the displayed setting values.
|
||||
}
|
||||
|
||||
delegate: Button
|
||||
|
|
@ -294,6 +289,15 @@ Column
|
|||
|
||||
menu: MaterialMenu { extruderIndex: base.currentExtruderIndex }
|
||||
}
|
||||
|
||||
Connections
|
||||
{
|
||||
target: Cura.MachineManager
|
||||
onGlobalContainerChanged:
|
||||
{
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// Print core row
|
||||
|
|
|
|||
|
|
@ -68,6 +68,12 @@ Item
|
|||
onActiveQualityChanged: qualityModel.update()
|
||||
}
|
||||
|
||||
Connections
|
||||
{
|
||||
target: Cura.MachineManager
|
||||
onActiveMaterialChanged: qualityModel.update()
|
||||
}
|
||||
|
||||
ListModel
|
||||
{
|
||||
id: qualityModel
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue