diff options
Diffstat (limited to 'lib/python')
| -rw-r--r-- | lib/python/Screens/InfoBar.py | 11 | ||||
| -rw-r--r-- | lib/python/Screens/InfoBarGenerics.py | 45 |
2 files changed, 15 insertions, 41 deletions
diff --git a/lib/python/Screens/InfoBar.py b/lib/python/Screens/InfoBar.py index 6ee49522..c4ae6fa9 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, InfoBarSubtitles, InfoBarPlugins + InfoBarSubtitleSupport, InfoBarPiP, InfoBarPlugins from Screens.HelpMenu import HelpableScreen, HelpMenu @@ -33,8 +33,7 @@ class InfoBar(InfoBarShowHide, HelpableScreen, InfoBarAdditionalInfo, InfoBarNotifications, InfoBarDish, InfoBarSubserviceSelection, InfoBarTuner, InfoBarTimeshift, InfoBarSeek, InfoBarSummarySupport, InfoBarTimeshiftState, InfoBarTeletextPlugin, InfoBarExtensions, - InfoBarPiP, InfoBarSubtitles, InfoBarPlugins, - InfoBarSubtitleSupport, Screen): + InfoBarPiP, InfoBarPlugins, InfoBarSubtitleSupport, Screen): ALLOW_SUSPEND = True @@ -56,7 +55,7 @@ class InfoBar(InfoBarShowHide, InfoBarEvent, InfoBarServiceName, InfoBarInstantRecord, InfoBarAudioSelection, \ InfoBarAdditionalInfo, InfoBarNotifications, InfoBarDish, InfoBarSubserviceSelection, \ InfoBarTuner, InfoBarTimeshift, InfoBarSeek, InfoBarSummarySupport, InfoBarTimeshiftState, \ - InfoBarTeletextPlugin, InfoBarExtensions, InfoBarPiP, InfoBarSubtitles, InfoBarSubtitleSupport, \ + InfoBarTeletextPlugin, InfoBarExtensions, InfoBarPiP, InfoBarSubtitleSupport, \ InfoBarPlugins: x.__init__(self) @@ -85,7 +84,7 @@ class MoviePlayer(InfoBarShowHide, \ InfoBarMenu, \ InfoBarServiceName, InfoBarSeek, InfoBarShowMovies, InfoBarAudioSelection, HelpableScreen, InfoBarNotifications, InfoBarServiceNotifications, InfoBarPVRState, InfoBarCueSheetSupport, InfoBarSimpleEventView, - InfoBarSummarySupport, InfoBarTeletextPlugin, InfoBarSubtitleSupport, Screen): + InfoBarSummarySupport, InfoBarSubtitleSupport, Screen, InfoBarExtensions): ENABLE_RESUME_SUPPORT = True ALLOW_SUSPEND = True @@ -102,7 +101,7 @@ class MoviePlayer(InfoBarShowHide, \ InfoBarServiceName, InfoBarSeek, InfoBarShowMovies, \ InfoBarAudioSelection, InfoBarNotifications, InfoBarSimpleEventView, \ InfoBarServiceNotifications, InfoBarPVRState, InfoBarCueSheetSupport, \ - InfoBarSummarySupport, InfoBarTeletextPlugin, InfoBarSubtitleSupport: + InfoBarSummarySupport, InfoBarSubtitleSupport, InfoBarExtensions: x.__init__(self) self.lastservice = self.session.nav.getCurrentlyPlayingServiceReference() diff --git a/lib/python/Screens/InfoBarGenerics.py b/lib/python/Screens/InfoBarGenerics.py index e3caa6e8..b69ef4e1 100644 --- a/lib/python/Screens/InfoBarGenerics.py +++ b/lib/python/Screens/InfoBarGenerics.py @@ -344,12 +344,21 @@ class InfoBarMenu: { "mainMenu": (self.mainMenu, _("Enter main menu...")), }) + self.session.infobar = None def mainMenu(self): print "loading mainmenu XML..." menu = mdom.childNodes[0] assert menu.tagName == "menu", "root element in menu must be 'menu'!" - self.session.open(MainMenu, menu, menu.childNodes) + + self.session.infobar = self + # so we can access the currently active infobar from screens opened from within the mainmenu + # at the moment used from the SubserviceSelection + + self.session.openWithCallback(self.mainMenuClosed, MainMenu, menu, menu.childNodes) + + def mainMenuClosed(self, *val): + self.session.infobar = None class InfoBarSimpleEventView: """ Opens the Eventview for now/next """ @@ -1124,40 +1133,6 @@ class InfoBarPlugins: def runPlugin(self, plugin): plugin(session = self.session) -# depends on InfoBarExtensions and InfoBarSubtitleSupport -class InfoBarSubtitles: - def __init__(self): - self.addExtension((self.getDisableSubtitleName, self.disableSubtitles, self.subtitlesEnabled), "4") - self.addExtension(extension = self.getSubtitleList, type = InfoBarExtensions.EXTENSION_LIST) - - def getDisableSubtitleName(self): - return _("Disable subtitles") - - def getSubtitleList(self): - list = [] - s = self.getCurrentServiceSubtitle() - l = s and s.getSubtitleList() or [ ] - - for x in l: - list.append(((boundFunction(self.getSubtitleEntryName, x[0]), boundFunction(self.enableSubtitle, x[1]), lambda: True), None)) - return list - - def getSubtitleEntryName(self, name): - return "Enable Subtitles: " + name - - def enableSubtitle(self, subtitles): - if self.selected_subtitle != subtitles: - print "enable subtitles", subtitles - self.subtitles_enabled = False - self.selected_subtitle = subtitles - self.subtitles_enabled = True - - def subtitlesEnabled(self): - return self.subtitles_enabled - - def disableSubtitles(self): - self.subtitles_enabled = False - # depends on InfoBarExtensions class InfoBarPiP: def __init__(self): |
