[ui] GraphEditor: use node label in duplicates tooltip

This commit is contained in:
Fabien Castan 2019-09-12 12:48:43 +02:00 committed by Yann Lanthony
parent c128080bbb
commit bbe40e0bc6
No known key found for this signature in database
GPG key ID: 519FAE6DF7A70642
2 changed files with 11 additions and 5 deletions

View file

@ -391,7 +391,15 @@ class BaseNode(BaseObject):
Returns: Returns:
str: the high-level label of this node str: the high-level label of this node
""" """
t, idx = self._name.split("_") return self.nameToLabel(self._name)
@Slot(str, result=str)
def nameToLabel(self, name):
"""
Returns:
str: the high-level label from the technical node name
"""
t, idx = name.split("_")
return "{}{}".format(t, idx if int(idx) > 1 else "") return "{}{}".format(t, idx if int(idx) > 1 else "")
@property @property

View file

@ -148,13 +148,11 @@ Item {
ToolTip { ToolTip {
delay: 800 delay: 800
visible: parent.showTooltip visible: parent.showTooltip
text: node.chunks.count > 0 ? "This node has the same values as <b>" + node.chunks.at(0).statusNodeName + "</b>" : "This node is a duplicate" text: ""
onVisibleChanged: { onVisibleChanged: {
text = node.chunks.count > 0 ? "This node has the same values as <b>" + node.chunks.at(0).statusNodeName + "</b>" : "This node is a duplicate" text = "The data associated to this node has been computed by the other node: <b>" + node.nameToLabel(node.chunks.at(0).statusNodeName) + "</b>."
} }
} }
} }
} }