Fixed PFNotebook not sending PageChanged event when deleting a tab (if it's the case); multiSwitch uses a smarter BlankPage that responds to PageChanged event, now pyfa is behaving correctly when switching betwen fittingView tabs and empty tabs; FIT_CHANGED event moved to globalEvents.py since it is used a lot in different locations;...
This commit is contained in:
@@ -30,7 +30,7 @@ from eos.types import Slot
|
||||
from gui.builtinViewColumns.state import State
|
||||
from gui import bitmapLoader
|
||||
|
||||
FitChanged, FIT_CHANGED = wx.lib.newevent.NewEvent()
|
||||
import gui.globalEvents as GE
|
||||
|
||||
#Tab spawning handler
|
||||
class FitSpawner(gui.multiSwitch.TabSpawner):
|
||||
@@ -108,7 +108,7 @@ class FittingView(d.Display):
|
||||
d.Display.__init__(self, parent, size = (0,0))
|
||||
self.Show(False)
|
||||
self.parent = parent
|
||||
self.mainFrame.Bind(FIT_CHANGED, self.fitChanged)
|
||||
self.mainFrame.Bind(GE.FIT_CHANGED, self.fitChanged)
|
||||
self.mainFrame.Bind(gui.shipBrowser.EVT_FIT_RENAMED, self.fitRenamed)
|
||||
self.mainFrame.Bind(gui.shipBrowser.EVT_FIT_REMOVED, self.fitRemoved)
|
||||
self.mainFrame.Bind(gui.marketBrowser.ITEM_SELECTED, self.appendItem)
|
||||
@@ -138,7 +138,7 @@ class FittingView(d.Display):
|
||||
|
||||
def Destroy(self):
|
||||
self.parent.Unbind(gui.chromeTabs.EVT_NOTEBOOK_PAGE_CHANGED, handler=self.pageChanged)
|
||||
self.mainFrame.Unbind(FIT_CHANGED, handler=self.fitChanged)
|
||||
self.mainFrame.Unbind(GE.FIT_CHANGED, handler=self.fitChanged)
|
||||
self.mainFrame.Unbind(gui.shipBrowser.EVT_FIT_RENAMED, handler=self.fitRenamed)
|
||||
self.mainFrame.Unbind(gui.shipBrowser.EVT_FIT_REMOVED, handler=self.fitRemoved)
|
||||
self.mainFrame.Unbind(gui.marketBrowser.ITEM_SELECTED, handler=self.appendItem)
|
||||
@@ -150,7 +150,7 @@ class FittingView(d.Display):
|
||||
fitID = self.getActiveFit()
|
||||
sFit = service.Fit.getInstance()
|
||||
sFit.switchFit(fitID)
|
||||
wx.PostEvent(self.mainFrame, FitChanged(fitID=fitID))
|
||||
wx.PostEvent(self.mainFrame, GE.FitChanged(fitID=fitID))
|
||||
|
||||
event.Skip()
|
||||
|
||||
@@ -216,7 +216,7 @@ class FittingView(d.Display):
|
||||
self.slotsChanged()
|
||||
sFit = service.Fit.getInstance()
|
||||
sFit.switchFit(fitID)
|
||||
wx.PostEvent(self.mainFrame, FitChanged(fitID=fitID))
|
||||
wx.PostEvent(self.mainFrame, GE.FitChanged(fitID=fitID))
|
||||
self.updateTab()
|
||||
|
||||
event.Skip()
|
||||
@@ -242,13 +242,13 @@ class FittingView(d.Display):
|
||||
sel = self.GetNextSelected(sel)
|
||||
|
||||
cFit.setAmmo(fitID, itemID, modules)
|
||||
wx.PostEvent(self.mainFrame, FitChanged(fitID=fitID))
|
||||
wx.PostEvent(self.mainFrame, GE.FitChanged(fitID=fitID))
|
||||
else:
|
||||
populate = cFit.appendModule(fitID, itemID)
|
||||
if populate:
|
||||
self.slotsChanged()
|
||||
if populate is not None:
|
||||
wx.PostEvent(self.mainFrame, FitChanged(fitID=fitID))
|
||||
wx.PostEvent(self.mainFrame, GE.FitChanged(fitID=fitID))
|
||||
|
||||
event.Skip()
|
||||
|
||||
@@ -262,7 +262,7 @@ class FittingView(d.Display):
|
||||
|
||||
if populate is not None:
|
||||
if populate: self.slotsChanged()
|
||||
wx.PostEvent(self.mainFrame, FitChanged(fitID=self.activeFitID))
|
||||
wx.PostEvent(self.mainFrame, GE.FitChanged(fitID=self.activeFitID))
|
||||
|
||||
event.Skip()
|
||||
|
||||
|
||||
Reference in New Issue
Block a user