From cfb7a70da565c669617f9f74a0b585cdc0179e24 Mon Sep 17 00:00:00 2001 From: blitzmann Date: Mon, 30 Jul 2018 00:05:00 -0400 Subject: [PATCH] Add recalcs to Add and remove module --- gui/fitCommands/guiAddModule.py | 5 +++-- gui/fitCommands/guiRemoveModule.py | 2 ++ 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/gui/fitCommands/guiAddModule.py b/gui/fitCommands/guiAddModule.py index 20a27e23d..5abf52651 100644 --- a/gui/fitCommands/guiAddModule.py +++ b/gui/fitCommands/guiAddModule.py @@ -1,5 +1,4 @@ import wx -from service.fit import Fit import gui.mainFrame from gui import globalEvents as GE @@ -22,7 +21,7 @@ class GuiModuleAddCommand(wx.Command): success = False # if we have a position set, try to apply the module to that position - # todo: check to see if item is a charge. if it is, dont try to add module, but instead set amm + # todo: check to see if item is a charge. if it is, dont try to add module, but instead set ammo if self.new_position: success = self.internal_history.Submit(FitReplaceModuleCommand(self.fitID, self.new_position, self.itemID)) if not success: @@ -34,6 +33,7 @@ class GuiModuleAddCommand(wx.Command): success = self.internal_history.Submit(FitAddModuleCommand(self.fitID, self.itemID)) if success: + self.sFit.recalc(self.fitID) wx.PostEvent(self.mainFrame, GE.FitChanged(fitID=self.fitID, action="modadd", typeID=self.itemID)) return True return False @@ -48,5 +48,6 @@ class GuiModuleAddCommand(wx.Command): def Undo(self): for _ in self.internal_history.Commands: self.internal_history.Undo() + self.sFit.recalc(self.fitID) wx.PostEvent(self.mainFrame, GE.FitChanged(fitID=self.fitID, action="moddel", typeID=self.itemID)) return True diff --git a/gui/fitCommands/guiRemoveModule.py b/gui/fitCommands/guiRemoveModule.py index 32dc8cedc..9c7c5eef6 100644 --- a/gui/fitCommands/guiRemoveModule.py +++ b/gui/fitCommands/guiRemoveModule.py @@ -24,11 +24,13 @@ class GuiModuleRemoveCommand(wx.Command): if success is not None: # self.slotsChanged() # todo: fix + self.sFit.recalc(self.fitID) wx.PostEvent(self.mainFrame, GE.FitChanged(fitID=self.fitID, action="moddel", typeID=set([mod.itemID for mod in self.modCache]))) return True def Undo(self): for x in self.internal_history.Commands: self.internal_history.Undo() + self.sFit.recalc(self.fitID) wx.PostEvent(self.mainFrame, GE.FitChanged(fitID=self.fitID, action="modadd", typeID=set([mod.itemID for mod in self.modCache]))) return True