Rework FitChanged command to avoid refreshing graph multiple times in certain cases

This commit is contained in:
DarkPhoenix
2019-07-07 14:25:27 +03:00
parent 64bc2c34c2
commit 3a09f4b45c
98 changed files with 254 additions and 248 deletions

View File

@@ -188,7 +188,7 @@ class CharacterSelection(wx.Panel):
sFit = Fit.getInstance()
sFit.changeChar(fitID, charID)
self.charCache = self.charChoice.GetCurrentSelection()
wx.PostEvent(self.mainFrame, GE.FitChanged(fitID=fitID))
wx.PostEvent(self.mainFrame, GE.FitChanged(fitIDs=(fitID,)))
def toggleRefreshButton(self):
charID = self.getActiveCharacter()
@@ -216,16 +216,16 @@ class CharacterSelection(wx.Panel):
"""
event.Skip()
activeFitID = self.mainFrame.getActiveFit()
if activeFitID is not None and event.fitID is not None and event.fitID != activeFitID:
if activeFitID is not None and activeFitID not in event.fitIDs:
return
self.charChoice.Enable(event.fitID is not None)
self.charChoice.Enable(activeFitID is not None)
choice = self.charChoice
sFit = Fit.getInstance()
currCharID = choice.GetClientData(choice.GetCurrentSelection())
fit = sFit.getFit(event.fitID)
fit = sFit.getFit(activeFitID)
newCharID = fit.character.ID if fit is not None else None
if event.fitID is None:
if activeFitID is None:
self.skillReqsStaticBitmap.SetBitmap(self.cleanSkills)
self.skillReqsStaticBitmap.SetToolTip("No active fit")
else: