<convert type="ClockToText">Default</convert>
</widget>
<!-- tuners in use? -->
- <!-- DEPRECATED widget name="NimA_Active" position="129,6" zPosition="1" size="9,9" pixmap="skin_default/nim_a.png" alphatest="on" /-->
<widget source="session.FrontendInfo" render="Pixmap" position="129,6" zPosition="1" size="9,9" pixmap="skin_default/nim_a.png" alphatest="on" >
<convert type="FrontendInfo">NUMBER</convert>
<convert type="ValueRange">0,0</convert>
<convert type="ConditionalShowHide" />
</widget>
- <!-- DEPRECATED widget name="NimB_Active" position="129,20" zPosition="1" size="9,9" pixmap="skin_default/nim_b.png" alphatest="on" /-->
- <widget source="session.FrontendInfo" render="Pixmap" position="129,6" zPosition="1" size="9,9" pixmap="skin_default/nim_b.png" alphatest="on" >
+ <widget source="session.FrontendInfo" render="Pixmap" position="129,20" zPosition="1" size="9,9" pixmap="skin_default/nim_b.png" alphatest="on" >
<convert type="FrontendInfo">NUMBER</convert>
<convert type="ValueRange">1,1</convert>
<convert type="ConditionalShowHide" />
</widget>
- <!-- DEPRECATED widget name="NimA" position="142,6" zPosition="1" size="8,9" pixmap="skin_default/nim_active.png" alphatest="on" /-->
- <widget source="session.GlobalInfo" render="Pixmap" position="142,6" zPosition="1" size="8,9" pixmap="skin_default/nim_active.png" alphatest="on" >
- <convert type="Misc">TunerUseMask</convert>
+ <widget source="session.TunerInfo" render="Pixmap" position="142,6" zPosition="1" size="8,9" pixmap="skin_default/nim_active.png" alphatest="on" >
+ <convert type="TunerInfo">TunerUseMask</convert>
<convert type="ValueBitTest">1</convert>
<convert type="ConditionalShowHide" />
</widget>
- <!-- DEPRECATED widget name="NimB" position="142,20" zPosition="1" size="8,9" pixmap="skin_default/nim_active.png" alphatest="on" /-->
- <widget source="session.GlobalInfo" render="Pixmap" position="142,20" zPosition="1" size="8,9" pixmap="skin_default/nim_active.png" alphatest="on" >
- <convert type="Misc">TunerUseMask</convert>
+ <widget source="session.TunerInfo" render="Pixmap" position="142,20" zPosition="1" size="8,9" pixmap="skin_default/nim_active.png" alphatest="on" >
+ <convert type="TunerInfo">TunerUseMask</convert>
<convert type="ValueBitTest">2</convert>
<convert type="ConditionalShowHide" />
</widget>
<convert type="EventTime">Progress</convert>
</widget>
<!-- Blinking pixmap (recording in progress?) -->
- <!-- DEPRECATED widget name="BlinkingPoint" pixmap="skin_default/icon_rec.png" position="561,21" zPosition="2" size="34,21" alphatest="off" /-->
- <widget source="session.GlobalInfo" render="Pixmap" pixmap="skin_default/icon_rec.png" position="561,21" zPosition="2" size="34,21" alphatest="off">
- <convert type="Misc">RecordRunning</convert>
+ <widget source="session.RecordState" render="Pixmap" pixmap="skin_default/icon_rec.png" position="561,21" zPosition="2" size="34,21" alphatest="off">
<convert type="ConditionalShowHide">Blink</convert>
</widget>
<!-- Event (now) -->
Poll.py RemainingToText.py StringList.py ServiceName.py FrontendInfo.py ServiceInfo.py \
ConditionalShowHide.py ServicePosition.py ValueRange.py RdsInfo.py Streaming.py \
StaticMultiList.py ServiceTime.py MovieInfo.py MenuEntryCompare.py StringListSelection.py \
- ValueBitTest.py Misc.py
+ ValueBitTest.py TunerInfo.py
--- /dev/null
+from Components.Sources.TunerInfo import TunerInfo as TunerInfoSource
+from Components.Converter.Converter import Converter
+from Components.Element import cached
+
+class TunerInfo(Converter, object):
+ def __init__(self, type):
+ Converter.__init__(self, type)
+ self.type = {
+ "TunerUseMask": TunerInfoSource.FE_USE_MASK
+ }[type]
+
+ @cached
+ def getBoolean(self):
+ if self.type == TunerInfoSource.FE_USE_MASK:
+ return self.source.getTunerUseMask() and True or False
+ boolean = property(getBoolean)
+
+ @cached
+ def getText(self):
+ if self.type == TunerInfoSource.FE_USE_MASK:
+ return str(self.source.getTunerUseMask())
+ return ""
+ text = property(getText)
+
+ @cached
+ def getValue(self):
+ if self.type == TunerInfoSource.FE_USE_MASK:
+ return self.source.getTunerUseMask()
+ return -1
+ value = property(getValue)
+
+ def changed(self, what):
+ if what[0] != self.CHANGED_SPECIFIC or what[1] == self.type:
+ Converter.changed(self, what)
self.__visible = 0
self.visible = 1
self.skinAttributes = None
+ self.deprecationInfo = None
def execBegin(self):
pass
val = self[key]
if isinstance(val, GUIComponent):
val.GUIcreate(parent)
- if not val.applySkin(desktop):
+ depr = val.deprecationInfo
+ if val.applySkin(desktop):
+ if depr:
+ print "WARNING: OBSOLETE COMPONENT '%s' USED IN SKIN. USE '%s' INSTEAD!" % (key, depr[0])
+ print "OBSOLETE COMPONENT WILL BE REMOVED %s, PLEASE UPDATE!" % (depr[1])
+ elif not depr:
print "warning, skin is missing element", key, "in", self
for w in self.additionalWidgets:
install_PYTHON = \
__init__.py Clock.py EventInfo.py Source.py List.py CurrentService.py \
FrontendStatus.py Boolean.py Config.py ServiceList.py RdsDecoder.py StreamService.py \
- StaticText.py CanvasSource.py ServiceEvent.py Event.py FrontendInfo.py \
- Misc.py
+ StaticText.py CanvasSource.py ServiceEvent.py Event.py FrontendInfo.py TunerInfo.py \
+ RecordState.py
--- /dev/null
+from Source import Source
+from Components.Element import cached
+from enigma import iRecordableService
+
+class RecordState(Source):
+ def __init__(self, session):
+ Source.__init__(self)
+ self.records_running = 0
+ self.session = session
+ session.nav.record_event.append(self.gotRecordEvent)
+
+ def gotRecordEvent(self, service, event):
+ prev_records = self.records_running
+ if event in (iRecordableService.evEnd, iRecordableService.evStart):
+ recs = self.session.nav.getRecordings()
+ self.records_running = len(recs)
+ if self.records_running != prev_records:
+ self.changed((self.CHANGED_ALL,))
+
+ def destroy(self):
+ session.nav.record_event.remove(self.gotRecordEvent)
+ Source.destroy(self)
+
+ @cached
+ def getBoolean(self):
+ return self.records_running and True or False
+ boolean = property(getBoolean)
+
+ @cached
+ def getValue(self):
+ return self.records_running
+ value = property(getValue)
--- /dev/null
+from Source import Source
+from enigma import eDVBResourceManager
+
+class TunerInfo(Source):
+ FE_USE_MASK = 0
+
+ def __init__(self):
+ Source.__init__(self)
+ self.tuner_use_mask = 0
+ res_mgr = eDVBResourceManager.getInstance()
+ if res_mgr:
+ res_mgr.frontendUseMaskChanged.get().append(self.tunerUseMaskChanged)
+ else:
+ print "no res_mgr!!"
+
+ def tunerUseMaskChanged(self, mask):
+ self.tuner_use_mask = mask
+ self.changed((self.CHANGED_SPECIFIC, self.FE_USE_MASK))
+
+ def getTunerUseMask(self):
+ return self.tuner_use_mask
+
+ def destroy(self):
+ res_mgr = eDVBResourceManager.getInstance()
+ if res_mgr:
+ res_mgr.frontendUseMaskChanged.get().remove(self.tunerUseMaskChanged)
+ else:
+ print "no res_mgr!!"
+ Source.destroy(self)
#### DEPRECATED CODE ####
self["BlinkingPoint"] = BlinkingPixmapConditional()
self["BlinkingPoint"].setConnect(self.session.nav.RecordTimer.isRecording)
+ self["BlinkingPoint"].deprecationInfo = (
+ "session.RecordState source, Pixmap renderer and "
+ "ConditionalShowHide/Blink Converter", "2008-02")
#########################
def stopCurrentRecording(self, entry = -1):
######### DEPRECATED CODE ##########
self["NimA"] = Pixmap()
+ self["NimA"].deprecationInfo = (
+ "session.TunerInfo source, Pixmap renderer, TunerInfo/UseMask Converter"
+ ", ValueBitTest(1) Converter and ConditionalShowHide Converter", "2008-02")
self["NimB"] = Pixmap()
+ self["NimB"].deprecationInfo = (
+ "session.TunerInfo source, Pixmap renderer, TunerInfo/UseMask Converter"
+ ", ValueBitTest(2) Converter and ConditionalShowHide Converter", "2008-02")
self["NimA_Active"] = Pixmap()
+ self["NimA_Active"].deprecationInfo = (
+ "session.FrontendInfo source, Pixmap renderer, FrontendInfo/NUMBER Converter"
+ ", ValueRange(1,1) Converter and ConditionalShowHide Converter", "2008-02")
self["NimB_Active"] = Pixmap()
+ self["NimB_Active"].deprecationInfo = (
+ "session.FrontendInfo source, Pixmap renderer, FrontendInfo/NUMBER Converter"
+ ", ValueRange(1,1) Converter and ConditionalShowHide Converter", "2008-02")
res_mgr = eDVBResourceManager.getInstance()
if res_mgr:
<widget source="global.CurrentTime" render="Label" position="62,46" size="82,18" font="Regular;16" >
<convert type="ClockToText">WithSeconds</convert>
</widget>
- <widget source="session.GlobalInfo" render="FixedLabel" text=" " position="62,46" size="82,18" zPosition="1" >
- <convert type="Misc">RecordRunning</convert>
+ <widget source="session.RecordState" render="FixedLabel" text=" " position="62,46" size="82,18" zPosition="1" >
<convert type="ConditionalShowHide">Blink</convert>
</widget>
<widget source="session.CurrentService" render="Label" position="6,4" size="120,42" font="Regular;18" >
<widget source="global.CurrentTime" render="Label" position="62,46" size="64,18" font="Regular;16" halign="right" >
<convert type="ClockToText">WithSeconds</convert>
</widget>
- <widget source="session.GlobalInfo" render="FixedLabel" text=" " position="62,46" size="64,18" zPosition="1" >
- <convert type="Misc">RecordRunning</convert>
+ <widget source="session.RecordState" render="FixedLabel" text=" " position="62,46" size="64,18" zPosition="1" >
<convert type="ConditionalShowHide">Blink</convert>
</widget>
<widget source="session.CurrentService" render="Label" position="6,4" size="120,42" font="Regular;18" >
from Components.Sources.FrontendStatus import FrontendStatus
from Components.Sources.FrontendInfo import FrontendInfo
from Components.Sources.Source import Source
-from Components.Sources.Misc import Misc
+from Components.Sources.TunerInfo import TunerInfo
+from Components.Sources.RecordState import RecordState
class SessionGlobals(Screen):
def __init__(self, session):
self["FrontendStatus"] = FrontendStatus(service_source = session.nav.getCurrentService)
self["FrontendInfo"] = FrontendInfo(service_source = session.nav.getCurrentService)
self["VideoPicture"] = Source()
- self["GlobalInfo"] = Misc(session)
+ self["TunerInfo"] = TunerInfo()
+ self["RecordState"] = RecordState(session)
session.nav.event.append(self.serviceEvent)
self.service_state = 0
<widget source="global.CurrentTime" render="Label" position="0,0" size="132,64" font="Regular;40" halign="center">
<convert type="ClockToText" />
</widget>
- <widget source="session.GlobalInfo" render="FixedLabel" text=" " position="0,0" size="132,64" zPosition="1" >
- <convert type="Global">RecordRunning</convert>
+ <widget source="session.RecordState" render="FixedLabel" text=" " position="0,0" size="132,64" zPosition="1" >
<convert type="ConditionalShowHide">Blink</convert>
</widget>
</screen>"""