Add "Notes" tab with "comment"/"invalid comment" attributes

Add two internal attributes, "Comment" and "Invalid comment", in
a specific "Notes" tab, which will contain any further internal
attribute. Internal attributes exist for all nodes.
This commit is contained in:
Candice Bentéjac 2022-10-12 09:47:24 +01:00
parent 1fc2b228af
commit 9bc9e2c129
6 changed files with 146 additions and 3 deletions

View file

@ -264,11 +264,17 @@ class SetAttributeCommand(GraphCommand):
def redoImpl(self):
if self.value == self.oldValue:
return False
self.graph.attribute(self.attrName).value = self.value
if self.graph.attribute(self.attrName) is not None:
self.graph.attribute(self.attrName).value = self.value
else:
self.graph.internalAttribute(self.attrName).value = self.value
return True
def undoImpl(self):
self.graph.attribute(self.attrName).value = self.oldValue
if self.graph.attribute(self.attrName) is not None:
self.graph.attribute(self.attrName).value = self.oldValue
else:
self.graph.internalAttribute(self.attrName).value = self.oldValue
class AddEdgeCommand(GraphCommand):