Skip to content

Commit a23ad1b

Browse files
[ui] Node: Add a warning dialog to submit even if a node have warnings
1 parent a540d17 commit a23ad1b

File tree

1 file changed

+19
-9
lines changed

1 file changed

+19
-9
lines changed

meshroom/ui/qml/Application.qml

Lines changed: 19 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -129,6 +129,14 @@ Page {
129129
return true;
130130
}
131131

132+
function getAllNodes() {
133+
const nodes = []
134+
for(let i=0; i<graphEditor.graph.nodes.count; i++) {
135+
nodes.push(graphEditor.graph.nodes.at(i))
136+
}
137+
return nodes
138+
}
139+
132140
// File dialogs
133141
Platform.FileDialog {
134142
id: saveFileDialog
@@ -266,22 +274,24 @@ Page {
266274
function submit(nodes) {
267275
if (!canSubmit) {
268276
unsavedSubmitDialog.open()
269-
} else {
277+
}
278+
else {
270279
try {
271-
272-
if ( nodes.find(node => node.hasInvalidAttribute) ) {
280+
if(nodes == null) {
281+
nodes = getAllNodes()
282+
}
283+
if ( nodes && nodes.find(node => node.hasInvalidAttribute) ) {
273284
submitWithWarningDialog.nodes = nodes
274285
submitWithWarningDialog.open()
275286
} else {
276-
submit.open()
277-
//_reconstruction.submit(nodes)
287+
_reconstruction.submit(nodes)
278288
}
279-
280289
}
281-
catch (error) {
290+
catch (error) {
282291
const data = ErrorHandler.analyseError(error)
283-
if (data.context === "SUBMITTING")
292+
if (data.context === "SUBMITTING") {
284293
computeSubmitErrorDialog.openError(data.type, data.msg, nodes)
294+
}
285295
}
286296
}
287297
}
@@ -423,7 +433,7 @@ Page {
423433

424434
onDiscarded: close()
425435
onAccepted: {
426-
console.log("submit nodes", nodes)
436+
_reconstruction.submit(nodes)
427437
}
428438
}
429439

0 commit comments

Comments
 (0)