diff --git a/gui/builtinViews/fittingView.py b/gui/builtinViews/fittingView.py index 74e6a888e..b58674043 100644 --- a/gui/builtinViews/fittingView.py +++ b/gui/builtinViews/fittingView.py @@ -292,7 +292,7 @@ class FittingView(d.Display): def updateTab(self): sFit = service.Fit.getInstance() - fit = sFit.getFit(self.getActiveFit()) + fit = sFit.getFit(self.getActiveFit(), basic=True) bitmap = BitmapLoader.getImage("race_%s_small" % fit.ship.item.race, "gui") text = "%s: %s" % (fit.ship.item.name, fit.name) @@ -592,7 +592,7 @@ class FittingView(d.Display): pass def OnShow(self, event): - if not event.GetShow(): + if event.GetShow(): try: self.MakeSnapshot() except: diff --git a/gui/mainFrame.py b/gui/mainFrame.py index 9a1e9eec3..69dd1fd37 100644 --- a/gui/mainFrame.py +++ b/gui/mainFrame.py @@ -89,8 +89,9 @@ class OpenFitsThread(threading.Thread): # We use 1 for all fits except the last one where we use 2 so that we # have correct calculations displayed at startup for fitID in self.fits[:-1]: + print "startup 1 for fit: %s"%(fitID) wx.PostEvent(self.mainFrame, FitSelected(fitID=fitID, startup=1)) - + print "startup 2 for ",self.fits[-1] wx.PostEvent(self.mainFrame, FitSelected(fitID=self.fits[-1], startup=2)) wx.CallAfter(self.callback) @@ -207,7 +208,7 @@ class MainFrame(wx.Frame): # Remove any fits that cause exception when fetching (non-existent fits) for id in fits[:]: try: - sFit.getFit(id) + sFit.getFit(id, basic=True) except: fits.remove(id) diff --git a/service/fit.py b/service/fit.py index c853ec701..b93d3b0b2 100644 --- a/service/fit.py +++ b/service/fit.py @@ -224,14 +224,19 @@ class Fit(object): eos.db.commit() self.recalc(fit, withBoosters=True) - def getFit(self, fitID, projected = False): + def getFit(self, fitID, projected=False, basic=False): ''' Gets fit from database, and populates fleet data. Projected is a recursion flag that is set to reduce recursions into projected fits + Basic is a flag to simply return the fit without any other processing ''' if fitID is None: return None fit = eos.db.getFit(fitID) + + if basic: + return fit + inited = getattr(fit, "inited", None) if inited is None or inited is False: