mirror of
https://github.com/Ultimaker/Cura.git
synced 2025-11-02 20:52:20 -07:00
Add extra checks to ensure backend exists, use same state everywhere
This commit is contained in:
parent
19e459d930
commit
ca413e0496
1 changed files with 8 additions and 6 deletions
|
|
@ -49,10 +49,12 @@ Item {
|
||||||
}
|
}
|
||||||
|
|
||||||
function sliceOrStopSlicing() {
|
function sliceOrStopSlicing() {
|
||||||
if (backend != "undefined" && [1, 5].indexOf(UM.Backend.state) != -1) {
|
if (base.backendState != "undefined" && backend !== "undefined") {
|
||||||
backend.forceSlice();
|
if ([1, 5].indexOf(base.backendState) != -1) {
|
||||||
} else {
|
backend.forceSlice();
|
||||||
backend.stopSlicing();
|
} else {
|
||||||
|
backend.stopSlicing();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -165,7 +167,7 @@ Item {
|
||||||
Button {
|
Button {
|
||||||
id: prepareButton
|
id: prepareButton
|
||||||
|
|
||||||
tooltip: [1, 5].indexOf(UM.Backend.state) != -1 ? catalog.i18nc("@info:tooltip","Slice current printjob") : catalog.i18nc("@info:tooltip","Cancel slicing process")
|
tooltip: [1, 5].indexOf(base.backendState) != -1 ? catalog.i18nc("@info:tooltip","Slice current printjob") : catalog.i18nc("@info:tooltip","Cancel slicing process")
|
||||||
// 1 = not started, 2 = Processing
|
// 1 = not started, 2 = Processing
|
||||||
enabled: base.backendState != "undefined" && (base.backendState == 1 || base.backendState == 2) && base.activity == true
|
enabled: base.backendState != "undefined" && (base.backendState == 1 || base.backendState == 2) && base.activity == true
|
||||||
visible: base.backendState != "undefined" && !autoSlice && (base.backendState == 1 || base.backendState == 2) && base.activity == true
|
visible: base.backendState != "undefined" && !autoSlice && (base.backendState == 1 || base.backendState == 2) && base.activity == true
|
||||||
|
|
@ -177,7 +179,7 @@ Item {
|
||||||
anchors.rightMargin: UM.Theme.getSize("sidebar_margin").width
|
anchors.rightMargin: UM.Theme.getSize("sidebar_margin").width
|
||||||
|
|
||||||
// 1 = not started, 5 = disabled
|
// 1 = not started, 5 = disabled
|
||||||
text: [1, 5].indexOf(UM.Backend.state) != -1 ? catalog.i18nc("@label:Printjob", "Prepare") : catalog.i18nc("@label:Printjob", "Cancel")
|
text: [1, 5].indexOf(base.backendState) != -1 ? catalog.i18nc("@label:Printjob", "Prepare") : catalog.i18nc("@label:Printjob", "Cancel")
|
||||||
onClicked:
|
onClicked:
|
||||||
{
|
{
|
||||||
sliceOrStopSlicing();
|
sliceOrStopSlicing();
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue