Support undo/redo module add

This commit is contained in:
blitzmann
2018-07-21 14:46:25 -04:00
parent 926e0a9035
commit 0c3fa53bcf
4 changed files with 34 additions and 6 deletions

View File

@@ -382,14 +382,12 @@ class FittingView(d.Display):
sFit.setAmmo(fitID, itemID, modules)
wx.PostEvent(self.mainFrame, GE.FitChanged(fitID=fitID))
else:
populate = sFit.appendModule(fitID, itemID)
if populate is not None:
self.slotsChanged()
wx.PostEvent(self.mainFrame, GE.FitChanged(fitID=fitID, action="modadd", typeID=itemID))
self.mainFrame.command.Submit(cmd.FitModuleAddCommand(fitID, itemID))
event.Skip()
def removeItem(self, event):
'''Double Left Click - remove module'''
if event.CmdDown():
return
row, _ = self.HitTest(event.Position)