X-Git-Url: http://code.vuplus.com/gitweb/?a=blobdiff_plain;f=lib%2Fpython%2FPlugins%2FExtensions%2FPicturePlayer%2Fplugin.py;h=10e4e514adc19a7856c6dd9c18e9f8b092cc902d;hb=bce53d4a67d1655a496eebe5912c8573e880114e;hp=7d62d2beabce17b69734f6f5f2f823c78a84bbe9;hpb=5eb41508927a7f48d09d52e158e136fa07252dac;p=vuplus_dvbapp diff --git a/lib/python/Plugins/Extensions/PicturePlayer/plugin.py b/lib/python/Plugins/Extensions/PicturePlayer/plugin.py index 7d62d2b..10e4e51 100644 --- a/lib/python/Plugins/Extensions/PicturePlayer/plugin.py +++ b/lib/python/Plugins/Extensions/PicturePlayer/plugin.py @@ -1,7 +1,7 @@ from enigma import ePicLoad, eTimer, getDesktop from Screens.Screen import Screen -from Tools.Directories import resolveFilename, pathExists, SCOPE_MEDIA +from Tools.Directories import resolveFilename, pathExists, fileExists, SCOPE_MEDIA from Plugins.Plugin import PluginDescriptor from Components.Pixmap import Pixmap, MovingPixmap @@ -15,7 +15,7 @@ from Components.ConfigList import ConfigList from Components.config import config, ConfigSubsection, ConfigInteger, ConfigSelection, ConfigText, ConfigEnableDisable, KEY_LEFT, KEY_RIGHT, KEY_0, getConfigListEntry -def getAspectforPic(): +def getScale(): return AVSwitch().getFramebufferScale() config.pic = ConfigSubsection() @@ -91,8 +91,9 @@ class picshow(Screen): def showThumb(self): if not self.filelist.canDescent(): - if self.picload.getThumbnail(self.filelist.getCurrentDirectory() + self.filelist.getFilename()) == 1: - self.ThumbTimer.start(500, True) + if self.filelist.getCurrentDirectory() and self.filelist.getFilename(): + if self.picload.getThumbnail(self.filelist.getCurrentDirectory() + self.filelist.getFilename()) == 1: + self.ThumbTimer.start(500, True) def selectionChanged(self): if not self.filelist.canDescent(): @@ -119,8 +120,9 @@ class picshow(Screen): self.session.openWithCallback(self.callbackView, Pic_Full_View, self.filelist.getFileList(), self.filelist.getSelectionIndex(), self.filelist.getCurrentDirectory()) def setConf(self): + sc = getScale() #0=Width 1=Height 2=Aspect 3=use_cache 4=resize_type 5=Background(#AARRGGBB) - self.picload.setPara([self["thn"].instance.size().width(), self["thn"].instance.size().height(), getAspectforPic(), config.pic.cache.value, int(config.pic.resize.value), "#00000000"]) + self.picload.setPara((self["thn"].instance.size().width(), self["thn"].instance.size().height(), sc[0], sc[1], config.pic.cache.value, int(config.pic.resize.value), "#00000000")) def callbackView(self, val=0): if val > 0: @@ -201,7 +203,7 @@ class Pic_Exif(Screen): "cancel": self.close }, -1) - exifdesc = [_("Filename:"), "EXIF-Version:", "Make:", "Camera:", "Date/Time:", "Width / Height:", "Flash used:", "Orientation:", "User Comments:", "Metering Mode:", "Exposure Program:", "Light Source:", "CompressedBitsPerPixel:", "ISO Speed Rating:", "X-Resolution:", "Y-Resolution:", "Resolution Unit:", "Brightness:", "Exposure Time:", "Exposure Bias:", "Distance:", "CCD-Width:", "ApertureFNumber:"] + exifdesc = [_("filename")+':', "EXIF-Version:", "Make:", "Camera:", "Date/Time:", "Width / Height:", "Flash used:", "Orientation:", "User Comments:", "Metering Mode:", "Exposure Program:", "Light Source:", "CompressedBitsPerPixel:", "ISO Speed Rating:", "X-Resolution:", "Y-Resolution:", "Resolution Unit:", "Brightness:", "Exposure Time:", "Exposure Bias:", "Distance:", "CCD-Width:", "ApertureFNumber:"] list = [] for x in range(len(exiflist)): @@ -311,10 +313,10 @@ class Pic_Thumb(Screen): self.ThumbTimer.callback.append(self.showPic) def setPicloadConf(self): - self.picload.setPara([self["thumb0"].instance.size().width(), self["thumb0"].instance.size().height(), getAspectforPic(), config.pic.cache.value, int(config.pic.resize.value), self.color]) + sc = getScale() + self.picload.setPara([self["thumb0"].instance.size().width(), self["thumb0"].instance.size().height(), sc[0], sc[1], config.pic.cache.value, int(config.pic.resize.value), self.color]) self.paintFrame() - - + def paintFrame(self): #print "index=" + str(self.index) if self.maxentry < self.index or self.index < 0: @@ -450,6 +452,11 @@ class Pic_Full_View(Screen): self.filelist.append(path + x[0][0]) else: self.dirlistcount += 1 + elif len(filelist[0]) == 2: #scanlist + if x[0][1] == False: + self.filelist.append(x[0][0]) + else: + self.dirlistcount += 1 else: # thumbnaillist self.filelist.append(x[T_FULL]) @@ -468,7 +475,8 @@ class Pic_Full_View(Screen): self.onLayoutFinish.append(self.setPicloadConf) def setPicloadConf(self): - self.picload.setPara([self["pic"].instance.size().width(), self["pic"].instance.size().height(), getAspectforPic(), 0, int(config.pic.resize.value), self.bgcolor]) + sc = getScale() + self.picload.setPara([self["pic"].instance.size().width(), self["pic"].instance.size().height(), sc[0], sc[1], 0, int(config.pic.resize.value), self.bgcolor]) self["play_icon"].hide() if config.pic.infoline.value == False: @@ -578,7 +586,7 @@ def filescan(**kwargs): ScanPath(path = "", with_subdirs = False), ], name = "Pictures", - description = "View Photos...", + description = _("View Photos..."), openfnc = filescan_open, )