diff --git a/gui/marketBrowser.py b/gui/marketBrowser.py index 1a1fcbff8..84878bd16 100644 --- a/gui/marketBrowser.py +++ b/gui/marketBrowser.py @@ -131,14 +131,14 @@ class MarketBrowser(wx.Panel): def jump(self, item): mg = item.marketGroup + cMarket = service.Market.getInstance() if mg is None and item.metaGroup is not None: mg = item.metaGroup.parent.marketGroup - cMarket = service.Market.getInstance() for btn in ("normal", "faction", "complex", "officer"): getattr(self, btn).SetValue(False) cMarket.disableMetaGroup(btn) - metaGroup = item.metaGroup.name.lower() + metaGroup = cMarket.getMetaName(item.metaGroup.ID) getattr(self, metaGroup).SetValue(True) cMarket.activateMetaGroup(metaGroup) self.searching = False @@ -151,11 +151,16 @@ class MarketBrowser(wx.Panel): jumpList.append(mg.ID) mg = mg.parent + cMarket.MARKET_GROUPS + for id in cMarket.MARKET_GROUPS: + if id in jumpList: + jumpList = jumpList[:jumpList.index(id)+1] + item = self.marketRoot for i in range(len(jumpList) -1, -1, -1): target = jumpList[i] child, cookie = self.marketView.GetFirstChild(item) - while self.marketView.GetItemPyData(child) != target and child.IsOk(): + while self.marketView.GetItemPyData(child) != target: child, cookie = self.marketView.GetNextChild(item, cookie) item = child diff --git a/service/market.py b/service/market.py index f8c7fac44..51f5c17df 100644 --- a/service/market.py +++ b/service/market.py @@ -176,6 +176,13 @@ class Market(): def getGroup(self, groupId): return eos.db.getGroup(groupId) + MARKET_GROUPS = (9, #Modules + 1111, #Rigs + 157, #Drones + 11, #Ammo + 1112, #Subsystems + 24) #Implants & Boosters + def getMarketRoot(self): """ Get the root of the market tree. @@ -183,14 +190,9 @@ class Market(): the ID, the name and the icon of the group """ - marketGroups = (9, #Modules - 1111, #Rigs - 157, #Drones - 11, #Ammo - 1112, #Subsystems - 24) #Implants & Boosters + root = [] - for id in marketGroups: + for id in self.MARKET_GROUPS: mg = eos.db.getMarketGroup(id, eager="icon") root.append((id, mg.name, self.figureIcon(mg)))