mirror of
https://git.mirrors.martin98.com/https://github.com/Ultimaker/Cura
synced 2025-08-13 08:58:59 +08:00
CURA-4561 prepare button upgrades
This commit is contained in:
parent
5703f954d4
commit
b6410ecf12
@ -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 {
|
||||
|
Loading…
x
Reference in New Issue
Block a user