mirror of
https://github.com/alicevision/Meshroom.git
synced 2025-05-24 06:26:29 +02:00
[ui] GraphEditor: fix some readOnly regarding CompatibilityNodes
This commit is contained in:
parent
382e350bcd
commit
078120696a
4 changed files with 14 additions and 4 deletions
|
@ -93,6 +93,9 @@ class Attribute(BaseObject):
|
||||||
def getType(self):
|
def getType(self):
|
||||||
return self.attributeDesc.__class__.__name__
|
return self.attributeDesc.__class__.__name__
|
||||||
|
|
||||||
|
def _isReadOnly(self):
|
||||||
|
return not self._isOutput and self.node.isCompatibilityNode
|
||||||
|
|
||||||
def getBaseType(self):
|
def getBaseType(self):
|
||||||
return self.getType()
|
return self.getType()
|
||||||
|
|
||||||
|
@ -262,6 +265,7 @@ class Attribute(BaseObject):
|
||||||
label = Property(str, getLabel, constant=True)
|
label = Property(str, getLabel, constant=True)
|
||||||
type = Property(str, getType, constant=True)
|
type = Property(str, getType, constant=True)
|
||||||
baseType = Property(str, getType, constant=True)
|
baseType = Property(str, getType, constant=True)
|
||||||
|
isReadOnly = Property(bool, _isReadOnly, constant=True)
|
||||||
desc = Property(desc.Attribute, lambda self: self.attributeDesc, constant=True)
|
desc = Property(desc.Attribute, lambda self: self.attributeDesc, constant=True)
|
||||||
valueChanged = Signal()
|
valueChanged = Signal()
|
||||||
value = Property(Variant, _get_value, _set_value, notify=valueChanged)
|
value = Property(Variant, _get_value, _set_value, notify=valueChanged)
|
||||||
|
|
|
@ -865,6 +865,9 @@ class BaseNode(BaseObject):
|
||||||
fusedStatus.merge(node.fusedStatus)
|
fusedStatus.merge(node.fusedStatus)
|
||||||
return fusedStatus
|
return fusedStatus
|
||||||
|
|
||||||
|
def _isCompatibilityNode(self):
|
||||||
|
return False
|
||||||
|
|
||||||
@property
|
@property
|
||||||
def globalExecMode(self):
|
def globalExecMode(self):
|
||||||
return self._chunks.at(0).execModeName
|
return self._chunks.at(0).execModeName
|
||||||
|
@ -1031,6 +1034,7 @@ class BaseNode(BaseObject):
|
||||||
fusedStatus = Property(StatusData, getFusedStatus, notify=globalStatusChanged)
|
fusedStatus = Property(StatusData, getFusedStatus, notify=globalStatusChanged)
|
||||||
elapsedTime = Property(float, lambda self: self.getFusedStatus().elapsedTime, notify=globalStatusChanged)
|
elapsedTime = Property(float, lambda self: self.getFusedStatus().elapsedTime, notify=globalStatusChanged)
|
||||||
recursiveElapsedTime = Property(float, lambda self: self.getRecursiveFusedStatus().elapsedTime, notify=globalStatusChanged)
|
recursiveElapsedTime = Property(float, lambda self: self.getRecursiveFusedStatus().elapsedTime, notify=globalStatusChanged)
|
||||||
|
isCompatibilityNode = Property(bool, lambda self: self._isCompatibilityNode(), constant=True) # need lambda to evaluate the virtual function
|
||||||
|
|
||||||
globalExecModeChanged = Signal()
|
globalExecModeChanged = Signal()
|
||||||
globalExecMode = Property(str, globalExecMode.fget, notify=globalExecModeChanged)
|
globalExecMode = Property(str, globalExecMode.fget, notify=globalExecModeChanged)
|
||||||
|
@ -1167,6 +1171,9 @@ class CompatibilityNode(BaseNode):
|
||||||
for i in range(self.splitCount)
|
for i in range(self.splitCount)
|
||||||
])
|
])
|
||||||
|
|
||||||
|
def _isCompatibilityNode(self):
|
||||||
|
return True
|
||||||
|
|
||||||
@staticmethod
|
@staticmethod
|
||||||
def attributeDescFromValue(attrName, value, isOutput):
|
def attributeDescFromValue(attrName, value, isOutput):
|
||||||
"""
|
"""
|
||||||
|
|
|
@ -222,7 +222,7 @@ Item {
|
||||||
id: edgeMenu
|
id: edgeMenu
|
||||||
property var currentEdge: null
|
property var currentEdge: null
|
||||||
MenuItem {
|
MenuItem {
|
||||||
enabled: edgeMenu.currentEdge && !edgeMenu.currentEdge.dst.node.locked
|
enabled: edgeMenu.currentEdge && !edgeMenu.currentEdge.dst.node.locked && !edgeMenu.currentEdge.dst.isReadOnly
|
||||||
text: "Remove"
|
text: "Remove"
|
||||||
onTriggered: uigraph.removeEdge(edgeMenu.currentEdge)
|
onTriggered: uigraph.removeEdge(edgeMenu.currentEdge)
|
||||||
}
|
}
|
||||||
|
|
|
@ -270,8 +270,6 @@ Item {
|
||||||
height: childrenRect.height
|
height: childrenRect.height
|
||||||
anchors.horizontalCenter: parent.horizontalCenter
|
anchors.horizontalCenter: parent.horizontalCenter
|
||||||
|
|
||||||
enabled: !root.isCompatibilityNode
|
|
||||||
|
|
||||||
Column {
|
Column {
|
||||||
id: attributesColumn
|
id: attributesColumn
|
||||||
width: parent.width
|
width: parent.width
|
||||||
|
@ -311,6 +309,7 @@ Item {
|
||||||
id: inputs
|
id: inputs
|
||||||
width: parent.width
|
width: parent.width
|
||||||
spacing: 3
|
spacing: 3
|
||||||
|
|
||||||
Repeater {
|
Repeater {
|
||||||
model: node ? node.attributes : undefined
|
model: node ? node.attributes : undefined
|
||||||
delegate: Loader {
|
delegate: Loader {
|
||||||
|
@ -326,7 +325,7 @@ Item {
|
||||||
property real globalX: root.x + nodeAttributes.x + inputs.x + inputLoader.x + inPin.x
|
property real globalX: root.x + nodeAttributes.x + inputs.x + inputLoader.x + inPin.x
|
||||||
property real globalY: root.y + nodeAttributes.y + inputs.y + inputLoader.y + inPin.y
|
property real globalY: root.y + nodeAttributes.y + inputs.y + inputLoader.y + inPin.y
|
||||||
|
|
||||||
readOnly: root.readOnly
|
readOnly: root.readOnly || root.isCompatibilityNode
|
||||||
Component.onCompleted: attributePinCreated(attribute, inPin)
|
Component.onCompleted: attributePinCreated(attribute, inPin)
|
||||||
Component.onDestruction: attributePinDeleted(attribute, inPin)
|
Component.onDestruction: attributePinDeleted(attribute, inPin)
|
||||||
onPressed: root.pressed(mouse)
|
onPressed: root.pressed(mouse)
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue