MCPcopy Create free account
hub / github.com/pyfa-org/Pyfa / spawnMenu

Method spawnMenu

gui/builtinAdditionPanes/cargoView.py:220–237  ·  view source on GitHub ↗
(self, event)

Source from the content-addressed store, hash-verified

218 self.mainFrame.command.Submit(cmd.GuiRemoveCargosCommand(fitID=fitID, itemIDs=itemIDs))
219
220 def spawnMenu(self, event):
221 clickedPos = self.getRowByAbs(event.Position)
222 self.ensureSelection(clickedPos)
223
224 selection = self.getSelectedCargos()
225 mainCargo = None
226 if clickedPos != -1:
227 try:
228 cargo = self.cargo[clickedPos]
229 except IndexError:
230 pass
231 else:
232 if cargo in self.original:
233 mainCargo = cargo
234 itemContext = None if mainCargo is None else Market.getInstance().getCategoryByItem(mainCargo.item).displayName
235 menu = ContextMenu.getMenu(self, mainCargo, selection, ("cargoItem", itemContext), ("cargoItemMisc", itemContext))
236 if menu:
237 self.PopupMenu(menu)
238
239 def getSelectedCargos(self):
240 cargos = []

Callers

nothing calls this directly

Calls 6

getSelectedCargosMethod · 0.95
getRowByAbsMethod · 0.80
ensureSelectionMethod · 0.80
getCategoryByItemMethod · 0.80
getMenuMethod · 0.80
getInstanceMethod · 0.45

Tested by

no test coverage detected