mirror of
https://git.mirrors.martin98.com/https://github.com/Ultimaker/Cura
synced 2025-08-15 16:25:55 +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 {
|
Label {
|
||||||
id: statusLabel
|
id: statusLabel
|
||||||
width: parent.width - 2 * UM.Theme.getSize("sidebar_margin").width
|
width: parent.width - 2 * UM.Theme.getSize("sidebar_margin").width
|
||||||
@ -86,6 +94,10 @@ Item {
|
|||||||
if (saveToButton.enabled) {
|
if (saveToButton.enabled) {
|
||||||
saveToButton.clicked();
|
saveToButton.clicked();
|
||||||
}
|
}
|
||||||
|
// prepare button
|
||||||
|
if (prepareButton.enabled) {
|
||||||
|
sliceOrStopSlicing();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -145,7 +157,7 @@ Item {
|
|||||||
Button {
|
Button {
|
||||||
id: prepareButton
|
id: prepareButton
|
||||||
|
|
||||||
tooltip: UM.OutputDeviceManager.activeDeviceDescription;
|
tooltip: catalog.i18nc("@info:tooltip","Slice");
|
||||||
// 1 = not started, 2 = Processing
|
// 1 = not started, 2 = Processing
|
||||||
enabled: (base.backendState == 1 || base.backendState == 2) && base.activity == true
|
enabled: (base.backendState == 1 || base.backendState == 2) && base.activity == true
|
||||||
visible: {
|
visible: {
|
||||||
@ -162,11 +174,7 @@ Item {
|
|||||||
text: [1, 5].indexOf(UM.Backend.state) != -1 ? catalog.i18nc("@label:Printjob", "Prepare") : catalog.i18nc("@label:Printjob", "Cancel")
|
text: [1, 5].indexOf(UM.Backend.state) != -1 ? catalog.i18nc("@label:Printjob", "Prepare") : catalog.i18nc("@label:Printjob", "Cancel")
|
||||||
onClicked:
|
onClicked:
|
||||||
{
|
{
|
||||||
if ([1, 5].indexOf(UM.Backend.state) != -1) {
|
sliceOrStopSlicing();
|
||||||
backend.forceSlice();
|
|
||||||
} else {
|
|
||||||
backend.stopSlicing();
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
style: ButtonStyle {
|
style: ButtonStyle {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user