From 83528ffb488f96bb0be7385f8a55f08fe1f54f2f Mon Sep 17 00:00:00 2001 From: Ghostkeeper Date: Tue, 18 Sep 2018 11:41:51 +0200 Subject: [PATCH] Add confirmation dialogue for sending prints to top of queue Very simple. Just re-use the MessageDialog component. Contributes to issues CL-1053 and CURA-5729. --- .../resources/qml/PrintJobInfoBlock.qml | 16 ++++++++++++++-- 1 file changed, 14 insertions(+), 2 deletions(-) diff --git a/plugins/UM3NetworkPrinting/resources/qml/PrintJobInfoBlock.qml b/plugins/UM3NetworkPrinting/resources/qml/PrintJobInfoBlock.qml index f39b430e19..be1874ff91 100644 --- a/plugins/UM3NetworkPrinting/resources/qml/PrintJobInfoBlock.qml +++ b/plugins/UM3NetworkPrinting/resources/qml/PrintJobInfoBlock.qml @@ -1,4 +1,5 @@ import QtQuick 2.2 +import QtQuick.Dialogs 1.1 import QtQuick.Controls 2.0 import QtQuick.Controls.Styles 1.4 import QtGraphicalEffects 1.0 @@ -212,8 +213,8 @@ Item text: catalog.i18nc("@label", "Move to top") onClicked: { - OutputDevice.sendJobToTop(printJob.key) - popup.close() + sendToTopConfirmationDialog.visible = true; + popup.close(); } width: parent.width enabled: OutputDevice.queuedPrintJobs[0].key != printJob.key @@ -227,6 +228,17 @@ Item } } + MessageDialog + { + id: sendToTopConfirmationDialog + title: catalog.i18nc("@window:title", "Move print job to top") + icon: StandardIcon.Warning + text: catalog.i18nc("@label %1 is the name of a print job.", "Are you sure you want to move %1 to the top of the queue?").arg(printJob.name) + standardButtons: StandardButton.Yes | StandardButton.No + Component.onCompleted: visible = false + onYes: OutputDevice.sendJobToTop(printJob.key) + } + Button { id: deleteButton