mirror of
https://github.com/Ultimaker/Cura.git
synced 2025-08-06 05:23:58 -06:00
Directly show feedback when pressing the slice button
CURA-6034
This commit is contained in:
parent
07ff08f6bb
commit
27f60a6d5d
1 changed files with 8 additions and 2 deletions
|
@ -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()
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue