From 9d554f9c68218f995f3cde78583f9164286a3c0e Mon Sep 17 00:00:00 2001 From: DarkPhoenix Date: Mon, 30 Sep 2019 17:20:22 +0300 Subject: [PATCH] Make sure to do fit recalculation if it was changed after the last one --- gui/fitCommands/gui/projectedChangeProjectionRange.py | 2 ++ gui/fitCommands/gui/projectedChangeStates.py | 3 +++ gui/fitCommands/gui/projectedRemove.py | 2 ++ 3 files changed, 7 insertions(+) diff --git a/gui/fitCommands/gui/projectedChangeProjectionRange.py b/gui/fitCommands/gui/projectedChangeProjectionRange.py index 83cf6f6cf..fd6743688 100644 --- a/gui/fitCommands/gui/projectedChangeProjectionRange.py +++ b/gui/fitCommands/gui/projectedChangeProjectionRange.py @@ -55,12 +55,14 @@ class GuiChangeProjectedItemsProjectionRangeCommand(wx.Command): itemID=pDroneItemID, projectionRange=self.projectionRange) results.append(self.internalHistory.submit(cmd)) + needRecalc = True for pFighterPosition in self.pFighterPositions: cmd = CalcChangeProjectedFighterProjectionRangeCommand( fitID=self.fitID, position=pFighterPosition, projectionRange=self.projectionRange) results.append(self.internalHistory.submit(cmd)) + needRecalc = True for pFitID in self.pFitIDs: cmd = CalcChangeProjectedFitProjectionRangeCommand( fitID=self.fitID, diff --git a/gui/fitCommands/gui/projectedChangeStates.py b/gui/fitCommands/gui/projectedChangeStates.py index 996ba0b30..9d9a74da9 100644 --- a/gui/fitCommands/gui/projectedChangeStates.py +++ b/gui/fitCommands/gui/projectedChangeStates.py @@ -72,18 +72,21 @@ class GuiChangeProjectedItemStatesCommand(wx.Command): itemID=pDroneItemID, state=False if self.proposedState == 'inactive' else True) results.append(self.internalHistory.submit(cmd)) + needRecalc = True for pFighterPosition in self.pFighterPositions: cmd = CalcChangeProjectedFighterStateCommand( fitID=self.fitID, position=pFighterPosition, state=False if self.proposedState == 'inactive' else True) results.append(self.internalHistory.submit(cmd)) + needRecalc = True for pFitID in self.pFitIDs: cmd = CalcChangeProjectedFitStateCommand( fitID=self.fitID, projectedFitID=pFitID, state=False if self.proposedState == 'inactive' else True) results.append(self.internalHistory.submit(cmd)) + needRecalc = cmd.needsGuiRecalc success = any(results) sFit = Fit.getInstance() if needRecalc: diff --git a/gui/fitCommands/gui/projectedRemove.py b/gui/fitCommands/gui/projectedRemove.py index cc70d4dcd..68bb33c2e 100644 --- a/gui/fitCommands/gui/projectedRemove.py +++ b/gui/fitCommands/gui/projectedRemove.py @@ -49,9 +49,11 @@ class GuiRemoveProjectedItemsCommand(wx.Command): for pDroneItemID in self.pDroneItemIDs: cmd = CalcRemoveProjectedDroneCommand(fitID=self.fitID, itemID=pDroneItemID, amount=self.amount) results.append(self.internalHistory.submit(cmd)) + needRecalc = True for pFighterPosition in sorted(self.pFighterPositions, reverse=True): cmd = CalcRemoveProjectedFighterCommand(fitID=self.fitID, position=pFighterPosition) results.append(self.internalHistory.submit(cmd)) + needRecalc = True for pFitID in self.pFitIDs: cmd = CalcRemoveProjectedFitCommand(fitID=self.fitID, projectedFitID=pFitID, amount=self.amount) results.append(self.internalHistory.submit(cmd))