[ui] Compatibility nodes cannot be computed or recomputed

When the compatibility node was fully computed, the recompute/resubmit
button was available in the UI menu.
The reason is that we need to propagate that the connected nodes can be
computed if there is a compatibility node in the dependency iff it is
already fully computed.
Now there is an additional explicit check.
This commit is contained in:
Fabien Castan 2025-04-14 22:28:08 +02:00
parent 8be8ea5703
commit be43c5c2a7

View file

@ -570,11 +570,21 @@ Item {
readonly property bool isSelectionFullyComputed: {
return uigraph.nodeSelection.selectedIndexes.every(function(idx) {
return uigraph.graph.nodes.at(idx.row).isComputed;
const node = uigraph.graph.nodes.at(idx.row);
return node.isComputed;
});
}
readonly property bool selectionContainsComputableNodes: {
// Selection contains only compatibility nodes
readonly property bool isSelectionFullyCompatibility: {
return uigraph.nodeSelection.selectedIndexes.every(function(idx) {
const node = uigraph.graph.nodes.at(idx.row);
return node.isCompatibilityNode;
});
}
// Selection contains at least one computable node type
readonly property bool selectionContainsComputableNodeType: {
return uigraph.nodeSelection.selectedIndexes.some(function(idx) {
const node = uigraph.graph.nodes.at(idx.row);
return node.isComputableType;
@ -582,7 +592,9 @@ Item {
}
readonly property bool canSelectionBeComputed: {
if(!selectionContainsComputableNodes)
if(!selectionContainsComputableNodeType)
return false;
if(isSelectionFullyCompatibility)
return false;
if(isSelectionFullyComputed)
return true;
@ -598,10 +610,12 @@ Item {
return b
}
readonly property bool isSelectionSubmitable: uigraph.canSubmit && selectionContainsComputableNodes
readonly property bool isSelectionSubmitable: uigraph.canSubmit && selectionContainsComputableNodeType
readonly property bool canSelectionBeSubmitted: {
if(!selectionContainsComputableNodes)
if(!selectionContainsComputableNodeType)
return false;
if(isSelectionFullyCompatibility)
return false;
if(isSelectionFullyComputed)
return true;
@ -624,7 +638,7 @@ Item {
MenuItem {
id: computeMenuItem
text: nodeMenu.isSelectionFullyComputed ? "Re-Compute" : "Compute"
visible: nodeMenu.selectionContainsComputableNodes
visible: nodeMenu.selectionContainsComputableNodeType
height: visible ? implicitHeight : 0
enabled: nodeMenu.canSelectionBeComputed