Undo application of sets without committing results until operation is done
This commit is contained in:
@@ -58,8 +58,12 @@ class CalcAddImplantCommand(wx.Command):
|
||||
def Undo(self):
|
||||
pyfalog.debug('Undo addition of implant {} to fit {}'.format(self.newImplantInfo, self.fitID))
|
||||
if self.oldImplantInfo is not None and self.oldPosition is not None:
|
||||
cmd = CalcAddImplantCommand(fitID=self.fitID, implantInfo=self.oldImplantInfo, position=self.oldPosition)
|
||||
cmd = CalcAddImplantCommand(
|
||||
fitID=self.fitID,
|
||||
implantInfo=self.oldImplantInfo,
|
||||
position=self.oldPosition,
|
||||
commit=self.commit)
|
||||
return cmd.Do()
|
||||
from .remove import CalcRemoveImplantCommand
|
||||
cmd = CalcRemoveImplantCommand(fitID=self.fitID, position=self.newPosition)
|
||||
cmd = CalcRemoveImplantCommand(fitID=self.fitID, position=self.newPosition, commit=self.commit)
|
||||
return cmd.Do()
|
||||
|
||||
@@ -31,5 +31,9 @@ class CalcRemoveImplantCommand(wx.Command):
|
||||
def Undo(self):
|
||||
pyfalog.debug('Undoing removal of implant {} on fit {}'.format(self.savedImplantInfo, self.fitID))
|
||||
from .add import CalcAddImplantCommand
|
||||
cmd = CalcAddImplantCommand(fitID=self.fitID, implantInfo=self.savedImplantInfo, position=self.position, commit=self.commit)
|
||||
cmd = CalcAddImplantCommand(
|
||||
fitID=self.fitID,
|
||||
implantInfo=self.savedImplantInfo,
|
||||
position=self.position,
|
||||
commit=self.commit)
|
||||
return cmd.Do()
|
||||
|
||||
Reference in New Issue
Block a user