Rework FitChanged command to avoid refreshing graph multiple times in certain cases
This commit is contained in:
@@ -36,7 +36,7 @@ class AmmoToDmgPattern(ContextMenuSingle):
|
||||
def activate(self, fullContext, mainItem, i):
|
||||
fitID = self.mainFrame.getActiveFit()
|
||||
Fit.getInstance().setAsPattern(fitID, mainItem)
|
||||
wx.PostEvent(self.mainFrame, GE.FitChanged(fitID=fitID))
|
||||
wx.PostEvent(self.mainFrame, GE.FitChanged(fitIDs=(fitID,)))
|
||||
|
||||
def getBitmap(self, context, mainItem):
|
||||
return None
|
||||
|
||||
@@ -108,7 +108,7 @@ class ChangeDamagePattern(ContextMenuUnconditional):
|
||||
fitID = self.mainFrame.getActiveFit()
|
||||
sFit.setDamagePattern(fitID, pattern)
|
||||
setattr(self.mainFrame, "_activeDmgPattern", pattern)
|
||||
wx.PostEvent(self.mainFrame, GE.FitChanged(fitID=fitID))
|
||||
wx.PostEvent(self.mainFrame, GE.FitChanged(fitIDs=(fitID,)))
|
||||
|
||||
|
||||
ChangeDamagePattern.register()
|
||||
|
||||
@@ -24,8 +24,7 @@ class FactorReload(ContextMenuUnconditional):
|
||||
|
||||
def activate(self, fullContext, i):
|
||||
fitIDs = Fit.getInstance().toggleFactorReload()
|
||||
for fitID in fitIDs:
|
||||
wx.PostEvent(self.mainFrame, GE.FitChanged(fitID=fitID))
|
||||
wx.PostEvent(self.mainFrame, GE.FitChanged(fitIDs=tuple(fitIDs)))
|
||||
|
||||
@property
|
||||
def checked(self):
|
||||
|
||||
@@ -32,7 +32,8 @@ class ItemGroupPrice(ContextMenuUnconditional, metaclass=ABCMeta):
|
||||
|
||||
def activate(self, fullContext, i):
|
||||
self.settings.set(self.optionName, not self.settings.get(self.optionName))
|
||||
wx.PostEvent(self.mainFrame, GE.FitChanged(fitID=self.mainFrame.getActiveFit()))
|
||||
fitID = self.mainFrame.getActiveFit()
|
||||
wx.PostEvent(self.mainFrame, GE.FitChanged(fitIDs=(fitID,)))
|
||||
|
||||
@property
|
||||
def checked(self):
|
||||
|
||||
@@ -116,7 +116,7 @@ class ChangeAffectingSkills(ContextMenuSingle):
|
||||
self.sFit.changeChar(fitID, self.charID)
|
||||
|
||||
wx.PostEvent(self.mainFrame, GE.CharListUpdated())
|
||||
wx.PostEvent(self.mainFrame, GE.FitChanged(fitID=fitID))
|
||||
wx.PostEvent(self.mainFrame, GE.FitChanged(fitIDs=(fitID,)))
|
||||
|
||||
|
||||
ChangeAffectingSkills.register()
|
||||
|
||||
@@ -38,7 +38,7 @@ class TargetResists(ContextMenuUnconditional):
|
||||
sFit = Fit.getInstance()
|
||||
fitID = self.mainFrame.getActiveFit()
|
||||
sFit.setTargetResists(fitID, pattern)
|
||||
wx.PostEvent(self.mainFrame, GE.FitChanged(fitID=fitID))
|
||||
wx.PostEvent(self.mainFrame, GE.FitChanged(fitIDs=(fitID,)))
|
||||
|
||||
def addPattern(self, rootMenu, pattern):
|
||||
id = ContextMenuUnconditional.nextID()
|
||||
|
||||
Reference in New Issue
Block a user