From ba3a316a4ef60ea02aa50cb65dc5962490514baa Mon Sep 17 00:00:00 2001 From: HomeWorld Date: Wed, 27 Oct 2010 21:55:28 +0300 Subject: [PATCH] Check if list is empty, show stage1 --- gui/shipBrowser.py | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/gui/shipBrowser.py b/gui/shipBrowser.py index c1290322f..a4a0063de 100644 --- a/gui/shipBrowser.py +++ b/gui/shipBrowser.py @@ -150,7 +150,7 @@ class ShipBrowser(wx.Panel): self._stage3ShipName = shipName self._stage3Data = shipID - + for ID, name in fitList: self.lpane.AddWidget(FitItem(self.lpane, ID, (shipName, name),shipID)) @@ -297,8 +297,11 @@ class HeaderPane (wx.Panel): search = self.search.GetValue() if len(search) < 3 and len(search) > 0: if self.inSearch == True: - stage,data = self.shipBrowser.browseHist.pop() - self.gotoStage(stage,data) + if len(self.shipBrowser.browseHist) > 0: + stage,data = self.shipBrowser.browseHist.pop() + self.gotoStage(stage,data) + else: + self.gotoStage(1,0) self.inSearch = False else: @@ -911,7 +914,7 @@ class ShipItem(wx.Window): ypos += ytext - mdc.SetFont(wx.Font(8, wx.SWISS, wx.NORMAL, wx.NORMAL, False)) + mdc.SetFont(wx.Font(7, wx.SWISS, wx.NORMAL, wx.NORMAL, False)) if fittings <1: fformat = "No fits" @@ -928,8 +931,6 @@ class ShipItem(wx.Window): mdc.DrawText(fformat %fittings if fittings >0 else fformat, textStart, ypos) -# mdc.SetFont(wx.Font(7, wx.SWISS, wx.NORMAL, wx.NORMAL, False)) - self.editPosX = rect.width - 20 self.editPosY = (rect.height - 16) / 2