text edit patch #5 by Anders Holst
[vuplus_dvbapp] / lib / python / Screens / InfoBar.py
index 27f7538..228ca4e 100644 (file)
@@ -1,15 +1,21 @@
+from Tools.Profile import profile, profile_final
+
 from Screen import Screen
 
+profile("LOAD:MovieSelection")
 from Screens.MovieSelection import MovieSelection
+profile("LOAD:ChannelSelectionRadio")
 from Screens.ChannelSelection import ChannelSelectionRadio
-from Screens.MessageBox import MessageBox
-from Screens.Ci import CiHandler
+profile("LOAD:ChoiceBox")
+from Screens.ChoiceBox import ChoiceBox
 
+profile("LOAD:InitBar_Components")
 from Components.Sources.Source import ObsoleteSource
 from Components.ActionMap import HelpableActionMap
 from Components.config import config
 from Components.ServiceEventTracker import ServiceEventTracker
 
+profile("LOAD:InfoBarGenerics")
 from Screens.InfoBarGenerics import InfoBarShowHide, \
        InfoBarNumberZap, InfoBarChannelSelection, InfoBarMenu, InfoBarRdsDecoder, \
        InfoBarEPG, InfoBarEvent, InfoBarServiceName, InfoBarSeek, InfoBarInstantRecord, \
@@ -19,8 +25,10 @@ from Screens.InfoBarGenerics import InfoBarShowHide, \
        InfoBarSummarySupport, InfoBarMoviePlayerSummarySupport, InfoBarTimeshiftState, InfoBarTeletextPlugin, InfoBarExtensions, \
        InfoBarSubtitleSupport, InfoBarPiP, InfoBarPlugins, InfoBarSleepTimer, InfoBarServiceErrorPopupSupport
 
+profile("LOAD:HelpableScreen")
 from Screens.HelpMenu import HelpableScreen
 
+profile("LOAD:enigma")
 from enigma import iPlayableService
 
 class InfoBar(InfoBarShowHide,
@@ -37,8 +45,6 @@ class InfoBar(InfoBarShowHide,
        def __init__(self, session):
                Screen.__init__(self, session)
 
-               CiHandler.setSession(session)
-
                self["actions"] = HelpableActionMap(self, "InfobarActions",
                        {
                                "showMovies": (self.showMovies, _("Play recorded movies...")),
@@ -146,13 +152,22 @@ class MoviePlayer(InfoBarShowHide, \
 
        def leavePlayer(self):
                self.is_closing = True
-               self.session.openWithCallback(self.leavePlayerConfirmed, MessageBox, _("Stop playing this movie?"))
-       
+
+               list = []
+               list.append((_("Yes"), "quit"))
+               list.append((_("No"), "continue"))
+               if config.usage.setup_level.index >= 2: # expert+
+                       list.append((_("No, but restart from begin"), "restart"))
+               self.session.openWithCallback(self.leavePlayerConfirmed, ChoiceBox, title=_("Stop playing this movie?"), list = list)
+
        def leavePlayerConfirmed(self, answer):
-               if answer == True:
+               answer = answer and answer[1]
+               if answer == "quit":
                        self.session.nav.playService(self.lastservice)
                        self.close()
-                       
+               elif answer == "restart":
+                       self.doSeek(0)
+
        def showMovies(self):
                ref = self.session.nav.getCurrentlyPlayingServiceReference()
                self.session.openWithCallback(self.movieSelected, MovieSelection, ref)