From 9075ae23fbab6ea776b3fa39e2d64f9fa98a96c4 Mon Sep 17 00:00:00 2001 From: DarkPhoenix Date: Tue, 22 Nov 2011 00:29:02 +0400 Subject: [PATCH 1/2] Add method to load fleet data of the fit --- service/fleet.py | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/service/fleet.py b/service/fleet.py index 9d6c290f4..243f1eab0 100644 --- a/service/fleet.py +++ b/service/fleet.py @@ -168,3 +168,12 @@ class Fleet(object): if squad.leader is None and wing.leader is None and fleet.leader is None: return False return True + + def loadLinearFleet(self, fit): + if self.isInLinearFleet(fit) is False: + return None + squadID = eos.db.getSquadsIDsWithFitID(fit.ID)[0] + s = eos.db.getSquad(squadID) + w = s.wing + f = w.gang + return (f.leader, w.leader, s.leader) From 421229983cccc86b359e9ee8191e1055af78e902 Mon Sep 17 00:00:00 2001 From: DarkPhoenix Date: Tue, 22 Nov 2011 00:55:48 +0400 Subject: [PATCH 2/2] Move context check for market group menu to earlier stage --- gui/builtinContextMenus/marketJump.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/gui/builtinContextMenus/marketJump.py b/gui/builtinContextMenus/marketJump.py index d999cf27f..57576813b 100644 --- a/gui/builtinContextMenus/marketJump.py +++ b/gui/builtinContextMenus/marketJump.py @@ -10,11 +10,13 @@ class MarketJump(ContextMenu): def display(self, srcContext, selection): validContexts = ("marketItemMisc", "fittingModule", "fittingCharge", "droneItem", "implantItem", "boosterItem", "projectedModule", "projectedDrone", "projectedCharge") + if not srcContext in validContexts: + return False sMkt = service.Market.getInstance() if selection is None or len(selection) < 1: return False item = getattr(selection[0], "item", selection[0]) - doit = srcContext in validContexts and (not selection[0].isEmpty if srcContext == "fittingModule" else True) \ + doit = not selection[0].isEmpty if srcContext == "fittingModule" else True \ and sMkt.getMarketGroupByItem(item) is not None return doit