As wormhole effects are still modules and we now fully support reverting modules even in case they were overwritten, consider them as modules in commands too

This commit is contained in:
DarkPhoenix
2019-04-11 13:21:49 +03:00
parent 1b54f07ce0
commit fc82e45d6c
6 changed files with 14 additions and 101 deletions

View File

@@ -52,6 +52,17 @@ class FitAddProjectedModuleCommand(wx.Command):
return True
def Undo(self):
if self.oldModuleInfo is not None:
cmd = FitAddProjectedModuleCommand(
fitID=self.fitID,
newItemID=self.oldModuleInfo.itemID,
newBaseItemID=self.oldModuleInfo.baseID,
newMutaplasmidID=self.oldModuleInfo.mutaplasmidID,
newMutations=self.oldModuleInfo.mutations,
newState=self.oldModuleInfo.state,
newChargeID=self.oldModuleInfo.chargeID,
newPosition=self.oldModuleInfo.modPosition)
return cmd.Do()
from gui.fitCommands.calc.fitRemoveProjectedModule import FitRemoveProjectedModuleCommand # avoids circular import
cmd = FitRemoveProjectedModuleCommand(self.fitID, self.newPosition)
cmd.Do()