From 224bbca86e1eabf7b0fcbb2777f74457641d0985 Mon Sep 17 00:00:00 2001 From: Weeknie Date: Tue, 26 Oct 2010 14:46:52 +0200 Subject: [PATCH] Implants are now sorted by implant slot, ticket 140 --- eos | 2 +- gui/implantView.py | 8 +++++--- 2 files changed, 6 insertions(+), 4 deletions(-) diff --git a/eos b/eos index 4b5c3136e..dd3cadec0 160000 --- a/eos +++ b/eos @@ -1 +1 @@ -Subproject commit 4b5c3136e778342ba64425aa34c09353c5957d37 +Subproject commit dd3cadec0f0320c22bce42867f18b4a98c931f89 diff --git a/gui/implantView.py b/gui/implantView.py index b207f2ca5..b06d53f12 100644 --- a/gui/implantView.py +++ b/gui/implantView.py @@ -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) -