From 8ae0c695bd7944f6e647b9a5d01889eb7fb66a2f Mon Sep 17 00:00:00 2001 From: Jaime van Kessel Date: Tue, 2 Apr 2019 11:09:12 +0200 Subject: [PATCH] Add total cost to the output overview. This fixes #5529 --- resources/qml/ActionPanel/OutputProcessWidget.qml | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/resources/qml/ActionPanel/OutputProcessWidget.qml b/resources/qml/ActionPanel/OutputProcessWidget.qml index f4505c620c..7e76768cb4 100644 --- a/resources/qml/ActionPanel/OutputProcessWidget.qml +++ b/resources/qml/ActionPanel/OutputProcessWidget.qml @@ -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")