Merge branch 'master' into feature_sync_button

This commit is contained in:
Diego Prado Gesto 2018-03-06 16:10:44 +01:00
commit 5280d21c26
16 changed files with 101 additions and 145 deletions

View file

@ -52,6 +52,7 @@ Menu
{
text: model.name
checkable: model.available
enabled: model.available
checked: Cura.MachineManager.activeQualityOrQualityChangesName == model.name
exclusiveGroup: group
onTriggered: Cura.MachineManager.setQualityChangesGroup(model.quality_changes_group)

View file

@ -47,6 +47,19 @@ TabView
return Math.round(diameter);
}
// This trick makes sure to make all fields lose focus so their onEditingFinished will be triggered
// and modified values will be saved. This can happen when a user changes a value and then closes the
// dialog directly.
//
// Please note that somehow this callback is ONLY triggered when visible is false.
onVisibleChanged:
{
if (!visible)
{
base.focus = false;
}
}
Tab
{
title: catalog.i18nc("@title", "Information")

View file

@ -52,6 +52,24 @@ Item
return base.currentItem.root_material_id == root_material_id;
}
Component.onCompleted:
{
// Select the activated material when this page shows up
const extruder_position = Cura.ExtruderManager.activeExtruderIndex;
const active_root_material_id = Cura.MachineManager.currentRootMaterialId[extruder_position];
var itemIndex = -1;
for (var i = 0; i < materialsModel.rowCount(); ++i)
{
var item = materialsModel.getItem(i);
if (item.root_material_id == active_root_material_id)
{
itemIndex = i;
break;
}
}
materialListView.currentIndex = itemIndex;
}
Row // Button Row
{
id: buttonRow