예제 #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
예제 #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")
예제 #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)
예제 #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
예제 #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
예제 #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]
예제 #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
예제 #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
예제 #9
0
 def __init__(self, node, pos, prev_pos):
     QUndoCommand.__init__(self)
     self.node = node
     self.pos = pos
     self.prev_pos = prev_pos
예제 #10
0
 def __init__(self, src_port, trg_port):
     QUndoCommand.__init__(self)
     self.source = src_port
     self.target = trg_port
예제 #11
0
    def mergeWith(self, other: QtW.QUndoCommand) -> bool:
        if other.id() != self.id():
            return False

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

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