aboutsummaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorFelix Domke <tmbinc@elitedvb.net>2006-12-09 14:36:04 +0000
committerFelix Domke <tmbinc@elitedvb.net>2006-12-09 14:36:04 +0000
commit952b92e60a529fc711bf419def94091a494ec03e (patch)
tree282988ff78fd364b854eb73632c51d861faad316 /lib
parent4c9293c08de2abe11f03d15f6515201348bc41f1 (diff)
downloadenigma2-952b92e60a529fc711bf419def94091a494ec03e.tar.gz
enigma2-952b92e60a529fc711bf419def94091a494ec03e.zip
display zap errors in popups
Diffstat (limited to 'lib')
-rw-r--r--lib/python/Screens/InfoBar.py12
-rw-r--r--lib/python/Screens/InfoBarGenerics.py45
2 files changed, 52 insertions, 5 deletions
diff --git a/lib/python/Screens/InfoBar.py b/lib/python/Screens/InfoBar.py
index 1b08f775..f1123842 100644
--- a/lib/python/Screens/InfoBar.py
+++ b/lib/python/Screens/InfoBar.py
@@ -19,7 +19,7 @@ from Screens.InfoBarGenerics import InfoBarShowHide, \
InfoBarSubserviceSelection, InfoBarTuner, InfoBarShowMovies, InfoBarTimeshift, \
InfoBarServiceNotifications, InfoBarPVRState, InfoBarCueSheetSupport, InfoBarSimpleEventView, \
InfoBarSummarySupport, InfoBarTimeshiftState, InfoBarTeletextPlugin, InfoBarExtensions, \
- InfoBarSubtitleSupport, InfoBarPiP, InfoBarPlugins, InfoBarSleepTimer
+ InfoBarSubtitleSupport, InfoBarPiP, InfoBarPlugins, InfoBarSleepTimer, InfoBarServiceErrorPopupSupport
from Screens.HelpMenu import HelpableScreen, HelpMenu
@@ -33,7 +33,8 @@ class InfoBar(InfoBarShowHide,
HelpableScreen, InfoBarAdditionalInfo, InfoBarNotifications, InfoBarDish,
InfoBarSubserviceSelection, InfoBarTuner, InfoBarTimeshift, InfoBarSeek,
InfoBarSummarySupport, InfoBarTimeshiftState, InfoBarTeletextPlugin, InfoBarExtensions,
- InfoBarPiP, InfoBarPlugins, InfoBarSubtitleSupport, InfoBarSleepTimer, Screen):
+ InfoBarPiP, InfoBarPlugins, InfoBarSubtitleSupport, InfoBarSleepTimer, InfoBarServiceErrorPopupSupport,
+ Screen):
ALLOW_SUSPEND = True
@@ -56,7 +57,7 @@ class InfoBar(InfoBarShowHide,
InfoBarAdditionalInfo, InfoBarNotifications, InfoBarDish, InfoBarSubserviceSelection, \
InfoBarTuner, InfoBarTimeshift, InfoBarSeek, InfoBarSummarySupport, InfoBarTimeshiftState, \
InfoBarTeletextPlugin, InfoBarExtensions, InfoBarPiP, InfoBarSubtitleSupport, InfoBarSleepTimer, \
- InfoBarPlugins:
+ InfoBarPlugins, InfoBarServiceErrorPopupSupport:
x.__init__(self)
self.helpList.append((self["actions"], "InfobarActions", [("showMovies", _("view recordings..."))]))
@@ -84,7 +85,8 @@ class MoviePlayer(InfoBarShowHide, \
InfoBarMenu, \
InfoBarServiceName, InfoBarSeek, InfoBarShowMovies, InfoBarAudioSelection, HelpableScreen, InfoBarNotifications,
InfoBarServiceNotifications, InfoBarPVRState, InfoBarCueSheetSupport, InfoBarSimpleEventView,
- InfoBarSummarySupport, InfoBarSubtitleSupport, Screen, InfoBarExtensions, InfoBarTeletextPlugin):
+ InfoBarSummarySupport, InfoBarSubtitleSupport, Screen, InfoBarExtensions, InfoBarTeletextPlugin,
+ InfoBarServiceErrorPopupSupport):
ENABLE_RESUME_SUPPORT = True
ALLOW_SUSPEND = True
@@ -102,7 +104,7 @@ class MoviePlayer(InfoBarShowHide, \
InfoBarAudioSelection, InfoBarNotifications, InfoBarSimpleEventView, \
InfoBarServiceNotifications, InfoBarPVRState, InfoBarCueSheetSupport, \
InfoBarSummarySupport, InfoBarSubtitleSupport, InfoBarExtensions, \
- InfoBarTeletextPlugin:
+ InfoBarTeletextPlugin, InfoBarServiceErrorPopupSupport:
x.__init__(self)
self.lastservice = self.session.nav.getCurrentlyPlayingServiceReference()
diff --git a/lib/python/Screens/InfoBarGenerics.py b/lib/python/Screens/InfoBarGenerics.py
index 3b653d05..26bc0d41 100644
--- a/lib/python/Screens/InfoBarGenerics.py
+++ b/lib/python/Screens/InfoBarGenerics.py
@@ -1850,3 +1850,48 @@ class InfoBarSubtitleSupport(object):
subtitles_enabled = property(lambda self: self.__subtitles_enabled, setSubtitlesEnable)
selected_subtitle = property(lambda self: self.__selected_subtitle, setSelectedSubtitle)
+
+class InfoBarServiceErrorPopupSupport:
+ def __init__(self):
+ self.__event_tracker = ServiceEventTracker(screen=self, eventmap=
+ {
+ iPlayableService.evTuneFailed: self.__tuneFailed,
+ iPlayableService.evStart: self.__serviceStarted
+ })
+ self.__serviceStarted()
+
+ def __serviceStarted(self):
+ self.last_error = None
+ Notifications.RemovePopup(id = "ZapError")
+
+ def __tuneFailed(self):
+ service = self.session.nav.getCurrentService()
+ info = service and service.info()
+ error = info and info.getInfo(iServiceInformation.sDVBState)
+
+ if error == self.last_error:
+ error = None
+ else:
+ self.last_error = error
+
+ errors = {
+ eDVBServicePMTHandler.eventNoResources: _("No free tuner!"),
+ eDVBServicePMTHandler.eventTuneFailed: _("Tune failed!"),
+ eDVBServicePMTHandler.eventNoPAT: _("No data on transponder!\n(Timeout reading PAT)"),
+ eDVBServicePMTHandler.eventNoPATEntry: _("Service not found!\n(SID not found in PAT)"),
+ eDVBServicePMTHandler.eventNoPMT: _("Service invalid!\n(Timeout reading PMT)"),
+ eDVBServicePMTHandler.eventNewProgramInfo: None,
+ eDVBServicePMTHandler.eventTuned: None,
+ eDVBServicePMTHandler.eventSOF: None,
+ eDVBServicePMTHandler.eventEOF: None
+ }
+
+ if error not in errors:
+ error = None
+
+ error = error and errors[error]
+
+ if error is not None:
+ Notifications.AddPopup(text = error, type = MessageBox.TYPE_ERROR, timeout = 5, id = "ZapError")
+ else:
+ Notifications.RemovePopup(id = "ZapError")