change keys for activating/controlling PiP to color keys instead of number keys
[enigma2.git] / lib / python / Screens / InfoBarGenerics.py
index f2516c4b56d02237c2b92ec28453e39ecb0cc0fd..af8f0a91c67bc4ba03b41c474700c251f503da90 100644 (file)
@@ -12,12 +12,12 @@ from Components.ProgressBar import *
 from Components.ServiceEventTracker import ServiceEventTracker
 from Components.Sources.CurrentService import CurrentService
 from Components.Sources.EventInfo import EventInfo
+from Components.Sources.RadioText import RadioText
 from Components.Sources.FrontendStatus import FrontendStatus
 from Components.Sources.Boolean import Boolean
 from Components.Sources.Clock import Clock
 from Components.TimerList import TimerEntryComponent
-from Components.config import config, configElement, ConfigSubsection, configSequence, configElementBoolean, configSelection, configElement_nonSave, getConfigListEntry
-from Components.config import configfile, configsequencearg
+from Components.config import config, ConfigBoolean
 
 from EpgSelection import EPGSelection
 from Plugins.Plugin import PluginDescriptor
@@ -44,8 +44,6 @@ import time
 import os
 import bisect
 
-from Components.config import config, currentConfigSelectionElement
-
 # hack alert!
 from Menu import MainMenu, mdom
 
@@ -240,7 +238,7 @@ class InfoBarNumberZap:
                        self.servicelist.setCurrentSelection(service) #select the service in servicelist
                        self.servicelist.zap()
 
