From 72723a1b0cdd55859a4957f31290e00f45f60eaa Mon Sep 17 00:00:00 2001 From: vali Date: Sat, 29 Jan 2011 05:24:49 -0500 Subject: [Ai.HD] Add dynamic Picons ServiceSelection-screens --- aihdcontroler/src/comp/valiRefString.py | 52 +++++++++++++++++++++++++ aihdcontroler/src/data/channelselector-full.xml | 9 +++++ aihdcontroler/src/data/channelselector-pig.xml | 15 +++++-- aihdcontroler/src/plugin.py | 3 +- 4 files changed, 75 insertions(+), 4 deletions(-) create mode 100644 aihdcontroler/src/comp/valiRefString.py diff --git a/aihdcontroler/src/comp/valiRefString.py b/aihdcontroler/src/comp/valiRefString.py new file mode 100644 index 0000000..9f3a470 --- /dev/null +++ b/aihdcontroler/src/comp/valiRefString.py @@ -0,0 +1,52 @@ +####################################################################### +# +# +# ReferenceToString for Dreambox/Enigma-2 +# Coded by Vali (c)2011 +# Support: www.dreambox-tools.info +# +# +# This plugin is licensed under the Creative Commons +# Attribution-NonCommercial-ShareAlike 3.0 Unported License. +# To view a copy of this license, visit http://creativecommons.org/licenses/by-nc-sa/3.0/ +# or send a letter to Creative Commons, 559 Nathan Abbott Way, Stanford, California 94305, USA. +# +# Alternatively, this plugin may be distributed and executed on hardware which +# is licensed by Dream Multimedia GmbH. +# +# +# This plugin is NOT free software. It is open source, you are allowed to +# modify it (if you keep the license), but it may not be commercially +# distributed other than under the conditions noted above. +# +# +####################################################################### + +from Components.Converter.Converter import Converter +from Components.Element import cached +from Screens.InfoBar import InfoBar + +class valiRefString(Converter, object): + CURRENT = 0 + EVENT = 1 + def __init__(self, type): + Converter.__init__(self, type) + self.CHANSEL = None + self.type = { + "CurrentRef": self.CURRENT, + "ServicelistRef": self.EVENT + }[type] + + @cached + def getText(self): + if (self.type == self.EVENT): + return str(self.source.service.toString()) + elif (self.type == self.CURRENT): + if self.CHANSEL == None: + self.CHANSEL = InfoBar.instance.servicelist + vSrv = self.CHANSEL.servicelist.getCurrent() + return str(vSrv.toString()) + else: + return "na" + + text = property(getText) diff --git a/aihdcontroler/src/data/channelselector-full.xml b/aihdcontroler/src/data/channelselector-full.xml index d739701..412e426 100644 --- a/aihdcontroler/src/data/channelselector-full.xml +++ b/aihdcontroler/src/data/channelselector-full.xml @@ -12,6 +12,9 @@ LocaleKurz:%w %d %m + + ServicelistRef + @@ -51,6 +54,9 @@ LocaleKurz:%w %d %m + + CurrentRef + @@ -75,6 +81,9 @@ LocaleKurz:%w %d %m + + CurrentRef + diff --git a/aihdcontroler/src/data/channelselector-pig.xml b/aihdcontroler/src/data/channelselector-pig.xml index 7e54710..13cd3c7 100644 --- a/aihdcontroler/src/data/channelselector-pig.xml +++ b/aihdcontroler/src/data/channelselector-pig.xml @@ -4,10 +4,13 @@ - + LocaleLang:%w %d %m + + ServicelistRef + @@ -41,10 +44,13 @@ - + LocaleLang:%w %d %m + + CurrentRef + @@ -66,10 +72,13 @@ - + LocaleLang:%w %d %m + + CurrentRef + diff --git a/aihdcontroler/src/plugin.py b/aihdcontroler/src/plugin.py index f5a9e62..841de9a 100644 --- a/aihdcontroler/src/plugin.py +++ b/aihdcontroler/src/plugin.py @@ -86,7 +86,7 @@ class AIHDsetup(ConfigListScreen, Screen): """ def __init__(self, session): - self.release = ".release20110128" + self.release = ".release20110129" Screen.__init__(self, session) self.session = session self.datei = "/usr/share/enigma2/Ai.HD/skin.xml" @@ -116,6 +116,7 @@ class AIHDsetup(ConfigListScreen, Screen): system('cp ' + self.komponente + 'vhdRendNextEvent.py /usr/lib/enigma2/python/Components/Renderer/vhdRendNextEvent.py') system('cp ' + self.komponente + 'vhdConvSmartInfo.py /usr/lib/enigma2/python/Components/Converter/vhdConvSmartInfo.py') system('cp ' + self.komponente + 'vhdConvClockToText.py /usr/lib/enigma2/python/Components/Converter/vhdConvClockToText.py') + system('cp ' + self.komponente + 'valiRefString.py /usr/lib/enigma2/python/Components/Converter/valiRefString.py') system("touch " + self.datei + self.release) def save(self): -- cgit