From b6410ecf125021138af4a1126550d260f19327bb Mon Sep 17 00:00:00 2001 From: Jack Ha Date: Thu, 23 Nov 2017 15:27:22 +0100 Subject: [PATCH] CURA-4561 prepare button upgrades --- resources/qml/SaveButton.qml | 20 ++++++++++++++------ 1 file changed, 14 insertions(+), 6 deletions(-) diff --git a/resources/qml/SaveButton.qml b/resources/qml/SaveButton.qml index e2890a6b49..3237dd9ade 100644 --- a/resources/qml/SaveButton.qml +++ b/resources/qml/SaveButton.qml @@ -45,6 +45,14 @@ Item { } } + function sliceOrStopSlicing() { + if ([1, 5].indexOf(UM.Backend.state) != -1) { + backend.forceSlice(); + } else { + backend.stopSlicing(); + } + } + Label { id: statusLabel width: parent.width - 2 * UM.Theme.getSize("sidebar_margin").width @@ -86,6 +94,10 @@ Item { if (saveToButton.enabled) { saveToButton.clicked(); } + // prepare button + if (prepareButton.enabled) { + sliceOrStopSlicing(); + } } } @@ -145,7 +157,7 @@ Item { Button { id: prepareButton - tooltip: UM.OutputDeviceManager.activeDeviceDescription; + tooltip: catalog.i18nc("@info:tooltip","Slice"); // 1 = not started, 2 = Processing enabled: (base.backendState == 1 || base.backendState == 2) && base.activity == true visible: { @@ -162,11 +174,7 @@ Item { text: [1, 5].indexOf(UM.Backend.state) != -1 ? catalog.i18nc("@label:Printjob", "Prepare") : catalog.i18nc("@label:Printjob", "Cancel") onClicked: { - if ([1, 5].indexOf(UM.Backend.state) != -1) { - backend.forceSlice(); - } else { - backend.stopSlicing(); - } + sliceOrStopSlicing(); } style: ButtonStyle {