mirror of
https://gitlab.com/pamhyr/pamhyr2.git
synced 2026-10-30 03:20:41 +01:00
AdisTT: user-friendly fixes on interface
This commit is contained in:
1 parent
965443a8f9
commit
cac20d4f24
12 files changed
+91
-38
No files matched your search
@@ -37,12 +37,23 @@ class SetNodeCommand(QUndoCommand):
|
||||
self._index = index
|
||||
self._old = self._bcs.get(self._index).node
|
||||
self._new = node.id if node is not None else None
|
||||
self._previous = next(
|
||||
(
|
||||
bc for i, bc in enumerate(self._bcs.lst)
|
||||
if i != self._index and bc.node == self._new
|
||||
),
|
||||
None
|
||||
)
|
||||
|
||||
def undo(self):
|
||||
self._bcs.get(self._index).node = self._old
|
||||
if self._previous is not None:
|
||||
self._previous.node = self._new
|
||||
|
||||
def redo(self):
|
||||
self._bcs.get(self._index).node = self._new
|
||||
if self._previous is not None:
|
||||
self._previous.node = None
|
||||
|
||||
|
||||
class SetNameCommand(QUndoCommand):
|
||||
|
||||
Reference in new issue
Block a user