|
@@ -27,15 +27,21 @@ Column
|
|
|
|
|
|
property real progress: UM.Backend.progress
|
|
|
property int backendState: UM.Backend.state
|
|
|
+ // As the collection of settings to send to the engine might take some time, we have an extra value to indicate
|
|
|
+ // That the user pressed the button but it's still waiting for the backend to acknowledge that it got it.
|
|
|
+ property bool waitingForSliceToStart: false
|
|
|
+ onBackendStateChanged: waitingForSliceToStart = false
|
|
|
|
|
|
function sliceOrStopSlicing()
|
|
|
{
|
|
|
if (widget.backendState == UM.Backend.NotStarted)
|
|
|
{
|
|
|
+ widget.waitingForSliceToStart = true
|
|
|
CuraApplication.backend.forceSlice()
|
|
|
}
|
|
|
else
|
|
|
{
|
|
|
+ widget.waitingForSliceToStart = false
|
|
|
CuraApplication.backend.stopSlicing()
|
|
|
}
|
|
|
}
|
|
@@ -94,9 +100,9 @@ Column
|
|
|
anchors.right: parent.right
|
|
|
anchors.left: parent.left
|
|
|
|
|
|
- text: catalog.i18nc("@button", "Slice")
|
|
|
+ text: widget.waitingForSliceToStart ? catalog.i18nc("@button", "Processing"): catalog.i18nc("@button", "Slice")
|
|
|
tooltip: catalog.i18nc("@label", "Start the slicing process")
|
|
|
- enabled: widget.backendState != UM.Backend.Error
|
|
|
+ enabled: widget.backendState != UM.Backend.Error && !widget.waitingForSliceToStart
|
|
|
visible: widget.backendState == UM.Backend.NotStarted || widget.backendState == UM.Backend.Error
|
|
|
onClicked: sliceOrStopSlicing()
|
|
|
}
|