mirror of
https://github.com/alicevision/Meshroom.git
synced 2025-08-06 10:18:42 +02:00
[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:
parent
494cb71d3f
commit
0bcf59e4ce
1 changed files with 24 additions and 3 deletions
|
@ -77,8 +77,8 @@ ApplicationWindow {
|
||||||
canCopy: false
|
canCopy: false
|
||||||
text: _reconstruction.graph.filepath ? "Current project has unsaved modifications."
|
text: _reconstruction.graph.filepath ? "Current project has unsaved modifications."
|
||||||
: "Current project has not been saved."
|
: "Current project has not been saved."
|
||||||
helperText: _reconstruction.graph.filepath ? "Would you like to save those changes ?"
|
helperText: _reconstruction.graph.filepath ? "Would you like to save those changes?"
|
||||||
: "Would you like to save this project ?"
|
: "Would you like to save this project?"
|
||||||
|
|
||||||
standardButtons: Dialog.Save | Dialog.Cancel | Dialog.Discard
|
standardButtons: Dialog.Save | Dialog.Cancel | Dialog.Discard
|
||||||
|
|
||||||
|
@ -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"
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue