From 3a096cdb23c3d6c5bd65d9f8cedf9338d5318487 Mon Sep 17 00:00:00 2001 From: Ghostkeeper Date: Tue, 18 Sep 2018 11:42:34 +0200 Subject: [PATCH] Add confirmation dialogue for deleting jobs Re-using MessageDialog again. Contributes to issues CL-1053 and CURA-5729. --- .../resources/qml/PrintJobInfoBlock.qml | 15 +++++++++++++-- 1 file changed, 13 insertions(+), 2 deletions(-) diff --git a/plugins/UM3NetworkPrinting/resources/qml/PrintJobInfoBlock.qml b/plugins/UM3NetworkPrinting/resources/qml/PrintJobInfoBlock.qml index be1874ff91..dd8eb27fca 100644 --- a/plugins/UM3NetworkPrinting/resources/qml/PrintJobInfoBlock.qml +++ b/plugins/UM3NetworkPrinting/resources/qml/PrintJobInfoBlock.qml @@ -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