Skip to content

Commit

Permalink
Merge pull request #1927 from alicevision/fix/submitPopUp
Browse files Browse the repository at this point in the history
[ui] Prompt a warning dialog when attempting to submit an unsaved project
  • Loading branch information
fabiencastan authored Mar 10, 2023
2 parents 7b01a0e + 16dfe96 commit 6421c03
Showing 1 changed file with 27 additions and 7 deletions.
34 changes: 27 additions & 7 deletions meshroom/ui/qml/main.qml
Original file line number Diff line number Diff line change
Expand Up @@ -217,13 +217,17 @@ ApplicationWindow {
}

function submit(node) {
try {
_reconstruction.submit(node)
}
catch (error) {
const data = ErrorHandler.analyseError(error)
if(data.context === "SUBMITTING")
computeSubmitErrorDialog.openError(data.type, data.msg, node)
if (!canSubmit) {
unsavedSubmitDialog.open()
} else {
try {
_reconstruction.submit(node)
}
catch (error) {
const data = ErrorHandler.analyseError(error)
if(data.context === "SUBMITTING")
computeSubmitErrorDialog.openError(data.type, data.msg, node)
}
}
}

Expand Down Expand Up @@ -319,6 +323,22 @@ ApplicationWindow {
onDiscarded: { close(); computeManager.compute(currentNode, true) }
onAccepted: saveAsAction.trigger()
}

MessageDialog {
id: unsavedSubmitDialog

canCopy: false
icon.text: MaterialIcons.warning
parent: Overlay.overlay
preset: "Warning"
title: "Unsaved Project"
text: "The project cannot be submitted if it remains unsaved."
helperText: "Save the project to be able to submit it?"
standardButtons: Dialog.Cancel | Dialog.Save

onDiscarded: close()
onAccepted: saveAsAction.trigger()
}
}

FileDialog {
Expand Down

0 comments on commit 6421c03

Please sign in to comment.