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

Method swapModule

gui/builtinAdditionPanes/cargoView.py:148–166  ·  view source on GitHub ↗

Swap a module from fitting window with cargo

(self, x, y, modIdx)

Source from the content-addressed store, hash-verified

146 event.Skip()
147
148 def swapModule(self, x, y, modIdx):
149 """Swap a module from fitting window with cargo"""
150 sFit = Fit.getInstance()
151 fit = sFit.getFit(self.mainFrame.getActiveFit())
152 dstRow, _ = self.HitTest((x, y))
153
154 if dstRow > -1:
155 try:
156 dstCargoItemID = getattr(self.cargo[dstRow], 'itemID', None)
157 except IndexError:
158 dstCargoItemID = None
159 else:
160 dstCargoItemID = None
161
162 self.mainFrame.command.Submit(cmd.GuiLocalModuleToCargoCommand(
163 fitID=self.mainFrame.getActiveFit(),
164 modPosition=modIdx,
165 cargoItemID=dstCargoItemID,
166 copy=wx.GetMouseState().GetModifiers() == wx.MOD_CONTROL))
167
168 def fitChanged(self, event):
169 event.Skip()

Callers 1

handleListDragMethod · 0.95

Calls 4

getFitMethod · 0.80
getInstanceMethod · 0.45
getActiveFitMethod · 0.45
HitTestMethod · 0.45

Tested by

no test coverage detected