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.
This commit is contained in:
Ghostkeeper 2018-09-18 11:41:51 +02:00
parent ac4ee8c428
commit 83528ffb48
No known key found for this signature in database
GPG key ID: 5252B696FB5E7C7A

View file

@ -1,4 +1,5 @@
import QtQuick 2.2 import QtQuick 2.2
import QtQuick.Dialogs 1.1
import QtQuick.Controls 2.0 import QtQuick.Controls 2.0
import QtQuick.Controls.Styles 1.4 import QtQuick.Controls.Styles 1.4
import QtGraphicalEffects 1.0 import QtGraphicalEffects 1.0
@ -212,8 +213,8 @@ Item
text: catalog.i18nc("@label", "Move to top") text: catalog.i18nc("@label", "Move to top")
onClicked: onClicked:
{ {
OutputDevice.sendJobToTop(printJob.key) sendToTopConfirmationDialog.visible = true;
popup.close() popup.close();
} }
width: parent.width width: parent.width
enabled: OutputDevice.queuedPrintJobs[0].key != printJob.key 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 Button
{ {
id: deleteButton id: deleteButton