mirror of
https://git.mirrors.martin98.com/https://github.com/Ultimaker/Cura
synced 2025-08-12 06:19:05 +08:00
Added confirmation message for starting new project
CURA-3494
This commit is contained in:
parent
66afc2a391
commit
1d7bf51152
@ -537,13 +537,31 @@ UM.MainWindow
|
|||||||
target: Cura.Actions.preferences
|
target: Cura.Actions.preferences
|
||||||
onTriggered: preferences.visible = true
|
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
|
Connections
|
||||||
{
|
{
|
||||||
target: Cura.Actions.newProject
|
target: Cura.Actions.newProject
|
||||||
onTriggered:
|
onTriggered:
|
||||||
{
|
{
|
||||||
Printer.deleteAll();
|
if(Printer.platformActivity || Cura.MachineManager.hasUserSettings)
|
||||||
Cura.Actions.resetProfile.trigger();
|
{
|
||||||
|
newProjectDialog.visible = true
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user