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

@@ -178,9 +178,9 @@ class MainMenuBar(wx.MenuBar):
def fitChanged(self, event):
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
enable = event.fitID is not None
enable = activeFitID is not None
self.Enable(wx.ID_SAVEAS, enable)
self.Enable(wx.ID_COPY, enable)
self.Enable(self.exportSkillsNeededId, enable)
@@ -198,9 +198,9 @@ class MainMenuBar(wx.MenuBar):
self.Enable(self.toggleIgnoreRestrictionID, enable)
if event.fitID:
if activeFitID:
sFit = Fit.getInstance()
fit = sFit.getFit(event.fitID)
fit = sFit.getFit(activeFitID)
if fit.ignoreRestrictions:
self.ignoreRestrictionItem.SetItemLabel("Enable Fitting Re&strictions")