Skip to content

Commit 73b180e

Browse files
[ui] Node: When an attribute valuechange node check for attribute validity. Id one is not valid an icon is added
1 parent a73312b commit 73b180e

File tree

4 files changed

+35
-3
lines changed

4 files changed

+35
-3
lines changed

meshroom/common/PySignal.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -158,6 +158,10 @@ class ClassSignal:
158158
"""
159159
_map = {}
160160

161+
def __init__(self, *args, **kwargs):
162+
self._args = args
163+
self._kwargs = kwargs
164+
161165
def __get__(self, instance, owner):
162166
if instance is None:
163167
# When we access ClassSignal element on the class object without any instance,

meshroom/ui/qml/Application.qml

Lines changed: 29 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -268,7 +268,15 @@ Page {
268268
unsavedSubmitDialog.open()
269269
} else {
270270
try {
271-
_reconstruction.submit(nodes)
271+
272+
if ( nodes.find(node => node.hasInvalidAttribute) ) {
273+
submitWithWarningDialog.nodes = nodes
274+
submitWithWarningDialog.open()
275+
} else {
276+
submit.open()
277+
//_reconstruction.submit(nodes)
278+
}
279+
272280
}
273281
catch (error) {
274282
const data = ErrorHandler.analyseError(error)
@@ -399,6 +407,26 @@ Page {
399407
onAccepted: saveAsAction.trigger()
400408
}
401409

410+
MessageDialog {
411+
id: submitWithWarningDialog
412+
413+
canCopy: false
414+
icon.text: MaterialIcons.warning
415+
parent: Overlay.overlay
416+
preset: "Warning"
417+
title: "Nodes have warnings"
418+
text: "Some nodes have warnings, are you sure you want to submit ?"
419+
helperText: "Submit even if some nodes have warnings"
420+
standardButtons: Dialog.Cancel | Dialog.Ok
421+
422+
property var nodes: []
423+
424+
onDiscarded: close()
425+
onAccepted: {
426+
console.log("submit nodes", nodes)
427+
}
428+
}
429+
402430
MessageDialog {
403431
id: fileModifiedDialog
404432

meshroom/ui/qml/GraphEditor/AttributeItemDelegate.qml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -445,7 +445,7 @@ RowLayout {
445445

446446
MaterialLabel {
447447
visible: !attribute.isOutput && errorMessages.length
448-
text: MaterialIcons.warning
448+
text: MaterialIcons.fmd_bad
449449
ToolTip.text: errorMessages.join("\n")
450450
color: "orange"
451451
}

meshroom/ui/qml/GraphEditor/Node.qml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -281,7 +281,7 @@ Item {
281281
// Attribute warnings
282282
MaterialLabel {
283283
visible: hasWarnings
284-
text: MaterialIcons.warning
284+
text: MaterialIcons.fmd_bad
285285
color: "orange"
286286
padding: 2
287287
font.pointSize: 7

0 commit comments

Comments
 (0)