def addItem(self, event): sFit = Fit.getInstance() fitID = self.mainFrame.getActiveFit() fit = sFit.getFit(fitID) if not fit or fit.isStructure: event.Skip() return if self.mainFrame.command.Submit(cmd.GuiAddBoosterCommand(fitID, event.itemID)): self.mainFrame.additionsPane.select("Boosters") event.Skip()
def addItem(self, event): item = Market.getInstance().getItem(event.itemID, eager='group') if item is None or not item.isBooster: event.Skip() return fitID = self.mainFrame.getActiveFit() fit = Fit.getInstance().getFit(fitID) if not fit or fit.isStructure: event.Skip() return self.mainFrame.command.Submit(cmd.GuiAddBoosterCommand(fitID=fitID, itemID=event.itemID)) # Select in any case - as we might've added booster which has been there already and command failed self.mainFrame.additionsPane.select('Boosters') event.Skip()