Merge branch 'master' into WIP_onboarding

This commit is contained in:
Ghostkeeper 2019-04-03 11:53:40 +02:00
commit ae9395aebb
No known key found for this signature in database
GPG key ID: 86BEF881AE2CF276
13 changed files with 69 additions and 104 deletions

View file

@ -68,6 +68,7 @@ Column
property var printMaterialLengths: PrintInformation.materialLengths
property var printMaterialWeights: PrintInformation.materialWeights
property var printMaterialCosts: PrintInformation.materialCosts
text:
{
@ -77,6 +78,7 @@ Column
}
var totalLengths = 0
var totalWeights = 0
var totalCosts = 0.0
if (printMaterialLengths)
{
for(var index = 0; index < printMaterialLengths.length; index++)
@ -85,9 +87,16 @@ Column
{
totalLengths += printMaterialLengths[index]
totalWeights += Math.round(printMaterialWeights[index])
var cost = printMaterialCosts[index] == undefined ? 0.0 : printMaterialCosts[index]
totalCosts += cost
}
}
}
if(totalCosts > 0)
{
var costString = "%1 %2".arg(UM.Preferences.getValue("cura/currency")).arg(totalCosts.toFixed(2))
return totalWeights + "g · " + totalLengths.toFixed(2) + "m · " + costString
}
return totalWeights + "g · " + totalLengths.toFixed(2) + "m"
}
source: UM.Theme.getIcon("spool")