X-Git-Url: https://git.cweiske.de/enigma2.git/blobdiff_plain/a50e6cee4c01a0fb96c1446e6f9d39da1e7556c8..089c965d09e2af09a4731ff164e1b68b3daf8047:/lib/python/Plugins/Extensions/PicturePlayer/plugin.py?ds=sidebyside
diff --git a/lib/python/Plugins/Extensions/PicturePlayer/plugin.py b/lib/python/Plugins/Extensions/PicturePlayer/plugin.py
index 3925b07c..5d1c2cba 100755
--- a/lib/python/Plugins/Extensions/PicturePlayer/plugin.py
+++ b/lib/python/Plugins/Extensions/PicturePlayer/plugin.py
@@ -142,36 +142,35 @@ class picshow(Screen):
config.pic.save()
self.close()
+#------------------------------------------------------------------------------------------
class Pic_Setup(Screen, ConfigListScreen):
- skin = """
-
-
-
-
-
-
- """
+
def __init__(self, session):
Screen.__init__(self, session)
+ # for the skin: first try MediaPlayerSettings, then Setup, this allows individual skinning
+ self.skinName = ["PicturePlayerSetup", "Setup" ]
+ self.setup_title = _("Settings")
+ self.onChangedEntry = [ ]
self.session = session
- self["actions"] = ActionMap(["SetupActions", "ColorActions"],
+ self["actions"] = ActionMap(["SetupActions"],
{
"cancel": self.keyCancel,
"save": self.keySave,
+ "ok": self.keySave,
}, -2)
self["key_red"] = StaticText(_("Cancel"))
self["key_green"] = StaticText(_("OK"))
self.list = []
- ConfigListScreen.__init__(self, self.list, session = self.session)
+ ConfigListScreen.__init__(self, self.list, session = self.session, on_change = self.changedEntry)
self.createSetup()
self.onLayoutFinish.append(self.layoutFinished)
def layoutFinished(self):
- self.setTitle(_("Settings"))
+ self.setTitle(self.setup_title)
def createSetup(self):
self.list = []
@@ -192,6 +191,22 @@ class Pic_Setup(Screen, ConfigListScreen):
def keyRight(self):
ConfigListScreen.keyRight(self)
+ # for summary:
+ def changedEntry(self):
+ for x in self.onChangedEntry:
+ x()
+
+ def getCurrentEntry(self):
+ return self["config"].getCurrent()[0]
+
+ def getCurrentValue(self):
+ return str(self["config"].getCurrent()[1].getText())
+
+ def createSummary(self):
+ from Screens.Setup import SetupSummary
+ return SetupSummary
+
+#---------------------------------------------------------------------------
class Pic_Exif(Screen):
skin = """
@@ -212,7 +227,7 @@ class Pic_Exif(Screen):
def __init__(self, session, exiflist):
Screen.__init__(self, session)
- self["actions"] = ActionMap(["OkCancelActions"],
+ self["actions"] = ActionMap(["SetupActions", "ColorActions"],
{
"cancel": self.close
}, -1)
@@ -234,6 +249,7 @@ class Pic_Exif(Screen):
def layoutFinished(self):
self.setTitle(_("Info"))
+#----------------------------------------------------------------------------------------
T_INDEX = 0
T_FRAME_POS = 1
@@ -251,13 +267,13 @@ class Pic_Thumb(Screen):
self.picX = 190
self.spaceY = 30
self.picY = 200
-
+
size_w = getDesktop(0).size().width()
size_h = getDesktop(0).size().height()
self.thumbsX = size_w / (self.spaceX + self.picX) # thumbnails in X
self.thumbsY = size_h / (self.spaceY + self.picY) # thumbnails in Y
self.thumbsC = self.thumbsX * self.thumbsY # all thumbnails
-
+
self.positionlist = []
skincontent = ""
@@ -267,21 +283,19 @@ class Pic_Thumb(Screen):
posX += 1
if posX >= self.thumbsX:
posX = 0
-
+
absX = self.spaceX + (posX*(self.spaceX + self.picX))
absY = self.spaceY + (posY*(self.spaceY + self.picY))
self.positionlist.append((absX, absY))
skincontent += ""
-
skincontent += ""
-
-
+
# Screen, backgroundlabel and MovingPixmap
self.skin = " \
" + skincontent + ""
-
+
Screen.__init__(self, session)
-
+
self["actions"] = ActionMap(["OkCancelActions", "ColorActions", "DirectionActions", "MovieSelectionActions"],
{
"cancel": self.Exit,
@@ -292,12 +306,12 @@ class Pic_Thumb(Screen):
"down": self.key_down,
"showEventInfo": self.StartExif,
}, -1)
-
+
self["frame"] = MovingPixmap()
for x in range(self.thumbsC):
self["label"+str(x)] = StaticText()
self["thumb"+str(x)] = Pixmap()
-
+
self.Thumbnaillist = []
self.filelist = []
self.currPage = -1
@@ -317,7 +331,7 @@ class Pic_Thumb(Screen):
Page += 1
else:
self.dirlistcount += 1
-
+
self.maxentry = len(self.filelist)-1
self.index = lastindex - self.dirlistcount
if self.index < 0:
@@ -325,9 +339,9 @@ class Pic_Thumb(Screen):
self.picload = ePicLoad()
self.picload.PictureData.get().append(self.showPic)
-
+
self.onLayoutFinish.append(self.setPicloadConf)
-
+
self.ThumbTimer = eTimer()
self.ThumbTimer.callback.append(self.showPic)
@@ -344,7 +358,7 @@ class Pic_Thumb(Screen):
pos = self.positionlist[self.filelist[self.index][T_FRAME_POS]]
self["frame"].moveTo( pos[0], pos[1], 1)
self["frame"].startMoving()
-
+
if self.currPage != self.filelist[self.index][T_PAGE]:
self.currPage = self.filelist[self.index][T_PAGE]
self.newPage()
@@ -360,7 +374,7 @@ class Pic_Thumb(Screen):
if x[T_PAGE] == self.currPage:
self["label"+str(x[T_FRAME_POS])].setText("(" + str(x[T_INDEX]+1) + ") " + x[T_NAME])
self.Thumbnaillist.append([0, x[T_FRAME_POS], x[T_FULL]])
-
+
#paint Thumbnail start
self.showPic()
@@ -384,19 +398,19 @@ class Pic_Thumb(Screen):
if self.index < 0:
self.index = self.maxentry
self.paintFrame()
-
+
def key_right(self):
self.index += 1
if self.index > self.maxentry:
self.index = 0
self.paintFrame()
-
+
def key_up(self):
self.index -= self.thumbsX
if self.index < 0:
self.index =self.maxentry
self.paintFrame()
-
+
def key_down(self):
self.index += self.thumbsX
if self.index > self.maxentry:
@@ -432,7 +446,7 @@ class Pic_Full_View(Screen):
space = config.pic.framesize.value
size_w = getDesktop(0).size().width()
size_h = getDesktop(0).size().height()
-
+
self.skin = " \
\
\
@@ -440,7 +454,7 @@ class Pic_Full_View(Screen):
"
Screen.__init__(self, session)
-
+
self["actions"] = ActionMap(["OkCancelActions", "ColorActions", "DirectionActions", "MovieSelectionActions"],
{
"cancel": self.Exit,
@@ -452,12 +466,12 @@ class Pic_Full_View(Screen):
"right": self.nextPic,
"showEventInfo": self.StartExif,
}, -1)
-
+
self["point"] = Pixmap()
self["pic"] = Pixmap()
self["play_icon"] = Pixmap()
self["file"] = StaticText(_("please wait, loading picture..."))
-
+
self.old_index = 0
self.filelist = []
self.lastindex = index
@@ -483,10 +497,10 @@ class Pic_Full_View(Screen):
self.index = index - self.dirlistcount
if self.index < 0:
self.index = 0
-
+
self.picload = ePicLoad()
self.picload.PictureData.get().append(self.finish_decode)
-
+
self.slideTimer = eTimer()
self.slideTimer.callback.append(self.slidePic)
@@ -496,7 +510,7 @@ class Pic_Full_View(Screen):
def setPicloadConf(self):
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:
self["file"].setText("")
@@ -509,10 +523,10 @@ class Pic_Full_View(Screen):
self.lastindex = self.currPic[1]
self["pic"].instance.setPixmap(self.currPic[2].__deref__())
self.currPic = []
-
+
self.next()
self.start_decode()
-
+
def finish_decode(self, picInfo=""):
self["point"].hide()
ptr = self.picload.getData()
@@ -569,7 +583,7 @@ class Pic_Full_View(Screen):
def nextPic(self):
self.shownow = True
self.ShowPicture()
-
+
def StartExif(self):
if self.maxentry < 0:
return