offline mode added
git-svn-id: http://www.neo1973-germany.de/svn@13 46df4e5c-bc4e-4628-a0fc-830ba316316d
This commit is contained in:
parent
6e33554db5
commit
fe715867ef
1 changed files with 21 additions and 14 deletions
|
@ -160,6 +160,7 @@ class TestView(edje.Edje):
|
|||
#fill
|
||||
for i in xrange((2*self.border+1)**2):
|
||||
self.icons.append(tile(self.evas_canvas.evas_obj.evas))
|
||||
if not self.options.offline:
|
||||
#add all tiles that are not yet downloaded to a list
|
||||
for i in xrange(2*self.border+1):
|
||||
for j in xrange(2*self.border+1):
|
||||
|
@ -185,10 +186,12 @@ class TestView(edje.Edje):
|
|||
for i in xrange(2*self.border+1):
|
||||
for j in xrange(2*self.border+1):
|
||||
#if some errors occurd replace with placeholder
|
||||
if not os.path.exists("%d/%d/%d.png"%(self.z,self.x+i-self.border,self.y+j-self.border)):
|
||||
self.icons[(2*self.border+1)*i+j].file_set("404.png")
|
||||
else:
|
||||
#if not os.path.exists("%d/%d/%d.png"%(self.z,self.x+i-self.border,self.y+j-self.border)):
|
||||
try:
|
||||
self.icons[(2*self.border+1)*i+j].file_set("%d/%d/%d.png"%(self.z,self.x+i-self.border,self.y+j-self.border))
|
||||
except:
|
||||
self.icons[(2*self.border+1)*i+j].file_set("404.png")
|
||||
|
||||
self.icons[(2*self.border+1)*i+j].set_position((i-self.border)*256+self.size[0]/2-self.offset_x,(j-self.border)*256+self.size[1]/2-self.offset_y)
|
||||
self.icons[(2*self.border+1)*i+j].size = 256,256
|
||||
self.icons[(2*self.border+1)*i+j].fill = 0, 0, 256, 256
|
||||
|
@ -333,6 +336,10 @@ class myOptionParser(OptionParser):
|
|||
"--no-fullscreen",
|
||||
action="store_true",
|
||||
help="do not launch in fullscreen")
|
||||
self.add_option("-o",
|
||||
"--offline",
|
||||
action="store_true",
|
||||
help="do not attempt to download tiles")
|
||||
self.add_option("-g",
|
||||
"--geometry",
|
||||
type="string",
|
||||
|
|
Loading…
Reference in a new issue