diff --git a/gui/builtinViews/fittingView.py b/gui/builtinViews/fittingView.py index 74d02295c..a1c2b62e0 100644 --- a/gui/builtinViews/fittingView.py +++ b/gui/builtinViews/fittingView.py @@ -434,19 +434,12 @@ class FittingView(d.Display): if not isinstance(module, Module): return - sFit = Fit.getInstance() - fit = sFit.getFit(self.activeFitID) - typeID = fit.cargo[srcIdx].item.ID - self.mainFrame.command.Submit(cmd.GuiCargoToModuleCommand( self.mainFrame.getActiveFit(), module.modPosition, srcIdx, mstate.CmdDown() and module.isEmpty)) - - # wx.PostEvent(self.mainFrame, GE.FitChanged(fitID=self.mainFrame.getActiveFit(), action="modadd", typeID=typeID)) - def swapItems(self, x, y, srcIdx): """Swap two modules in fitting window""" mstate = wx.GetMouseState() diff --git a/gui/fitCommands/guiCargoToModule.py b/gui/fitCommands/guiCargoToModule.py index 784cfba88..3ce9cc4b0 100644 --- a/gui/fitCommands/guiCargoToModule.py +++ b/gui/fitCommands/guiCargoToModule.py @@ -34,7 +34,7 @@ class GuiCargoToModuleCommand(wx.Command): fit = sFit.getFit(self.fitID) module = fit.modules[self.moduleIdx] cargo = fit.cargo[self.cargoIdx] - result = None + result = False # We're trying to move a charge from cargo to a slot. Use SetCharge command (don't respect move vs copy) if sFit.isAmmo(cargo.item.ID): @@ -64,6 +64,7 @@ class GuiCargoToModuleCommand(wx.Command): result = self.internal_history.Submit(self.removeCmd) if result: + sFit.recalc(self.fitID) wx.PostEvent(self.mainFrame, GE.FitChanged(fitID=self.fitID)) return result diff --git a/gui/fitCommands/guiModuleToCargo.py b/gui/fitCommands/guiModuleToCargo.py index ef8e84b7a..d59680408 100644 --- a/gui/fitCommands/guiModuleToCargo.py +++ b/gui/fitCommands/guiModuleToCargo.py @@ -58,9 +58,10 @@ class GuiModuleToCargoCommand(wx.Command): if not self.copy: # if not copying, remove module self.internal_history.Submit(FitRemoveModuleCommand(self.mainFrame.getActiveFit(), [self.moduleIdx])) - if result: + sFit.recalc(self.fitID) wx.PostEvent(self.mainFrame, GE.FitChanged(fitID=self.fitID, action="moddel", typeID=module.item.ID)) + return result def Undo(self):