Merge branch 'vuplus_experimental' of code.vuplus.com:/opt/repository/dvbapp into...
authorChang.H.S <jhs@dev3>
Fri, 29 Jun 2012 09:17:29 +0000 (18:17 +0900)
committerChang.H.S <jhs@dev3>
Fri, 29 Jun 2012 09:17:29 +0000 (18:17 +0900)
configure.ac
lib/python/Plugins/SystemPlugins/Makefile.am
lib/python/Plugins/SystemPlugins/ZappingModeSelection/Makefile.am [new file with mode: 0644]
lib/python/Plugins/SystemPlugins/ZappingModeSelection/__init__.py [new file with mode: 0644]
lib/python/Plugins/SystemPlugins/ZappingModeSelection/meta/Makefile.am [new file with mode: 0644]
lib/python/Plugins/SystemPlugins/ZappingModeSelection/meta/plugin_zappingmodeselection.xml [new file with mode: 0644]
lib/python/Plugins/SystemPlugins/ZappingModeSelection/plugin.py [new file with mode: 0644]

index 76585fa..ab3b786 100644 (file)
@@ -263,6 +263,8 @@ lib/python/Plugins/SystemPlugins/3GModemManager/meta/Makefile
 lib/python/Plugins/SystemPlugins/3GModemManager/script/Makefile
 lib/python/Plugins/SystemPlugins/WirelessAccessPoint/Makefile
 lib/python/Plugins/SystemPlugins/WirelessAccessPoint/meta/Makefile
+lib/python/Plugins/SystemPlugins/ZappingModeSelection/Makefile
+lib/python/Plugins/SystemPlugins/ZappingModeSelection/meta/Makefile
 lib/python/Tools/Makefile
 lib/service/Makefile
 lib/components/Makefile
index 7e31a15..428783b 100755 (executable)
@@ -6,7 +6,7 @@ SUBDIRS = SoftwareManager FrontprocessorUpgrade PositionerSetup Satfinder \
        CrashlogAutoSubmit CleanupWizard VideoEnhancement WirelessLan NetworkWizard \
        TempFanControl FactoryTest Fancontrol FPGAUpgrade WirelessLanSetup ManualFancontrol \
        Blindscan RemoteControlCode UI3DSetup UIPositionSetup HDMICEC LEDBrightnessSetup \
-       FirmwareUpgrade CrashReport 3GModemManager WirelessAccessPoint
+       FirmwareUpgrade CrashReport 3GModemManager WirelessAccessPoint ZappingModeSelection
 
 install_PYTHON =       \
        __init__.py
