Skip to content

Commit

Permalink
cosmetic for synaptic
Browse files Browse the repository at this point in the history
  • Loading branch information
ims committed Jan 8, 2013
1 parent 7f1d930 commit 2812567
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 7 deletions.
23 changes: 17 additions & 6 deletions plugin/ui.py
Expand Up @@ -359,6 +359,7 @@ def __init__(self, session):
self.midx = 0
self.maxMap = 0
self.selection = 0
self.firstSynaptic = False

self.Limited = LimitedDownloader(5) # limit for parallel downloading

Expand Down Expand Up @@ -650,8 +651,14 @@ def setIndex(self):
self.idx = self.startIdx

def afterCfg(self, data=True):
self.displayMeteoType()
if self.isSynaptic:
self.displaySynoptic(True)
self.displayInfo(self.idx+1,self.maxFrames,self.frame[self.idx])
if cfg.display.value > "1":
self["slide"].show()
return

self.displayMeteoType()
if self.lastdir != cfg.tmpdir.value:
self.readFiles(delay=0.5)
if self.filesOK:
Expand Down Expand Up @@ -787,6 +794,7 @@ def redrawBorder(self):
else:
self.picload.startDecode(PPATH + BACKGROUND[len(BACKGROUND)-1])
self.merLoad.startDecode(PPATH + MER[len(TYPE)-1])
self.firstSynaptic = False
else:
if TYPE[self.typ] == "csr":
self.picload.startDecode(PPATH + BACKGROUND[self.typ])
Expand Down Expand Up @@ -847,8 +855,11 @@ def stopSlideShow(self):
if self.isReading:
self.isReading = False
else: # if is not slideshow with STOP button:
if not self.isSynaptic:
self.firstSynaptic = True
self.isSynaptic = True
self.redrawBorder()
if self.firstSynaptic:
self.redrawBorder()
self.displaySynoptic()

def slideShowEvent(self):
Expand Down Expand Up @@ -892,8 +903,10 @@ def readMap(self):
self.map.append(x[0][0][:-4])
self.maxMap += 1

def displaySynoptic(self):
def displaySynoptic(self, decrease=False):
if self.maxMap > 0:
if decrease: # for return from config only
self.midx -= 1
self.isSynaptic = True
path = TMPDIR + SUBDIR + "/" + self.map[self.midx] + ".gif"
if fileExists(path):
Expand All @@ -904,7 +917,6 @@ def displaySynoptic(self):
else:
self.midx = 0


def timeFormat(self, name):
epochTimeUTC = mktime(strptime(name,'%Y%m%d%H%M'))
if cfg.localtime.value:
Expand Down Expand Up @@ -1556,8 +1568,7 @@ def __init__(self, session):

self["key_green"] = Label(_("Save"))
self["key_red"] = Label(_("Cancel"))
self["description"] = Label("")
self["statusbar"] = Label("ims (c) 2012. v1.71")
self["statusbar"] = Label("ims (c) 2012. v1.72")
self["actions"] = ActionMap(["SetupActions", "ColorActions"],
{
"green": self.save,
Expand Down
2 changes: 1 addition & 1 deletion setup.py
Expand Up @@ -3,7 +3,7 @@

pkg = 'Extensions.MeteoViewer'
setup (name = 'enigma2-plugin-extensions-meteoviewer',
version = '1.71',
version = '1.72',
description = 'meteo pictures viewer',
packages = [pkg],
package_dir = {pkg: 'plugin'},
Expand Down

0 comments on commit 2812567

Please sign in to comment.