From e059c8c7cc96fb2b6ec7299892ab7430d5088177 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Niklas=20B=C3=B6lter?= Date: Wed, 1 Dec 2010 20:10:21 +0100 Subject: [PATCH] refreshPanel+processPrices will now always refresh the panel --- gui/builtinStatsViews/priceViewFull.py | 31 ++++++++++++++------------ 1 file changed, 17 insertions(+), 14 deletions(-) diff --git a/gui/builtinStatsViews/priceViewFull.py b/gui/builtinStatsViews/priceViewFull.py index 940ae3b75..906aace21 100644 --- a/gui/builtinStatsViews/priceViewFull.py +++ b/gui/builtinStatsViews/priceViewFull.py @@ -137,19 +137,22 @@ class PriceViewFull(StatsView): self._timer.Stop() self.labelEMStatus.SetLabel("") - modPrice = sum(map(lambda p: p.price or 0, prices[1:])) - if self._cachedShip != shipPrice: - self.labelPriceShip.SetLabel("%s ISK" % formatAmount(shipPrice, 3, 3, 9)) - self.labelPriceShip.SetToolTip(wx.ToolTip("%.2f ISK" % shipPrice)) - self._cachedShip = shipPrice - if self._cachedFittings != modPrice: - self.labelPriceFittings.SetLabel("%s ISK" % formatAmount(modPrice, 3, 3, 9)) - self.labelPriceFittings.SetToolTip(wx.ToolTip("%.2f ISK" % modPrice)) - self._cachedFittings = modPrice - if self._cachedTotal != (shipPrice+modPrice): - self.labelPriceTotal.SetLabel("%s ISK" % formatAmount(shipPrice + modPrice, 3, 3, 9)) - self.labelPriceTotal.SetToolTip(wx.ToolTip("%.2f ISK" % (shipPrice + modPrice))) - self._cachedTotal = shipPrice + modPrice - self.panel.Layout() + + if shipPrice == None: + shipPrice = 0 + modPrice = sum(map(lambda p: p.price or 0, prices[1:])) + if self._cachedShip != shipPrice: + self.labelPriceShip.SetLabel("%s ISK" % formatAmount(shipPrice, 3, 3, 9)) + self.labelPriceShip.SetToolTip(wx.ToolTip("%.2f ISK" % shipPrice)) + self._cachedShip = shipPrice + if self._cachedFittings != modPrice: + self.labelPriceFittings.SetLabel("%s ISK" % formatAmount(modPrice, 3, 3, 9)) + self.labelPriceFittings.SetToolTip(wx.ToolTip("%.2f ISK" % modPrice)) + self._cachedFittings = modPrice + if self._cachedTotal != (shipPrice+modPrice): + self.labelPriceTotal.SetLabel("%s ISK" % formatAmount(shipPrice + modPrice, 3, 3, 9)) + self.labelPriceTotal.SetToolTip(wx.ToolTip("%.2f ISK" % (shipPrice + modPrice))) + self._cachedTotal = shipPrice + modPrice + self.panel.Layout() PriceViewFull.register()