Change remaining MessageDialogs to our version

Contributes to issue CURA-8687.
This commit is contained in:
Ghostkeeper 2022-02-04 15:49:06 +01:00
parent a03988d146
commit 2606a3b847
No known key found for this signature in database
GPG key ID: D2A8871EE34EC59A
7 changed files with 41 additions and 55 deletions

View file

@ -1,10 +1,9 @@
// Copyright (c) 2018 Ultimaker B.V.
// Copyright (c) 2022 Ultimaker B.V.
// Cura is released under the terms of the LGPLv3 or higher.
import QtQuick 2.7
import QtQuick.Controls 2.1
import QtQuick.Layouts 1.3
import QtQuick.Dialogs 1.1
import UM 1.5 as UM
import Cura 1.0 as Cura
@ -88,21 +87,21 @@ Item
anchors.top: dataRow.bottom
}
MessageDialog
UM.MessageDialog
{
id: confirmDeleteDialog
title: catalog.i18nc("@dialog:title", "Delete Backup")
text: catalog.i18nc("@dialog:info", "Are you sure you want to delete this backup? This cannot be undone.")
standardButtons: StandardButton.Yes | StandardButton.No
onYes: CuraDrive.deleteBackup(modelData.backup_id)
standardButtons: Dialog.Yes | Dialog.No
onAccepted: CuraDrive.deleteBackup(modelData.backup_id)
}
MessageDialog
UM.MessageDialog
{
id: confirmRestoreDialog
title: catalog.i18nc("@dialog:title", "Restore Backup")
text: catalog.i18nc("@dialog:info", "You will need to restart Cura before your backup is restored. Do you want to close Cura now?")
standardButtons: StandardButton.Yes | StandardButton.No
onYes: CuraDrive.restoreBackup(modelData.backup_id)
standardButtons: Dialog.Yes | Dialog.No
onAccepted: CuraDrive.restoreBackup(modelData.backup_id)
}
}

View file

@ -8,7 +8,6 @@ import QtQuick 2.2
import QtQuick.Controls 2.9
import QtQuick.Layouts 1.1
import QtQuick.Window 2.1
import QtQuick.Dialogs 1.2
Cura.MachineAction
{
@ -281,15 +280,12 @@ Cura.MachineAction
}
}
MessageDialog
UM.MessageDialog
{
id: invalidIPAddressMessageDialog
x: parent ? (parent.x + (parent.width) / 2) : 0
y: parent ? (parent.y + (parent.height) / 2) : 0
title: catalog.i18nc("@title:window", "Invalid IP address")
text: catalog.i18nc("@text", "Please enter a valid IP address.")
icon: StandardIcon.Warning
standardButtons: StandardButton.Ok
standardButtons: Dialog.Ok
}
UM.Dialog

View file

@ -1,10 +1,9 @@
// Copyright (c) 2019 Ultimaker B.V.
// Copyright (c) 2022 Ultimaker B.V.
// Cura is released under the terms of the LGPLv3 or higher.
import QtQuick 2.3
import QtQuick.Controls 2.0
import QtQuick.Dialogs 1.1
import UM 1.3 as UM
import QtQuick.Controls 2.15
import UM 1.5 as UM
/**
* A MonitorInfoBlurb is an extension of the GenericPopUp used to show static information (vs. interactive context
@ -134,32 +133,29 @@ Item
}
}
MessageDialog {
UM.MessageDialog
{
id: sendToTopConfirmationDialog
Component.onCompleted: visible = false
icon: StandardIcon.Warning
onYes: OutputDevice.sendJobToTop(printJob.key)
standardButtons: StandardButton.Yes | StandardButton.No
onAccepted: OutputDevice.sendJobToTop(printJob.key)
standardButtons: Dialog.Yes | Dialog.No
text: printJob && printJob.name ? 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) : ""
title: catalog.i18nc("@window:title", "Move print job to top")
}
MessageDialog {
UM.MessageDialog
{
id: deleteConfirmationDialog
Component.onCompleted: visible = false
icon: StandardIcon.Warning
onYes: OutputDevice.deleteJobFromQueue(printJob.key)
standardButtons: StandardButton.Yes | StandardButton.No
onAccepted: OutputDevice.deleteJobFromQueue(printJob.key)
standardButtons: Dialog.Yes | Dialog.No
text: printJob && printJob.name ? catalog.i18nc("@label %1 is the name of a print job.", "Are you sure you want to delete %1?").arg(printJob.name) : ""
title: catalog.i18nc("@window:title", "Delete print job")
}
MessageDialog {
UM.MessageDialog
{
id: abortConfirmationDialog
Component.onCompleted: visible = false
icon: StandardIcon.Warning
onYes: printJob.setState("abort")
standardButtons: StandardButton.Yes | StandardButton.No
onAccepted: printJob.setState("abort")
standardButtons: Dialog.Yes | Dialog.No
text: printJob && printJob.name ? catalog.i18nc("@label %1 is the name of a print job.", "Are you sure you want to abort %1?").arg(printJob.name) : ""
title: catalog.i18nc("@window:title", "Abort print")
}