Implants are now sorted by implant slot, ticket 140

This commit is contained in:
Weeknie
2010-10-26 14:46:52 +02:00
parent b1e45721cf
commit 224bbca86e
2 changed files with 6 additions and 4 deletions

2
eos

Submodule eos updated: 4b5c3136e7...dd3cadec0f

View File

@@ -57,7 +57,9 @@ class ImplantView(d.Display):
cFit = service.Fit.getInstance()
fit = cFit.getFit(event.fitID)
stuff = fit.implants if fit is not None else None
self.original = fit.implants if fit is not None else None
self.implants = stuff = fit.implants if fit is not None else None
if stuff is not None: stuff.sort(key=lambda implant: implant.slot)
self.populate(stuff)
self.refresh(stuff)
event.Skip()
@@ -77,7 +79,8 @@ class ImplantView(d.Display):
if row != -1:
fitID = self.mainFrame.getActiveFit()
cFit = service.Fit.getInstance()
cFit.removeImplant(fitID, self.GetItemData(row))
implant = self.implants[self.GetItemData(row)]
cFit.removeImplant(fitID, self.original.index(implant))
wx.PostEvent(self.mainFrame, fv.FitChanged(fitID=fitID))
def click(self, event):
@@ -104,4 +107,3 @@ class ImplantView(d.Display):
menu = ContextMenu.getMenu((fit.implants[sel],), "implant")
self.PopupMenu(menu)