Added confirmation message for starting new project

CURA-3494
This commit is contained in:
Jaime van Kessel 2017-03-10 14:10:24 +01:00
parent 66afc2a391
commit 1d7bf51152

View file

@ -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
}
}
}