From b6e37ef434f8678c07126c39784d6048d0bd34c0 Mon Sep 17 00:00:00 2001 From: cncfanatics Date: Mon, 4 Oct 2010 16:30:53 +0200 Subject: [PATCH] Item stats context menu tweaks --- gui/fittingView.py | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/gui/fittingView.py b/gui/fittingView.py index 5fa5ea565..7f3e48843 100644 --- a/gui/fittingView.py +++ b/gui/fittingView.py @@ -118,17 +118,17 @@ class FittingView(d.Display): cFit = service.Fit.getInstance() selection = [] sel = self.GetFirstSelected() - ammo = False - while sel != -1: + contexts = [] + if sel != -1: mod = self.mods[self.GetItemData(sel)] - if ammo is False and mod.charge is not None: - ammo = True + if not mod.isEmpty: + contexts.add("module") + if mod.charge is not None and "ammo" not in contexts: + contexts.add("ammo") - selection.append(mod) - sel = self.GetNextSelected(sel) + selection.append(mod) - if ammo: - menu = ContextMenu.getMenu(selection, "module", "ammo", "ship") - else: - menu = ContextMenu.getMenu(selection, "module", "ship") + contexts.append("ship") + + menu = ContextMenu.getMenu(selection, *contexts) self.PopupMenu(menu) \ No newline at end of file