CURA-4561 prepare button upgrades

This commit is contained in:
Jack Ha 2017-11-23 15:27:22 +01:00
parent 5703f954d4
commit b6410ecf12

View File

@ -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 {