Check if list is empty, show stage1

This commit is contained in:
HomeWorld
2010-10-27 21:55:28 +03:00
parent 658ecdb289
commit ba3a316a4e

View File

@@ -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