+class InfoBarBase:
+ def __init__(self):
+ ServiceEventTracker.setActiveInfoBar(self)
+ self.onClose.append(self.__close)
+
+ def __close(self):
+ ServiceEventTracker.popActiveInfoBar()
+
class ServiceEventTracker:
"""Tracks service events into a screen"""
-
+ InfoBarStack = [ ]
+ InfoBarStackSize = 0
+
def __init__(self, screen, eventmap):
self.__eventmap = eventmap
- self.session = screen.session
- self.session.nav.event.append(self.__event)
+ self.screen = screen
+ screen.session.nav.event.append(self.__event)
screen.onClose.append(self.__del_event)
def __del_event(self):
- self.session.nav.event.remove(self.__event)
+ self.screen.session.nav.event.remove(self.__event)
def __event(self, ev):
+ set = ServiceEventTracker
+ ssize = set.InfoBarStackSize
+ stack = set.InfoBarStack
if ev in self.__eventmap:
- self.__eventmap[ev]()
+ if not isinstance(self.screen, InfoBarBase) or (ssize and stack[ssize-1] == self.screen):
+ self.__eventmap[ev]()
+# else:
+# print "ignore event", ev, "for inactive infobar '" + str(self.screen) + "'"
+
+ @staticmethod
+ def setActiveInfoBar(infobar):
+ set = ServiceEventTracker
+ assert infobar not in set.InfoBarStack, "FATAL: Infobar '" + str(infobar) + "' is already active!"
+ set.InfoBarStack.append(infobar)
+ set.InfoBarStackSize += 1
+# print "ServiceEventTracker set active '" + str(infobar) + "'"
+
+ @staticmethod
+ def popActiveInfoBar():
+ set = ServiceEventTracker
+ stack = set.InfoBarStack
+ if set.InfoBarStackSize:
+ set.InfoBarStackSize -= 1
+ del stack[set.InfoBarStackSize]
+# if set.InfoBarStackSize:
+# print "ServiceEventTracker reset active '" + str(stack[set.InfoBarStackSize-1]) + "'"
from Components.ServicePosition import ServicePositionGauge
from Components.ActionMap import HelpableActionMap
from Components.MultiContent import MultiContentEntryText
-from Components.ServiceEventTracker import ServiceEventTracker
+from Components.ServiceEventTracker import ServiceEventTracker, InfoBarBase
from Components.VideoWindow import VideoWindow
from Screens.InfoBarGenerics import InfoBarSeek, InfoBarCueSheetSupport
from Components.GUIComponent import GUIComponent
if self.instance is not None:
self.instance.moveSelectionTo(index)
-class CutListEditor(Screen, InfoBarSeek, InfoBarCueSheetSupport, HelpableScreen):
+class CutListEditor(Screen, InfoBarBase, InfoBarSeek, InfoBarCueSheetSupport, HelpableScreen):
skin = """
<screen position="0,0" size="720,576" title="Cutlist editor" flags="wfNoBorder">
<eLabel text="Cutlist editor" position="65,60" size="300,25" font="Regular;20" />
Screen.__init__(self, session)
InfoBarSeek.__init__(self, actionmap = "CutlistSeekActions")
InfoBarCueSheetSupport.__init__(self)
+ InfoBarBase.__init__(self)
HelpableScreen.__init__(self)
self.old_service = session.nav.getCurrentlyPlayingServiceReference()
session.nav.playService(service)
from Components.ActionMap import ActionMap, NumberActionMap, HelpableActionMap
from Components.Label import Label
from Components.FileList import FileList
-from Components.ServiceEventTracker import ServiceEventTracker
+from Components.ServiceEventTracker import ServiceEventTracker, InfoBarBase
from Components.config import config
from Components.ProgressBar import ProgressBar
from ServiceReference import ServiceReference
self.Timer.callback.append(self.keyOK)
self.Timer.start(3000, True)
-class DVDPlayer(Screen, InfoBarNotifications, InfoBarSeek, InfoBarCueSheetSupport, InfoBarPVRState, InfoBarShowHide, HelpableScreen):
+class DVDPlayer(Screen, InfoBarBase, InfoBarNotifications, InfoBarSeek, InfoBarCueSheetSupport, InfoBarPVRState, InfoBarShowHide, HelpableScreen):
ALLOW_SUSPEND = True
ENABLE_RESUME_SUPPORT = True
def __init__(self, session, args = None):
Screen.__init__(self, session)
+ InfoBarBase.__init__(self)
InfoBarNotifications.__init__(self)
InfoBarCueSheetSupport.__init__(self, actionmap = "MediaPlayerCueSheetActions")
InfoBarShowHide.__init__(self)
from Components.MediaPlayer import PlayList
from Tools.Directories import resolveFilename, SCOPE_CONFIG, SCOPE_PLAYLIST, SCOPE_SKIN_IMAGE
from Components.ServicePosition import ServicePositionGauge
-from Components.ServiceEventTracker import ServiceEventTracker
+from Components.ServiceEventTracker import ServiceEventTracker, InfoBarBase
from Components.Playlist import PlaylistIOInternal, PlaylistIOM3U, PlaylistIOPLS
from Screens.InfoBarGenerics import InfoBarSeek, InfoBarAudioSelection, InfoBarCueSheetSupport, InfoBarNotifications
from ServiceReference import ServiceReference
self.default_pixmap = resolveFilename(SCOPE_SKIN_IMAGE, "skin_default/no_coverArt.png")
return Pixmap.applySkin(self, desktop)
-class MediaPlayer(Screen, InfoBarSeek, InfoBarAudioSelection, InfoBarCueSheetSupport, InfoBarNotifications, HelpableScreen):
+class MediaPlayer(Screen, InfoBarBase, InfoBarSeek, InfoBarAudioSelection, InfoBarCueSheetSupport, InfoBarNotifications, HelpableScreen):
ALLOW_SUSPEND = True
ENABLE_RESUME_SUPPORT = True
InfoBarAudioSelection.__init__(self)
InfoBarCueSheetSupport.__init__(self, actionmap = "MediaPlayerCueSheetActions")
InfoBarNotifications.__init__(self)
+ InfoBarBase.__init__(self)
HelpableScreen.__init__(self)
self.summary = None
self.oldService = self.session.nav.getCurrentlyPlayingServiceReference()
from Components.ServiceList import ServiceList
from Components.ActionMap import NumberActionMap, ActionMap, HelpableActionMap
from Components.MenuList import MenuList
-from Components.ServiceEventTracker import ServiceEventTracker
+from Components.ServiceEventTracker import ServiceEventTracker, InfoBarBase
profile("ChannelSelection.py 1")
from EpgSelection import EPGSelection
from enigma import eServiceReference, eEPGCache, eServiceCenter, eRCInput, eTimer, eDVBDB, iPlayableService, iServiceInformation, getPrevAsciiCode
Screen.__init__(self, session)
self["RdsDecoder"] = RdsDecoder(self.session.nav)
-class ChannelSelectionRadio(ChannelSelectionBase, ChannelSelectionEdit, ChannelSelectionEPG):
+class ChannelSelectionRadio(ChannelSelectionBase, ChannelSelectionEdit, ChannelSelectionEPG, InfoBarBase):
ALLOW_SUSPEND = True
def __init__(self, session, infobar):
ChannelSelectionBase.__init__(self, session)
ChannelSelectionEdit.__init__(self)
ChannelSelectionEPG.__init__(self)
+ InfoBarBase.__init__(self)
self.infobar = infobar
self.onLayoutFinish.append(self.onCreate)
profile("LOAD:InitBar_Components")
from Components.ActionMap import HelpableActionMap
from Components.config import config
-from Components.ServiceEventTracker import ServiceEventTracker
+from Components.ServiceEventTracker import ServiceEventTracker, InfoBarBase
profile("LOAD:HelpableScreen")
from Screens.HelpMenu import HelpableScreen
-class InfoBar(InfoBarShowHide,
+class InfoBar(InfoBarBase, InfoBarShowHide,
InfoBarNumberZap, InfoBarChannelSelection, InfoBarMenu, InfoBarEPG, InfoBarRdsDecoder,
InfoBarInstantRecord, InfoBarAudioSelection,
HelpableScreen, InfoBarAdditionalInfo, InfoBarNotifications, InfoBarDish,
def __init__(self, session):
Screen.__init__(self, session)
-
self["actions"] = HelpableActionMap(self, "InfobarActions",
{
"showMovies": (self.showMovies, _("Play recorded movies...")),
}, prio=2)
for x in HelpableScreen, \
- InfoBarShowHide, \
+ InfoBarBase, InfoBarShowHide, \
InfoBarNumberZap, InfoBarChannelSelection, InfoBarMenu, InfoBarEPG, InfoBarRdsDecoder, \
InfoBarInstantRecord, InfoBarAudioSelection, \
InfoBarAdditionalInfo, InfoBarNotifications, InfoBarDish, InfoBarSubserviceSelection, \
if service is not None:
self.session.open(MoviePlayer, service)
-class MoviePlayer(InfoBarShowHide, \
+class MoviePlayer(InfoBarBase, InfoBarShowHide, \
InfoBarMenu, \
InfoBarSeek, InfoBarShowMovies, InfoBarAudioSelection, HelpableScreen, InfoBarNotifications,
InfoBarServiceNotifications, InfoBarPVRState, InfoBarCueSheetSupport, InfoBarSimpleEventView,
})
for x in HelpableScreen, InfoBarShowHide, InfoBarMenu, \
- InfoBarSeek, InfoBarShowMovies, \
+ InfoBarBase, InfoBarSeek, InfoBarShowMovies, \
InfoBarAudioSelection, InfoBarNotifications, InfoBarSimpleEventView, \
InfoBarServiceNotifications, InfoBarPVRState, InfoBarCueSheetSupport, \
InfoBarMoviePlayerSummarySupport, InfoBarSubtitleSupport, \