Merge pull request #4885 from Ultimaker/CURA-5961-NaN_infill_before_adding_printer

Ensure that no weird data is set in the printSetupSelector on first start
This commit is contained in:
Lipu Fei 2018-11-27 10:23:58 +01:00 committed by GitHub
commit a99c1f4f73
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -54,12 +54,12 @@ Cura.ExpandableComponent
IconWithText
{
source: UM.Theme.getIcon("category_layer_height")
text: Cura.MachineManager.activeQualityOrQualityChangesName + " " + layerHeight.properties.value + "mm"
text: Cura.MachineManager.activeStack ? Cura.MachineManager.activeQualityOrQualityChangesName + " " + layerHeight.properties.value + "mm" : ""
UM.SettingPropertyProvider
{
id: layerHeight
containerStackId: Cura.MachineManager.activeStackId
containerStack: Cura.MachineManager.activeStack
key: "layer_height"
watchedProperties: ["value"]
}
@ -68,12 +68,12 @@ Cura.ExpandableComponent
IconWithText
{
source: UM.Theme.getIcon("category_infill")
text: parseInt(infillDensity.properties.value) + "%"
text: Cura.MachineManager.activeStack ? parseInt(infillDensity.properties.value) + "%" : "0%"
UM.SettingPropertyProvider
{
id: infillDensity
containerStackId: Cura.MachineManager.activeStackId
containerStack: Cura.MachineManager.activeStack
key: "infill_sparse_density"
watchedProperties: ["value"]
}