From fc9a5bde3a015f84d1aded429e4ed5568c708e31 Mon Sep 17 00:00:00 2001 From: cncfanatics Date: Thu, 21 Oct 2010 10:29:43 +0200 Subject: [PATCH] Fix some bugs with market group jump --- gui/builtinContextMenus/marketJump.py | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/gui/builtinContextMenus/marketJump.py b/gui/builtinContextMenus/marketJump.py index 889107475..3962ab40e 100644 --- a/gui/builtinContextMenus/marketJump.py +++ b/gui/builtinContextMenus/marketJump.py @@ -8,12 +8,19 @@ class MarketJump(ContextMenu): self.mainFrame = gui.mainFrame.MainFrame.getInstance() def display(self, context, selection): - return context in ("module", "ammo", "itemSearch") + return context in ("module", "ammo", "itemSearch") and (not selection[0].isEmpty if context == "module" else True) def getText(self, context, selection): return "Jump to %s Market Group" % (context.capitalize() if context != "itemSearch" else "Item") def activate(self, context, selection, i): - self.mainFrame.marketBrowser.jump(selection[0]) + if context == "module": + item = selection[0].item + elif context == "ammo": + item = selection[0].charge + else: + item = selection[0] + + self.mainFrame.marketBrowser.jump(item) MarketJump.register()