From 3af87925568c8e7ec75a5e07bb5e7afbe659683d Mon Sep 17 00:00:00 2001 From: DarkPhoenix Date: Mon, 25 Apr 2011 10:41:55 +0400 Subject: [PATCH] Revert "Implement basic context meenu sorting (by source context only for now)" This reverts commit a2bba4819061ef83dfd5af35297d77369c9ee7a7. --- gui/builtinContextMenus/__init__.py | 1 - gui/contextMenu.py | 17 ++--------------- 2 files changed, 2 insertions(+), 16 deletions(-) diff --git a/gui/builtinContextMenus/__init__.py b/gui/builtinContextMenus/__init__.py index dbe9e79be..808202464 100644 --- a/gui/builtinContextMenus/__init__.py +++ b/gui/builtinContextMenus/__init__.py @@ -1,3 +1,2 @@ __all__ = ["moduleAmmoPicker", "itemStats", "damagePattern", "marketJump", "droneSplit", "ammoPattern", "project", "factorReload"] -srcContextOrder = ("fittingModule", "fittingCharge", "fittingShip") diff --git a/gui/contextMenu.py b/gui/contextMenu.py index 0fbc73c8c..9f0a8d7bd 100644 --- a/gui/contextMenu.py +++ b/gui/contextMenu.py @@ -18,7 +18,6 @@ #=============================================================================== import wx -import gui.builtinContextMenus class ContextMenu(object): menus = [] @@ -33,19 +32,7 @@ class ContextMenu(object): menu.selection = selection empty = True menu.Bind(wx.EVT_MENU, cls.handler) - # Reorder list of contexts - fullContexts = set(fullContexts) - orderedFullContexts = [] - for srcContext in gui.builtinContextMenus.srcContextOrder: - # Compose list of matches against scrContext in provided list of full contexts - filtered = filter(lambda item: item[0] == srcContext, fullContexts) - # Append them to reordered list and remove from source - for match in filtered: - orderedFullContexts.append(match) - fullContexts.discard(match) - # Combine both lists - orderedFullContexts += fullContexts - for i, fullContext in enumerate(orderedFullContexts): + for i, fullContext in enumerate(fullContexts): amount = 0 srcContext = fullContext[0] try: @@ -83,7 +70,7 @@ class ContextMenu(object): empty = False - if amount > 0 and i != len(orderedFullContexts) - 1: + if amount > 0 and i != len(fullContexts) - 1: menu.AppendSeparator() return menu if empty is False else None