mirror of
https://git.mirrors.martin98.com/https://github.com/Ultimaker/Cura
synced 2025-08-13 03:09:04 +08:00
Add confirmation dialogue for deleting jobs
Re-using MessageDialog again. Contributes to issues CL-1053 and CURA-5729.
This commit is contained in:
parent
83528ffb48
commit
3a096cdb23
@ -245,8 +245,8 @@ Item
|
|||||||
text: catalog.i18nc("@label", "Delete")
|
text: catalog.i18nc("@label", "Delete")
|
||||||
onClicked:
|
onClicked:
|
||||||
{
|
{
|
||||||
OutputDevice.deleteJobFromQueue(printJob.key)
|
deleteConfirmationDialog.visible = true;
|
||||||
popup.close()
|
popup.close();
|
||||||
}
|
}
|
||||||
width: parent.width
|
width: parent.width
|
||||||
anchors.top: sendToTopButton.bottom
|
anchors.top: sendToTopButton.bottom
|
||||||
@ -257,6 +257,17 @@ Item
|
|||||||
color: UM.Theme.getColor("viewport_background")
|
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
|
background: Item
|
||||||
|
Loading…
x
Reference in New Issue
Block a user