mirror of
https://git.mirrors.martin98.com/https://github.com/Ultimaker/Cura
synced 2025-08-12 21:38:58 +08:00
Catch situations where backend is not correctly set
This commit is contained in:
parent
c056fcb23d
commit
47e5303a89
@ -14,7 +14,7 @@ Item {
|
|||||||
|
|
||||||
property real progress: UM.Backend.progress
|
property real progress: UM.Backend.progress
|
||||||
property int backendState: UM.Backend.state
|
property int backendState: UM.Backend.state
|
||||||
property var backend: CuraApplication.getBackend()
|
property var backend: CuraApplication.getBackend() || "undefined"
|
||||||
property bool activity: CuraApplication.platformActivity
|
property bool activity: CuraApplication.platformActivity
|
||||||
|
|
||||||
property alias buttonRowWidth: saveRow.width
|
property alias buttonRowWidth: saveRow.width
|
||||||
@ -49,12 +49,16 @@ Item {
|
|||||||
}
|
}
|
||||||
|
|
||||||
function sliceOrStopSlicing() {
|
function sliceOrStopSlicing() {
|
||||||
if (base.backendState != "undefined" && backend !== "undefined") {
|
try {
|
||||||
if ([1, 5].indexOf(base.backendState) != -1) {
|
if (base.backendState != "undefined" && base.backend != "undefined") {
|
||||||
backend.forceSlice();
|
if ([1, 5].indexOf(base.backendState) != -1) {
|
||||||
} else {
|
backend.forceSlice();
|
||||||
backend.stopSlicing();
|
} else {
|
||||||
|
backend.stopSlicing();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
} catch (e) {
|
||||||
|
console.log('Could not start or stop slicing', e)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user