def getImageId(self, stuff): generic_active = self.fittingView.imageList.GetImageIndex("state_%s_small" % State_.getName(1).lower(), "gui") generic_inactive = self.fittingView.imageList.GetImageIndex("state_%s_small" % State_.getName(-1).lower(), "gui") if isinstance(stuff, Drone): if stuff.amountActive > 0: return generic_active else: return generic_inactive elif isinstance(stuff, Rack): return -1 elif isinstance(stuff, Module): if stuff.isEmpty: return -1 else: return self.fittingView.imageList.GetImageIndex("state_%s_small" % State_.getName(stuff.state).lower(), "gui") elif isinstance(stuff, Fit): fitID = self.mainFrame.getActiveFit() projectionInfo = stuff.getProjectionInfo(fitID) if projectionInfo is None: return -1 if projectionInfo.active: return generic_active return generic_inactive else: active = getattr(stuff, "active", None) if active is None: return -1 if active: return generic_active return generic_inactive
def getImageId(self, stuff): generic_active = self.fittingView.imageList.GetImageIndex("state_%s_small" % State_.getName(1).lower(), "icons") generic_inactive = self.fittingView.imageList.GetImageIndex("state_%s_small" % State_.getName(-1).lower(), "icons") if isinstance(stuff, Drone): if stuff.amountActive > 0: return generic_active else: return generic_inactive elif isinstance(stuff, Rack): return -1 elif isinstance(stuff, Module): if stuff.isEmpty: return -1 else: return self.fittingView.imageList.GetImageIndex("state_%s_small" % State_.getName(stuff.state).lower(), "icons") elif isinstance(stuff, Fit): fitID = self.mainFrame.getActiveFit() projectionInfo = stuff.getProjectionInfo(fitID) if projectionInfo is None: return -1 if projectionInfo.active: return generic_active return generic_inactive else: active = getattr(stuff, "active", None) if active is None: return -1 if active: return generic_active return generic_inactive
def getImageId(self, stuff): generic_active = self.fittingView.imageList.GetImageIndex("state_%s_small" % State_.getName(1).lower(), "gui") generic_inactive = self.fittingView.imageList.GetImageIndex("state_%s_small" % State_.getName(-1).lower(), "gui") if isinstance(stuff, Drone): if stuff.amountActive > 0: return generic_active else: return generic_inactive elif isinstance(stuff, Rack): return -1 elif isinstance(stuff, Module): if stuff.isEmpty: return -1 else: return self.fittingView.imageList.GetImageIndex("state_%s_small" % State_.getName(stuff.state).lower(), "gui") elif isinstance(stuff, Fit): fitID = self.mainFrame.getActiveFit() projectionInfo = stuff.getProjectionInfo(fitID) if projectionInfo is None: return -1 if projectionInfo.active: return generic_active return generic_inactive elif isinstance(stuff, Implant) and stuff.character: # if we're showing character implants, show an "online" state, which should not be changed return self.fittingView.imageList.GetImageIndex("state_%s_small" % State_.getName(0).lower(), "gui") else: active = getattr(stuff, "active", None) if active is None: return -1 if active: return generic_active return generic_inactive
def getImageId(self, stuff): if isinstance(stuff, Drone): return self.checkedId if stuff.amountActive > 0 else self.uncheckedId elif isinstance(stuff, Module): if stuff.isEmpty: return -1 else: return self.fittingView.imageList.GetImageIndex("state_%s_small" % State_.getName(stuff.state).lower(), "icons") else: active = getattr(stuff, "active", None) if active is None: return -1 else: return self.checkedId if active else self.uncheckedId
def getImageId(self, stuff): if isinstance(stuff, Drone): return self.checkedId if stuff.amountActive > 0 else self.uncheckedId elif isinstance(stuff, Module): if stuff.isEmpty: return -1 else: return self.fittingView.imageList.GetImageIndex( "state_%s_small" % State_.getName(stuff.state).lower(), "icons") else: active = getattr(stuff, "active", None) if active is None: return -1 else: return self.checkedId if active else self.uncheckedId
def getToolTip(self, mod): if isinstance(mod, Module) and not mod.isEmpty: return State_.getName(mod.state).title()