From 1d7bf5115226400326e3c14fbc3753ba6bcdbb41 Mon Sep 17 00:00:00 2001 From: Jaime van Kessel Date: Fri, 10 Mar 2017 14:10:24 +0100 Subject: [PATCH] Added confirmation message for starting new project CURA-3494 --- resources/qml/Cura.qml | 22 ++++++++++++++++++++-- 1 file changed, 20 insertions(+), 2 deletions(-) diff --git a/resources/qml/Cura.qml b/resources/qml/Cura.qml index e8c06f4e9a..9949e9ab0b 100755 --- a/resources/qml/Cura.qml +++ b/resources/qml/Cura.qml @@ -537,13 +537,31 @@ UM.MainWindow target: Cura.Actions.preferences onTriggered: preferences.visible = true } + + MessageDialog + { + id: newProjectDialog + modality: Qt.ApplicationModal + 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: + { + Printer.deleteAll(); + Cura.Actions.resetProfile.trigger(); + } + } + Connections { target: Cura.Actions.newProject onTriggered: { - Printer.deleteAll(); - Cura.Actions.resetProfile.trigger(); + if(Printer.platformActivity || Cura.MachineManager.hasUserSettings) + { + newProjectDialog.visible = true + } } }