diff --git a/lib/python/Plugins/SystemPlugins/ZappingModeSelection/Makefile.am b/lib/python/Plugins/SystemPlugins/ZappingModeSelection/Makefile.am
new file mode 100644 (file)
index 0000000..f4c9603
--- /dev/null
@@ -0,0 +1,7 @@
+installdir = $(pkglibdir)/python/Plugins/SystemPlugins/ZappingModeSelection
+
+SUBDIRS = meta
+
+install_PYTHON =  \
+       __init__.py \
+       plugin.py
diff --git a/lib/python/Plugins/SystemPlugins/ZappingModeSelection/__init__.py b/lib/python/Plugins/SystemPlugins/ZappingModeSelection/__init__.py
new file mode 100644 (file)
index 0000000..8d1c8b6
--- /dev/null
@@ -0,0 +1 @@
diff --git a/lib/python/Plugins/SystemPlugins/ZappingModeSelection/meta/Makefile.am b/lib/python/Plugins/SystemPlugins/ZappingModeSelection/meta/Makefile.am
new file mode 100644 (file)
index 0000000..623d015
--- /dev/null
@@ -0,0 +1,3 @@
+installdir = $(datadir)/meta
+
+dist_install_DATA = plugin_zappingmodeselection.xml
diff --git a/lib/python/Plugins/SystemPlugins/ZappingModeSelection/meta/plugin_zappingmodeselection.xml b/lib/python/Plugins/SystemPlugins/ZappingModeSelection/meta/plugin_zappingmodeselection.xml
new file mode 100644 (file)
index 0000000..74bf487
--- /dev/null
@@ -0,0 +1,16 @@
+<default>
+         <prerequisites>
+                    <tag type="System" />
+         </prerequisites>
+          <info>
+                    <author>hschang</author>
+                    <name>ZappingModeSelection</name>
+                    <packagename>enigma2-plugin-systemplugins-zappingmodeselection</packagename>
+                    <shortdescription>Select Zapping Mode</shortdescription>
+                    <description>Select Zapping Mode, HOLD or MUTE</description>
+          </info>
+
+         <files type="package"> <!-- without version, without .ipk -->
+               <file type="package" name="enigma2-plugin-systemplugins-zappingmodeselection" />
+       </files>
+</default>
diff --git a/lib/python/Plugins/SystemPlugins/ZappingModeSelection/plugin.py b/lib/python/Plugins/SystemPlugins/ZappingModeSelection/plugin.py
new file mode 100644 (file)
index 0000000..b0fee9b
--- /dev/null
@@ -0,0 +1,80 @@
+from Screens.Screen import Screen
+from Components.ConfigList import ConfigListScreen
+from Components.config import config, getConfigListEntry, ConfigSubsection, ConfigSelection
+from Components.ActionMap import ActionMap
+from Screens.MessageBox import MessageBox
+from Components.Sources.StaticText import StaticText
+from Plugins.Plugin import PluginDescriptor
+from Tools.Directories import fileExists
+
+config.plugins.zappingModeSelection = ConfigSubsection()
+config.plugins.zappingModeSelection.zappingMode = ConfigSelection(default = "mute", choices = [ ("mute", _("MUTE")), ("hold", _("HOLD"))] )
+
+class ZappingModeSelectionInit:
+       def __init__(self):
+               self.setZappingMode(config.plugins.zappingModeSelection.zappingMode.value)
+
+       def setZappingMode(self, mode = "mute"):
+               if not fileExists("/proc/stb/video/zapping_mode"):
+                       return -1
+               print "<ZappingModeSelection> set zapping mode : %s" % mode
+               f = open("/proc/stb/video/zapping_mode", "w")
+               f.write("%s" % mode)
+               f.close()
+               return 0
+
+class ZappingModeSelection(Screen,ConfigListScreen,ZappingModeSelectionInit):
+       skin =  """
+               <screen position="center,center" size="560,250" title="Zapping Mode Selection" >
+                       <ePixmap pixmap="skin_default/buttons/red.png" position="110,10" size="140,40" alphatest="on" />
+                       <ePixmap pixmap="skin_default/buttons/green.png" position="310,10" size="140,40" alphatest="on" />
+                       <widget source="key_red" render="Label" position="110,10" zPosition="1" size="140,40" font="Regular;20" halign="center" valign="center" backgroundColor="#9f1313" foregroundColor="#ffffff" transparent="1" />
+                       <widget source="key_green" render="Label" position="310,10" zPosition="1" size="140,40" font="Regular;20" halign="center" valign="center" backgroundColor="#1f771f" foregroundColor="#ffffff" transparent="1" />
+                       <widget name="config" zPosition="2" position="5,70" size="550,200" scrollbarMode="showOnDemand" transparent="1" />
+               </screen>
+               """
+
+       def __init__(self,session):
+               Screen.__init__(self,session)
+               self.session = session
+               self["shortcuts"] = ActionMap(["ShortcutActions", "SetupActions" ],
+               {
+                       "ok": self.keySave,
+                       "cancel": self.keyCancel,
+                       "red": self.keyCancel,
+                       "green": self.keySave,
+               }, -2)
+               self.list = []
+               ConfigListScreen.__init__(self, self.list,session = self.session)
+               self["key_red"] = StaticText(_("Cancel"))
+               self["key_green"] = StaticText(_("Ok"))
+               self.createSetup()
+
+       def createSetup(self):
+               self.list = []
+               self.rcsctype = getConfigListEntry(_("Zapping Mode"), config.plugins.zappingModeSelection.zappingMode)
+               self.list.append( self.rcsctype )
+               self["config"].list = self.list
+               self["config"].l.setList(self.list)
+
+       def keySave(self):
+               print "<ZappingModeSelection> Zapping Code : ",config.plugins.zappingModeSelection.zappingMode.value
+               ret = self.setZappingMode(config.plugins.zappingModeSelection.zappingMode.value)
+               if ret == -1:
+                       self.resetConfig()
+                       self.session.openWithCallback(self.close, MessageBox, _("SET FAILED!\nPlease update to the latest driver"), MessageBox.TYPE_ERROR)
+               else:
+                       self.saveAll()
+                       self.close()
+
+       def resetConfig(self):
+               for x in self["config"].list:
+                       x[1].cancel()
+
+def main(session, **kwargs):
+       session.open(ZappingModeSelection)
+
+def Plugins(**kwargs):
+       return [PluginDescriptor(name=_("ZappingModeSelection"), description="Zapping Mode Selection", where = PluginDescriptor.WHERE_PLUGINMENU, needsRestart = False, fnc=main)]
+
+zappingmodeselectioninit = ZappingModeSelectionInit()