Make hidepip when pig configurable via a skin attribute
authorlittlesat <littlesat99@yahoo.com>
Thu, 3 Jul 2014 20:54:36 +0000 (22:54 +0200)
committerlittlesat <littlesat99@yahoo.com>
Thu, 3 Jul 2014 20:54:36 +0000 (22:54 +0200)
With the attribute hidePip="0" you are able in a skin to disable the new
hide Pip when Pig function. see

http://openpli.org/forums/topic/29948-mymetrix-2014-en-open-store/page-4
around #64

example:
<widget source="session.VideoPicture" render="Pig" position="25,98" size="440,248" backgroundColor="transparent" zPosition="2" hidePip="0"/>

lib/python/Components/Renderer/Pig.py
skin.py

index 493391d..b884d53 100644 (file)
@@ -4,6 +4,7 @@
 from Renderer import Renderer
 from enigma import eVideoWidget, eSize, eRect, ePoint, getDesktop
 from Screens.PictureInPicture import PipPigMode
+from Components.config import config
 
 class Pig(Renderer):
        def __init__(self):
@@ -30,9 +31,9 @@ class Pig(Renderer):
                                self.instance.resize(self.Size)
                        if self.Position:
                                self.instance.move(self.Position)
-                       PipPigMode(True)
+                       config.skin.hide_pip_when_pig.value and PipPigMode(True)
 
        def onHide(self):
                if self.instance:
                        self.preWidgetRemove(self.instance)
-                       PipPigMode(False)
+                       config.skin.hide_pip_when_pig.value and PipPigMode(False)
\ No newline at end of file
diff --git a/skin.py b/skin.py
index 2b44e8b..54e3b22 100644 (file)
--- a/skin.py
+++ b/skin.py
@@ -6,7 +6,7 @@ import os
 profile("LOAD:enigma_skin")
 from enigma import eSize, ePoint, eRect, gFont, eWindow, eLabel, ePixmap, eWindowStyleManager, \
        addFont, gRGB, eWindowStyleSkinned, getDesktop
-from Components.config import ConfigSubsection, ConfigText, config
+from Components.config import ConfigSubsection, ConfigText, config, ConfigYesNo
 from Components.Converter.Converter import Converter
 from Components.Sources.Source import Source, ObsoleteSource
 from Tools.Directories import resolveFilename, SCOPE_SKIN, SCOPE_SKIN_IMAGE, SCOPE_FONTS, SCOPE_CURRENT_SKIN, SCOPE_CONFIG, fileExists
@@ -74,6 +74,7 @@ if not fileExists(resolveFilename(SCOPE_SKIN, DEFAULT_SKIN)):
        # in that case, fallback to Magic (which is an SD skin)
        DEFAULT_SKIN = "Magic/skin.xml"
 config.skin.primary_skin = ConfigText(default=DEFAULT_SKIN)
+config.skin.hide_pip_when_pig = ConfigYesNo(True)
 
 profile("LoadSkin")
 try:
@@ -394,6 +395,8 @@ class AttributeParser:
                self.guiObject.setShadowOffset(parsePosition(value, self.scale))
        def noWrap(self, value):
                self.guiObject.setNoWrap(1)
+       def hidePip(self, value):
+               config.skin.hide_pip_when_pig.value = value == 1 or False
 
 def applySingleAttribute(guiObject, desktop, attrib, value, scale = ((1,1),(1,1))):
        # Someone still using applySingleAttribute?