diff --git a/plugins/CuraDrive/src/qml/components/BackupListItem.qml b/plugins/CuraDrive/src/qml/components/BackupListItem.qml index ced85d53bd..41e3fb0bf6 100644 --- a/plugins/CuraDrive/src/qml/components/BackupListItem.qml +++ b/plugins/CuraDrive/src/qml/components/BackupListItem.qml @@ -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) } } diff --git a/plugins/UM3NetworkPrinting/resources/qml/DiscoverUM3Action.qml b/plugins/UM3NetworkPrinting/resources/qml/DiscoverUM3Action.qml index 30d3db0715..9c06388f4b 100644 --- a/plugins/UM3NetworkPrinting/resources/qml/DiscoverUM3Action.qml +++ b/plugins/UM3NetworkPrinting/resources/qml/DiscoverUM3Action.qml @@ -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 diff --git a/plugins/UM3NetworkPrinting/resources/qml/MonitorContextMenu.qml b/plugins/UM3NetworkPrinting/resources/qml/MonitorContextMenu.qml index 34ca3c6df2..d95ca8a88e 100644 --- a/plugins/UM3NetworkPrinting/resources/qml/MonitorContextMenu.qml +++ b/plugins/UM3NetworkPrinting/resources/qml/MonitorContextMenu.qml @@ -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") } diff --git a/resources/qml/MainWindow/ApplicationMenu.qml b/resources/qml/MainWindow/ApplicationMenu.qml index 269f918ad2..81cf25faa6 100644 --- a/resources/qml/MainWindow/ApplicationMenu.qml +++ b/resources/qml/MainWindow/ApplicationMenu.qml @@ -1,4 +1,4 @@ -// Copyright (c) 2021 Ultimaker B.V. +// Copyright (c) 2022 Ultimaker B.V. // Cura is released under the terms of the LGPLv3 or higher. import QtQuick 2.7 @@ -61,15 +61,15 @@ Item onYes: UM.OutputDeviceManager.requestWriteToDevice("local_file", PrintInformation.jobName, args) } - MessageDialog + UM.MessageDialog { id: newProjectDialog - modality: Qt.ApplicationModal + anchors.centerIn: base + title: catalog.i18nc("@title:window", "New project") text: catalog.i18nc("@info:question", "Are you sure you want to start a new project? This will clear the build plate and any unsaved settings.") - standardButtons: StandardButton.Yes | StandardButton.No - icon: StandardIcon.Question - onYes: + standardButtons: Dialog.Yes | Dialog.No + onAccepted: { CuraApplication.resetWorkspace() Cura.Actions.resetProfile.trigger() diff --git a/resources/qml/MonitorButton.qml b/resources/qml/MonitorButton.qml index db10b2b2bc..02c8c18f7a 100644 --- a/resources/qml/MonitorButton.qml +++ b/resources/qml/MonitorButton.qml @@ -1,4 +1,4 @@ -//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.2 @@ -7,7 +7,7 @@ import QtQuick.Controls.Styles 1.1 import QtQuick.Dialogs 1.1 import QtQuick.Layouts 1.1 -import UM 1.1 as UM +import UM 1.5 as UM import Cura 1.0 as Cura Item @@ -325,16 +325,14 @@ Item onClicked: confirmationDialog.visible = true } - MessageDialog + UM.MessageDialog { id: confirmationDialog title: catalog.i18nc("@window:title", "Abort print") - icon: StandardIcon.Warning text: catalog.i18nc("@label", "Are you sure you want to abort the print?") - standardButtons: StandardButton.Yes | StandardButton.No - Component.onCompleted: visible = false - onYes: activePrintJob.setState("abort") + standardButtons: Dialog.Yes | Dialog.No + onAccepted: activePrintJob.setState("abort") } } } diff --git a/resources/qml/Preferences/Materials/MaterialsView.qml b/resources/qml/Preferences/Materials/MaterialsView.qml index d1ea251ab8..39997659e1 100644 --- a/resources/qml/Preferences/Materials/MaterialsView.qml +++ b/resources/qml/Preferences/Materials/MaterialsView.qml @@ -119,21 +119,20 @@ Item width: base.width property real rowHeight: brandTextField.height + UM.Theme.getSize("default_lining").height - MessageDialog + UM.MessageDialog { id: confirmDiameterChangeDialog + anchors.centerIn: base - icon: StandardIcon.Question; title: catalog.i18nc("@title:window", "Confirm Diameter Change") text: catalog.i18nc("@label (%1 is a number)", "The new filament diameter is set to %1 mm, which is not compatible with the current extruder. Do you wish to continue?".arg(new_diameter_value)) - standardButtons: StandardButton.Yes | StandardButton.No - modality: Qt.ApplicationModal + standardButtons: Dialog.Yes | Dialog.No property var new_diameter_value: null; property var old_diameter_value: null; property var old_approximate_diameter_value: null; - onYes: + onAccepted: { base.setMetaDataEntry("approximate_diameter", old_approximate_diameter_value, getApproximateDiameter(new_diameter_value).toString()); base.setMetaDataEntry("properties/diameter", properties.diameter, new_diameter_value); @@ -142,13 +141,11 @@ Item base.resetSelectedMaterial() } - onNo: + onRejected: { base.properties.diameter = old_diameter_value; diameterSpinBox.value = Qt.binding(function() { return base.properties.diameter }) } - - onRejected: no() } Label { width: informationPage.columnWidth; height: parent.rowHeight; verticalAlignment: Qt.AlignVCenter; text: catalog.i18nc("@label", "Display Name") } diff --git a/resources/qml/Preferences/ProfilesPage.qml b/resources/qml/Preferences/ProfilesPage.qml index cf380b33cd..fb186dabf1 100644 --- a/resources/qml/Preferences/ProfilesPage.qml +++ b/resources/qml/Preferences/ProfilesPage.qml @@ -269,7 +269,7 @@ Item } // Confirmation dialog for removing a profile - MessageDialog + UM.MessageDialog { id: confirmRemoveQualityDialog