From 29aa71c4eb9537986e58dd39c238923e44c942f9 Mon Sep 17 00:00:00 2001 From: cncfanatics Date: Mon, 11 Oct 2010 12:43:34 +0200 Subject: [PATCH] Differentiate search & market browser for context menus --- gui/builtinContextMenus/itemStats.py | 6 +++--- gui/marketBrowser.py | 4 ++-- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/gui/builtinContextMenus/itemStats.py b/gui/builtinContextMenus/itemStats.py index 0615ec09b..c4a140dda 100755 --- a/gui/builtinContextMenus/itemStats.py +++ b/gui/builtinContextMenus/itemStats.py @@ -8,10 +8,10 @@ class ItemStats(ContextMenu): self.mainFrame = gui.mainFrame.MainFrame.getInstance() def display(self, context, selection): - return context in ("item", "ship", "module", "ammo", "skill") + return context in ("item", "ship", "module", "ammo", "skill", "itemSearch") def getText(self, context, selection): - return "%s stats" % context.capitalize() + return "%s stats" % (context.capitalize() if context != "itemSearch" else "Item") def activate(self, context, selection, i): if context == "ship": @@ -24,6 +24,6 @@ class ItemStats(ContextMenu): if context == "module" and stuff.isEmpty: return - dlg=ItemStatsDialog(stuff, context) + dlg=ItemStatsDialog(stuff, context if context != "itemSearch" else "Item") ItemStats.register() diff --git a/gui/marketBrowser.py b/gui/marketBrowser.py index 64471e96a..1cf31b04a 100644 --- a/gui/marketBrowser.py +++ b/gui/marketBrowser.py @@ -138,7 +138,7 @@ class MarketBrowser(wx.Panel): def addItemViewImage(self, iconFile): if iconFile is None: return -1 - + return self.itemImageList.Add(iconFile, "pack") def expandLookup(self, event): @@ -316,7 +316,7 @@ class MarketBrowser(wx.Panel): selection.append(cMarket.getItem(itemId)) if len(selection) == 0: return - menu = ContextMenu.getMenu(selection, "item") + menu = ContextMenu.getMenu(selection, "item" if self.searching is False else "itemSearch") self.PopupMenu(menu) def itemActivated(self, event):