mirror of
https://github.com/Ultimaker/Cura.git
synced 2025-07-25 15:44:04 -06:00
Select newly created material
This commit is contained in:
parent
f3c2df3ab4
commit
00f3cf409b
1 changed files with 6 additions and 2 deletions
|
@ -91,9 +91,11 @@ UM.ManagementPage
|
||||||
}
|
}
|
||||||
|
|
||||||
activeId: Cura.MachineManager.activeMaterialId
|
activeId: Cura.MachineManager.activeMaterialId
|
||||||
activeIndex: {
|
activeIndex: getIndexById(activeId)
|
||||||
|
function getIndexById(material_id)
|
||||||
|
{
|
||||||
for(var i = 0; i < model.rowCount(); i++) {
|
for(var i = 0; i < model.rowCount(); i++) {
|
||||||
if (model.getItem(i).id == Cura.MachineManager.activeMaterialId) {
|
if (model.getItem(i).id == material_id) {
|
||||||
return i;
|
return i;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -149,6 +151,7 @@ UM.ManagementPage
|
||||||
{
|
{
|
||||||
Cura.MachineManager.setActiveMaterial(material_id)
|
Cura.MachineManager.setActiveMaterial(material_id)
|
||||||
}
|
}
|
||||||
|
base.objectList.currentIndex = base.getIndexById(material_id);
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
Button
|
Button
|
||||||
|
@ -169,6 +172,7 @@ UM.ManagementPage
|
||||||
{
|
{
|
||||||
Cura.MachineManager.setActiveMaterial(material_id)
|
Cura.MachineManager.setActiveMaterial(material_id)
|
||||||
}
|
}
|
||||||
|
base.objectList.currentIndex = base.getIndexById(material_id);
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
Button
|
Button
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue