Exemple #1
0
    def run(self):
        time.sleep(0.5)  # Give GUI some time to finish drawing

        # `startup` tells FitSpawner that we are loading fits are startup, and
        # has 3 values:
        # False = Set as default in FitSpawner itself, never set here
        # 1 = Create new fit page, but do not calculate page
        # 2 = Create new page and calculate
        # 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]:
            wx.PostEvent(self.mainFrame, FitSelected(fitID=fitID, startup=1))

        wx.PostEvent(self.mainFrame, FitSelected(fitID=self.fits[-1], startup=2))
        wx.CallAfter(self.callback)
Exemple #2
0
 def _openAfterImport(self, fits):
     if len(fits) > 0:
         if len(fits) == 1:
             fit = fits[0]
             wx.PostEvent(self, FitSelected(fitID=fit.ID))
             wx.PostEvent(self.shipBrowser, Stage3Selected(shipID=fit.shipID, back=True))
         else:
             wx.PostEvent(self.shipBrowser, ImportSelected(fits=fits, back=True))
Exemple #3
0
 def _openAfterImport(self, fits):
     if len(fits) > 0:
         if len(fits) == 1:
             fit = fits[0]
             wx.PostEvent(self, FitSelected(fitID=fit.ID))
             wx.PostEvent(self.shipBrowser,
                          Stage3Selected(shipID=fit.shipID, back=True))
         else:
             fits.sort(key=lambda _fit: (_fit.ship.item.name, _fit.name))
             results = []
             for fit in fits:
                 results.append((fit.ID, fit.name, fit.modifiedCoalesce,
                                 fit.ship.item, fit.notes))
             wx.PostEvent(self.shipBrowser,
                          ImportSelected(fits=results, back=True))
Exemple #4
0
    def _openAfterImport(self, importCount, fitIDs):
        if importCount == 1:
            if self.getActiveFit() != fitIDs[0]:
                wx.PostEvent(self, FitSelected(fitID=fitIDs[0]))

        self.shipBrowser.RefreshContent()
Exemple #5
0
 def activate(self, fullContext, selection, i):
     fit = selection[0]
     wx.PostEvent(self.mainFrame, FitSelected(fitID=fit.ID, startup=2))