Fix situation in which module prices are fetched individually (which the price column). Instead, have them wait in a queue that is processed when the entire fit is called and calculated (with the price pane). Also adds a little refresh icon to know that prices are updating and it's not just blank (might change)
This commit is contained in:
@@ -50,12 +50,15 @@ class Price(ViewColumn):
|
||||
return formatAmount(price, 3, 3, 9, currency=True)
|
||||
|
||||
def delayedText(self, mod, display, colItem):
|
||||
def callback(requests):
|
||||
price = requests[0].price
|
||||
sMkt = service.Market.getInstance()
|
||||
def callback(item):
|
||||
price = sMkt.getPriceNow(item.ID).price
|
||||
colItem.SetText(formatAmount(price, 3, 3, 9, currency=True) if price else "")
|
||||
colItem.SetImage(-1)
|
||||
display.SetItem(colItem)
|
||||
|
||||
service.Market.getInstance().getPrices([mod.item.ID], callback)
|
||||
sMkt.waitForPrice(mod.item, callback)
|
||||
return self.fittingView.imageList.GetImageIndex("refresh_small", "icons")
|
||||
|
||||
def getImageId(self, mod):
|
||||
return -1
|
||||
|
||||
Reference in New Issue
Block a user