Ejemplo n.º 1
0
 def __init__(self, node, name, value):
     QUndoCommand.__init__(self)
     self.setText('set {} ({})'.format(name, node.name()))
     self.node = node
     self.name = name
     self.old_val = node.get_property(name)
     self.new_val = value
Ejemplo n.º 2
0
 def __init__(self, dictionary, key, value):
     QUndoCommand.__init__(self)
     self._dictionary = dictionary
     self._key = key
     self._old_value = dictionary[key]
     self._new_value = value
     self.setText("   modify command")
Ejemplo n.º 3
0
 def __init__(self, dictionary: 'UndoableDict', key: Union[str, list],
              value: Any):
     QUndoCommand.__init__(self)
     self._dictionary = dictionary
     self._key = key
     self._new_value = value
     self._old_value = dictionary.getItem(key)
Ejemplo n.º 4
0
 def __init__(self, dictionary, key, value):
     QUndoCommand.__init__(self)
     print(dictionary)
     self._dictionary = dictionary
     print(self._dictionary)
     self._key = key
     self._value = value
Ejemplo n.º 5
0
 def __init__(self, myList: 'URList', key: Union[int, slice],
              value: Any):
     QUndoCommand.__init__(self)
     self._list = myList
     self._key = key
     try:
         self._old_value = self._list[key]
     except IndexError:
         self._old_value = None
     self._new_value = value
Ejemplo n.º 6
0
 def __init__(self, graph, node):
     QUndoCommand.__init__(self)
     self.setText('deleted node')
     self.graph = graph
     self.node = node
     self.inputs = []
     self.outputs = []
     if hasattr(self.node, 'inputs'):
         input_ports = self.node.inputs().values()
         self.inputs = [(p, p.connected_ports()) for p in input_ports]
     if hasattr(self.node, 'outputs'):
         output_ports = self.node.outputs().values()
         self.outputs = [(p, p.connected_ports()) for p in output_ports]
Ejemplo n.º 7
0
        def __init__(self, dictionary, key, value):
            QUndoCommand.__init__(self)
            self._dictionary = dictionary
            self._key = key
            self._old_value = None

            thisKey = key
            if isinstance(thisKey, list):
                thisKey = thisKey[0]
            if thisKey in dictionary:
                self._old_value = dictionary[key]

            self._new_value = value
Ejemplo n.º 8
0
 def __init__(self, graph, node, pos=None):
     QUndoCommand.__init__(self)
     self.setText('added node')
     self.graph = graph
     self.node = node
     self.pos = pos
Ejemplo n.º 9
0
 def __init__(self, node, pos, prev_pos):
     QUndoCommand.__init__(self)
     self.node = node
     self.pos = pos
     self.prev_pos = prev_pos
Ejemplo n.º 10
0
 def __init__(self, src_port, trg_port):
     QUndoCommand.__init__(self)
     self.source = src_port
     self.target = trg_port
Ejemplo n.º 11
0
    def mergeWith(self, other: QtW.QUndoCommand) -> bool:
        if other.id() != self.id():
            return False

        self.newCopyright = other.newCopyright
        return True
Ejemplo n.º 12
0
    def mergeWith(self, other: QtW.QUndoCommand) -> bool:
        if other.id() != self.id():
            return False

        self.newLicense = other.newLicense
        return True
Ejemplo n.º 13
0
 def __init__(self, myList: 'URList', key: Union[int, slice]):
     QUndoCommand.__init__(self)
     self._key = key
     self._list = myList