aboutsummaryrefslogtreecommitdiff
path: root/src/gui/actions.py
diff options
context:
space:
mode:
authortassaron2017-08-19 18:32:12 -0400
committertassaron2017-08-19 18:32:12 -0400
commitc07f2426ceeada205fdacbfba66329179a74a1dc (patch)
treeff69455b1cec3cff36cf2c4edeae93cd8600649d /src/gui/actions.py
parent87e762a8aa3fa97a3d43a18c59098b287bb95506 (diff)
fixed issues with undoing relative widgets
Diffstat (limited to 'src/gui/actions.py')
-rw-r--r--src/gui/actions.py11
1 files changed, 10 insertions, 1 deletions
diff --git a/src/gui/actions.py b/src/gui/actions.py
index 0fe97f2..1444569 100644
--- a/src/gui/actions.py
+++ b/src/gui/actions.py
@@ -20,11 +20,20 @@ class AddComponent(QUndoCommand):
self.parent = parent
self.moduleI = moduleI
self.compI = compI
+ self.comp = None
def redo(self):
- self.parent.core.insertComponent(self.compI, self.moduleI, self.parent)
+ if self.comp is None:
+ self.parent.core.insertComponent(
+ self.compI, self.moduleI, self.parent)
+ else:
+ # inserting previously-created component
+ self.parent.core.insertComponent(
+ self.compI, self.comp, self.parent)
+
def undo(self):
+ self.comp = self.parent.core.selectedComponents[self.compI]
self.parent._removeComponent(self.compI)