[ui] prompt warning when computing unsaved project

* warn the user that the data will be computed in the default cache folder
* allow to save the scene from this Dialog
* fix whitespaces in texts
This commit is contained in:
Yann Lanthony 2018-08-03 14:29:35 +02:00
parent 494cb71d3f
commit 0bcf59e4ce

View file

@ -140,6 +140,22 @@ ApplicationWindow {
onRejected: closed(Platform.Dialog.Rejected) onRejected: closed(Platform.Dialog.Rejected)
} }
MessageDialog {
id: unsavedComputeDialog
canCopy: false
icon.text: MaterialIcons.warning
preset: "Warning"
title: "Unsaved Project"
text: "Data will be computed in the default cache folder if project remains unsaved."
detailedText: "Default cache folder: " + _reconstruction.graph.cacheDir
helperText: "Save project first?"
standardButtons: Dialog.Discard | Dialog.Cancel | Dialog.Save
onDiscarded: { close(); _reconstruction.execute(null) }
onAccepted: saveAsAction.trigger()
}
Platform.FileDialog { Platform.FileDialog {
id: openFileDialog id: openFileDialog
title: "Open File" title: "Open File"
@ -427,7 +443,12 @@ ApplicationWindow {
palette.window: enabled ? buttonColor : disabledPalette.window palette.window: enabled ? buttonColor : disabledPalette.window
palette.buttonText: enabled ? "white" : disabledPalette.buttonText palette.buttonText: enabled ? "white" : disabledPalette.buttonText
enabled: parent.canStartComputation enabled: parent.canStartComputation
onClicked: _reconstruction.execute(null) onClicked: {
if(!_reconstruction.graph.filepath)
unsavedComputeDialog.open()
else
_reconstruction.execute(null)
}
} }
Button { Button {
text: "Stop" text: "Stop"