mirror of
https://github.com/Ultimaker/Cura.git
synced 2025-07-15 10:47:49 -06:00
Fix highlighting the currently active (printer|quality|material) on their management pages
CURA-1278
This commit is contained in:
parent
3953da7a50
commit
38c9d9e4a1
3 changed files with 30 additions and 0 deletions
|
@ -17,6 +17,16 @@ UM.ManagementPage
|
||||||
filter: {"type": "machine"}
|
filter: {"type": "machine"}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
activeId: Cura.MachineManager.activeMachineId
|
||||||
|
activeIndex: {
|
||||||
|
for(var i = 0; i < model.rowCount(); i++) {
|
||||||
|
if (model.getItem(i).id == Cura.MachineManager.activeMachineId) {
|
||||||
|
return i;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return -1;
|
||||||
|
}
|
||||||
|
|
||||||
onAddObject: Printer.requestAddPrinter()
|
onAddObject: Printer.requestAddPrinter()
|
||||||
onRemoveObject: confirmDialog.open();
|
onRemoveObject: confirmDialog.open();
|
||||||
onRenameObject: renameDialog.open();
|
onRenameObject: renameDialog.open();
|
||||||
|
|
|
@ -15,6 +15,16 @@ UM.ManagementPage
|
||||||
title: catalog.i18nc("@title:tab", "Materials");
|
title: catalog.i18nc("@title:tab", "Materials");
|
||||||
|
|
||||||
model: UM.InstanceContainersModel { filter: { "type": "material", "definition": Cura.MachineManager.activeDefinitionId } }
|
model: UM.InstanceContainersModel { filter: { "type": "material", "definition": Cura.MachineManager.activeDefinitionId } }
|
||||||
|
|
||||||
|
activeId: Cura.MachineManager.activeMaterialId
|
||||||
|
activeIndex: {
|
||||||
|
for(var i = 0; i < model.rowCount(); i++) {
|
||||||
|
if (model.getItem(i).id == Cura.MachineManager.activeMaterialId) {
|
||||||
|
return i;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return -1;
|
||||||
|
}
|
||||||
/*
|
/*
|
||||||
onAddObject: { var selectedMaterial = UM.MaterialManager.createProfile(); base.selectMaterial(selectedMaterial); }
|
onAddObject: { var selectedMaterial = UM.MaterialManager.createProfile(); base.selectMaterial(selectedMaterial); }
|
||||||
onRemoveObject: confirmDialog.open();
|
onRemoveObject: confirmDialog.open();
|
||||||
|
|
|
@ -17,6 +17,16 @@ UM.ManagementPage
|
||||||
|
|
||||||
model: UM.InstanceContainersModel { filter: { "type": "quality" } }
|
model: UM.InstanceContainersModel { filter: { "type": "quality" } }
|
||||||
|
|
||||||
|
activeId: Cura.MachineManager.activeQualityId
|
||||||
|
activeIndex: {
|
||||||
|
for(var i = 0; i < model.rowCount(); i++) {
|
||||||
|
if (model.getItem(i).id == Cura.MachineManager.activeQualityId) {
|
||||||
|
return i;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return -1;
|
||||||
|
}
|
||||||
|
|
||||||
onActivateObject: Cura.MachineManager.setActiveQuality(currentItem.id)
|
onActivateObject: Cura.MachineManager.setActiveQuality(currentItem.id)
|
||||||
onAddObject: {
|
onAddObject: {
|
||||||
var selectedProfile;
|
var selectedProfile;
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue