mirror of
https://github.com/Ultimaker/Cura.git
synced 2025-08-07 05:53:59 -06:00
Merge pull request #4385 from Ultimaker/monitor_confirmation_dialogues
Add confirmation dialogues before making destructive changes in UM3/S5 monitor
This commit is contained in:
commit
7ad6fc4cad
3 changed files with 47 additions and 12 deletions
|
@ -1,4 +1,5 @@
|
|||
import QtQuick 2.3
|
||||
import QtQuick.Dialogs 1.1
|
||||
import QtQuick.Controls 1.4
|
||||
import QtQuick.Controls.Styles 1.3
|
||||
import QtGraphicalEffects 1.0
|
||||
|
@ -443,8 +444,8 @@ Component
|
|||
text: catalog.i18nc("@label", "Abort")
|
||||
onClicked:
|
||||
{
|
||||
modelData.activePrintJob.setState("abort")
|
||||
popup.close()
|
||||
abortConfirmationDialog.visible = true;
|
||||
popup.close();
|
||||
}
|
||||
width: parent.width
|
||||
anchors.top: pauseButton.bottom
|
||||
|
@ -456,6 +457,17 @@ Component
|
|||
color: UM.Theme.getColor("viewport_background")
|
||||
}
|
||||
}
|
||||
|
||||
MessageDialog
|
||||
{
|
||||
id: abortConfirmationDialog
|
||||
title: catalog.i18nc("@window:title", "Abort print")
|
||||
icon: StandardIcon.Warning
|
||||
text: catalog.i18nc("@label %1 is the name of a print job.", "Are you sure you want to abort %1?").arg(modelData.activePrintJob.name)
|
||||
standardButtons: StandardButton.Yes | StandardButton.No
|
||||
Component.onCompleted: visible = false
|
||||
onYes: modelData.activePrintJob.setState("abort")
|
||||
}
|
||||
}
|
||||
|
||||
background: Item
|
||||
|
|
|
@ -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,14 +228,25 @@ 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
|
||||
text: catalog.i18nc("@label", "Delete")
|
||||
onClicked:
|
||||
{
|
||||
OutputDevice.deleteJobFromQueue(printJob.key)
|
||||
popup.close()
|
||||
deleteConfirmationDialog.visible = true;
|
||||
popup.close();
|
||||
}
|
||||
width: parent.width
|
||||
anchors.top: sendToTopButton.bottom
|
||||
|
@ -245,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
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue