Differentiate search & market browser for context menus
This commit is contained in:
@@ -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()
|
||||
|
||||
@@ -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):
|
||||
|
||||
Reference in New Issue
Block a user