-config.misc.initialchannelselection = configElementBoolean("config.misc.initialchannelselection", 1);
+config.misc.initialchannelselection = ConfigBoolean(default = True)
 
 class InfoBarChannelSelection:
        """ ChannelSelection - handles the channelSelection dialog and the initial 
@@ -249,7 +247,7 @@ class InfoBarChannelSelection:
                #instantiate forever
                self.servicelist = self.session.instantiateDialog(ChannelSelection)
                
-               if config.misc.initialchannelselection.value == 1:
+               if config.misc.initialchannelselection.value:
                        self.onShown.append(self.firstRun)
 
                self["ChannelSelectActions"] = HelpableActionMap(self, "InfobarChannelSelection",
@@ -277,7 +275,7 @@ class InfoBarChannelSelection:
 
        def firstRun(self):
                self.onShown.remove(self.firstRun)
-               config.misc.initialchannelselection.value = 0
+               config.misc.initialchannelselection.value = False
                config.misc.initialchannelselection.save()
                self.switchChannelDown()
 
@@ -304,7 +302,7 @@ class InfoBarChannelSelection:
                        if prev:
                                prev = prev.toString()
                                while True:
-                                       if currentConfigSelectionElement(config.usage.quickzap_bouquet_change) == "yes":
+                                       if config.usage.quickzap_bouquet_change.value:
                                                if self.servicelist.atBegin():
                                                        self.servicelist.prevBouquet()
                                        self.servicelist.moveUp()
@@ -322,7 +320,7 @@ class InfoBarChannelSelection:
                        if prev:
                                prev = prev.toString()
                                while True:
-                                       if currentConfigSelectionElement(config.usage.quickzap_bouquet_change) == "yes" and self.servicelist.atEnd():
+                                       if config.usage.quickzap_bouquet_change.value and self.servicelist.atEnd():
                                                self.servicelist.nextBouquet()
                                        else:
                                                self.servicelist.moveDown()
@@ -528,6 +526,11 @@ class InfoBarEvent:
                self["Event_Now"] = EventInfo(self.session.nav, EventInfo.NOW)
                self["Event_Next"] = EventInfo(self.session.nav, EventInfo.NEXT)
 
+class InfoBarRadioText:
+       """provides radio (RDS) text info display"""
+       def __init__(self):
+               self["RadioText"] = RadioText(self.session.nav)
+
 class InfoBarServiceName:
        def __init__(self):
                self["CurrentService"] = CurrentService(self.session.nav)
@@ -827,6 +830,11 @@ class InfoBarSeek:
                if seekable is not None:
                        seekable.seekRelative(1, diff)
 
+       def seekAbsolute(self, abs):
+               seekable = self.getSeek()
+               if seekable is not None:
+                       seekable.seekTo(abs)
+
 from Screens.PVRState import PVRState, TimeshiftState
 
 class InfoBarPVRState:
@@ -1090,6 +1098,26 @@ class InfoBarExtensions:
 
 from Tools.BoundFunction import boundFunction
 
+# depends on InfoBarExtensions
+from Components.PluginComponent import plugins
+
+class InfoBarPlugins:
+       def __init__(self):
+               self.addExtension(extension = self.getPluginList, type = InfoBarExtensions.EXTENSION_LIST)
+               
+               
+       def getPluginName(self, name):
+               return name
+               
+       def getPluginList(self):
+               list = []
+               for p in plugins.getPlugins(where = PluginDescriptor.WHERE_EXTENSIONSMENU):
+                       list.append(((boundFunction(self.getPluginName, p.name), boundFunction(self.runPlugin, p), lambda: True), None))
+               return list
+
+       def runPlugin(self, plugin):
+               plugin(session = self.session)
+
 # depends on InfoBarExtensions and InfoBarSubtitleSupport
 class InfoBarSubtitles:
        def __init__(self):
@@ -1126,11 +1154,10 @@ class InfoBarSubtitles:
 class InfoBarPiP:
        def __init__(self):
                self.session.pipshown = False
-               
-               self.addExtension((self.getShowHideName, self.showPiP, self.available), "1")
-               self.addExtension((self.getMoveName, self.movePiP, self.pipShown), "2")
-               self.addExtension((self.getSwapName, self.swapPiP, self.pipShown), "3")
 
+               self.addExtension((self.getShowHideName, self.showPiP, self.available), "red")
+               self.addExtension((self.getMoveName, self.movePiP, self.pipShown), "green")
+               self.addExtension((self.getSwapName, self.swapPiP, self.pipShown), "yellow")
        
        def available(self):
                return True
@@ -1379,7 +1406,6 @@ class InfoBarAudioSelection:
                        self.audioChannel.selectChannel(mode[1])
                del self.audioChannel
 
-               
 class InfoBarSubserviceSelection:
        def __init__(self):
                self["SubserviceSelectionAction"] = HelpableActionMap(self, "InfobarSubserviceSelectionActions",
@@ -1429,6 +1455,7 @@ class InfoBarSubserviceSelection:
                                if newservice.valid():
                                        del subservices
                                        del service
+                                       self.doShow()
                                        self.session.nav.playService(newservice)
 
        def subserviceSelection(self):
@@ -1460,6 +1487,7 @@ class InfoBarSubserviceSelection:
                                        self.session.open(SubservicesQuickzap, service[2])
                        else:
                                self["SubserviceQuickzapAction"].setEnabled(True)
+                               self.doShow()
                                self.session.nav.playService(service[1])
 
 class InfoBarAdditionalInfo:
@@ -1690,10 +1718,10 @@ class InfoBarCueSheetSupport:
 class InfoBarSummary(Screen):
        skin = """
        <screen position="0,0" size="132,64">
-               <widget source="CurrentTime" render="Label" position="50,46" size="82,18" font="Regular;16" >
+               <widget source="CurrentTime" render="Label" position="56,46" size="82,18" font="Regular;16" >
                        <convert type="ClockToText">WithSeconds</convert>
                </widget>
-               <widget source="CurrentService" render="Label" position="0,4" size="132,42" font="Regular;18" >
+               <widget source="CurrentService" render="Label" position="6,4" size="120,42" font="Regular;18" >
                        <convert type="ServiceName">Name</convert>
                </widget>
        </screen>"""