Fix MachineSettings dialog

CURA-4708

- Move material diameter and nozzle size to extruder tabs
- Fix value bindings
This commit is contained in:
Lipu Fei 2018-01-02 12:40:43 +01:00
parent 0b7519dff2
commit b246a102ed
2 changed files with 77 additions and 89 deletions

View file

@ -292,18 +292,6 @@ Cura.MachineAction
}
}
}
Loader
{
id: materialDiameterField
visible: Cura.MachineManager.hasMaterials
sourceComponent: numericTextFieldWithUnit
property string settingKey: "material_diameter"
property string unit: catalog.i18nc("@label", "mm")
property string tooltip: catalog.i18nc("@tooltip", "The nominal diameter of filament supported by the printer. The exact diameter will be overridden by the material and/or the profile.")
property var afterOnEditingFinished: manager.updateMaterialForDiameter
property string label: catalog.i18nc("@label", "Material diameter")
}
}
}
@ -360,7 +348,6 @@ Cura.MachineAction
if(currentIndex > 0)
{
contentItem.forceActiveFocus();
Cura.ExtruderManager.setActiveExtruderIndex(currentIndex - 1);
}
}
@ -397,6 +384,25 @@ Cura.MachineAction
property bool isExtruderSetting: true
}
Loader
{
id: materialDiameterField
visible: Cura.MachineManager.hasMaterials
sourceComponent: numericTextFieldWithUnit
property string settingKey: "material_diameter"
property string label: catalog.i18nc("@label", "Material diameter")
property string unit: catalog.i18nc("@label", "mm")
property string tooltip: catalog.i18nc("@tooltip", "The nominal diameter of filament supported by the printer. The exact diameter will be overridden by the material and/or the profile.")
property var afterOnEditingFinished:
{
if (settingsTabs.currentIndex > 0)
{
manager.updateMaterialForDiameter(settingsTabs.currentIndex - 1);
}
}
property bool isExtruderSetting: true
}
Loader
{
id: extruderOffsetXField
@ -495,7 +501,7 @@ Cura.MachineAction
{
if(settingsTabs.currentIndex > 0)
{
return Cura.MachineManager.activeStackId;
return Cura.ExtruderManager.extruderIds[String(settingsTabs.currentIndex - 1)];
}
return "";
}
@ -513,11 +519,11 @@ Cura.MachineAction
checked: String(propertyProvider.properties.value).toLowerCase() != 'false'
onClicked:
{
propertyProvider.setPropertyValue("value", checked);
if(_forceUpdateOnChange)
{
manager.forceUpdate();
}
propertyProvider.setPropertyValue("value", checked);
if(_forceUpdateOnChange)
{
manager.forceUpdate();
}
}
}
}
@ -548,7 +554,7 @@ Cura.MachineAction
{
if(settingsTabs.currentIndex > 0)
{
return Cura.MachineManager.activeStackId;
return Cura.ExtruderManager.extruderIds[String(settingsTabs.currentIndex - 1)];
}
return "";
}
@ -581,7 +587,10 @@ Cura.MachineAction
TextField
{
id: textField
text: (propertyProvider.properties.value) ? propertyProvider.properties.value : ""
text: {
const value = propertyProvider.properties.value;
return value ? value : "";
}
validator: RegExpValidator { regExp: _allowNegative ? /-?[0-9\.]{0,6}/ : /[0-9\.]{0,6}/ }
onEditingFinished:
{
@ -590,12 +599,7 @@ Cura.MachineAction
propertyProvider.setPropertyValue("value", text);
if(_forceUpdateOnChange)
{
var extruderIndex = Cura.ExtruderManager.activeExtruderIndex;
manager.forceUpdate();
if(Cura.ExtruderManager.activeExtruderIndex != extruderIndex)
{
Cura.ExtruderManager.setActiveExtruderIndex(extruderIndex)
}
}
if(_afterOnEditingFinished)
{
@ -641,7 +645,7 @@ Cura.MachineAction
{
if(settingsTabs.currentIndex > 0)
{
return Cura.MachineManager.activeStackId;
return Cura.ExtruderManager.extruderIds[String(settingsTabs.currentIndex - 1)];
}
return "";
}