Add confirmation dialogue for deleting jobs

Re-using MessageDialog again.

Contributes to issues CL-1053 and CURA-5729.
This commit is contained in:
Ghostkeeper 2018-09-18 11:42:34 +02:00
parent 83528ffb48
commit 3a096cdb23
No known key found for this signature in database
GPG key ID: 5252B696FB5E7C7A

View file

@ -245,8 +245,8 @@ Item
text: catalog.i18nc("@label", "Delete")
onClicked:
{
OutputDevice.deleteJobFromQueue(printJob.key)
popup.close()
deleteConfirmationDialog.visible = true;
popup.close();
}
width: parent.width
anchors.top: sendToTopButton.bottom
@ -257,6 +257,17 @@ Item
color: UM.Theme.getColor("viewport_background")
}
}
MessageDialog
{
id: deleteConfirmationDialog
title: catalog.i18nc("@window:title", "Delete print job")
icon: StandardIcon.Warning
text: catalog.i18nc("@label %1 is the name of a print job.", "Are you sure you want to delete %1?").arg(printJob.name)
standardButtons: StandardButton.Yes | StandardButton.No
Component.onCompleted: visible = false
onYes: OutputDevice.deleteJobFromQueue(printJob.key)
}
}
background: Item