immediate take care of changed "visualize rotor movement" option
[enigma2.git] / lib / python / Screens / InfoBarGenerics.py
index 978e73198391ed0d051518ebada89f71b5e4ae76..85b1d80f3f44a7affff5c8a9a0fd28d61c7af459 100644 (file)
@@ -5,17 +5,15 @@ from Components.ActionMap import NumberActionMap
 from Components.BlinkingPixmap import BlinkingPixmapConditional
 from Components.Harddisk import harddiskmanager
 from Components.Input import Input
 from Components.BlinkingPixmap import BlinkingPixmapConditional
 from Components.Harddisk import harddiskmanager
 from Components.Input import Input
-from Components.Label import *
-from Components.Pixmap import Pixmap, PixmapConditional
+from Components.Label import Label
+from Components.Pixmap import Pixmap
 from Components.PluginComponent import plugins
 from Components.PluginComponent import plugins
-from Components.ProgressBar import *
 from Components.ServiceEventTracker import ServiceEventTracker
 from Components.Sources.CurrentService import CurrentService
 from Components.Sources.EventInfo import EventInfo
 from Components.Sources.FrontendStatus import FrontendStatus
 from Components.Sources.Boolean import Boolean
 from Components.Sources.Clock import Clock
 from Components.ServiceEventTracker import ServiceEventTracker
 from Components.Sources.CurrentService import CurrentService
 from Components.Sources.EventInfo import EventInfo
 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, ConfigBoolean, ConfigClock
 from EpgSelection import EPGSelection
 from Plugins.Plugin import PluginDescriptor
 from Components.config import config, ConfigBoolean, ConfigClock
 from EpgSelection import EPGSelection
 from Plugins.Plugin import PluginDescriptor
@@ -406,6 +404,7 @@ class InfoBarEPG:
                self["EPGActions"] = HelpableActionMap(self, "InfobarEPGActions", 
                        {
                                "showEventInfo": (self.openEventView, _("show EPG...")),
                self["EPGActions"] = HelpableActionMap(self, "InfobarEPGActions", 
                        {
                                "showEventInfo": (self.openEventView, _("show EPG...")),
+                               "showSingleServiceEPG": (self.openSingleServiceEPG, _("show single service EPG...")),
                                "showInfobarOrEpgWhenInfobarAlreadyVisible": self.showEventInfoWhenNotVisible,
                        })
 
                                "showInfobarOrEpgWhenInfobarAlreadyVisible": self.showEventInfoWhenNotVisible,
                        })
 
@@ -653,7 +652,7 @@ class InfoBarSeek:
 
                self["SeekActions"] = InfoBarSeekActionMap(self, actionmap, 
                        {
 
                self["SeekActions"] = InfoBarSeekActionMap(self, actionmap, 
                        {
-                               "playpauseService": (self.playpauseService, _("pause")),
+                               "playpauseService": self.playpauseService,
                                "pauseService": (self.pauseService, _("pause")),
                                "unPauseService": (self.unPauseService, _("continue")),
 
                                "pauseService": (self.pauseService, _("pause")),
                                "unPauseService": (self.unPauseService, _("continue")),
 
@@ -661,12 +660,17 @@ class InfoBarSeek:
                                "seekFwdManual": (self.seekFwdManual, _("skip forward (enter time)")),
                                "seekBack": (self.seekBack, _("skip backward")),
                                "seekBackManual": (self.seekBackManual, _("skip backward (enter time)")),
                                "seekFwdManual": (self.seekFwdManual, _("skip forward (enter time)")),
                                "seekBack": (self.seekBack, _("skip backward")),
                                "seekBackManual": (self.seekBackManual, _("skip backward (enter time)")),
+                               
+                               "seekFwdDef": (self.seekFwdDef, _("skip forward (self defined)")),
+                               "seekBackDef": (self.seekBackDef, _("skip backward (self defined)"))
                        }, prio=-1)
                        # give them a little more priority to win over color buttons
 
                self["SeekActions"].setEnabled(False)
 
                self.seekstate = self.SEEK_STATE_PLAY
                        }, prio=-1)
                        # give them a little more priority to win over color buttons
 
                self["SeekActions"].setEnabled(False)
 
                self.seekstate = self.SEEK_STATE_PLAY
+               
+               self.seek_flag = True
 
                self.onPlayStateChanged = [ ]
 
 
                self.onPlayStateChanged = [ ]
 
@@ -828,6 +832,22 @@ class InfoBarSeek:
                        if seekable is not None:
                                seekable.seekRelative(-1, 3)
 
                        if seekable is not None:
                                seekable.seekRelative(-1, 3)
 
+       def seekFwdDef(self):
+               self.seek_flag = False
+               seconds = config.usage.self_defined_seek.value
+               print "Seek", seconds, "seconds self defined forward"
+               seekable = self.getSeek()
+               if seekable is not None:
+                       seekable.seekRelative(1, seconds * 90000)
+               
+       def seekBackDef(self):
+               self.seek_flag = False
+               seconds = config.usage.self_defined_seek.value
+               print "Seek", seconds, "seconds self defined backward"
+               seekable = self.getSeek()
+               if seekable is not None:
+                       seekable.seekRelative(1, 0 - seconds * 90000)
+               
        def seekFwdManual(self):
                self.session.openWithCallback(self.fwdSeekTo, MinuteInput)
 
        def seekFwdManual(self):
                self.session.openWithCallback(self.fwdSeekTo, MinuteInput)
 
@@ -876,11 +896,14 @@ class InfoBarSeek:
                self.doSeek(0)
 
        def seekRelative(self, diff):
                self.doSeek(0)
 
        def seekRelative(self, diff):
-               seekable = self.getSeek()
-               if seekable is not None:
-                       print "seekRelative: res:", seekable.seekRelative(1, diff)
+               if self.seek_flag == True:
+                       seekable = self.getSeek()
+                       if seekable is not None:
+                               print "seekRelative: res:", seekable.seekRelative(1, diff)
+                       else:
+                               print "seek failed!"
                else:
                else:
-                       print "seek failed!"
+                       self.seek_flag = True
 
        def seekRelativeToEnd(self, diff):
                assert diff <= 0, "diff is expected to be negative!"
 
        def seekRelativeToEnd(self, diff):
                assert diff <= 0, "diff is expected to be negative!"
@@ -1180,7 +1203,7 @@ class InfoBarPlugins:
                return list
 
        def runPlugin(self, plugin):
                return list
 
        def runPlugin(self, plugin):
-               plugin(session = self.session)
+               plugin(session = self.session, servicelist = self.servicelist)
 
 # depends on InfoBarExtensions
 class InfoBarSleepTimer:
 
 # depends on InfoBarExtensions
 class InfoBarSleepTimer:
@@ -1335,7 +1358,7 @@ class InfoBarInstantRecord:
                        if not x in self.session.nav.RecordTimer.timer_list:
                                self.recording.remove(x)
                        elif x.dontSave and x.isRunning():
                        if not x in self.session.nav.RecordTimer.timer_list:
                                self.recording.remove(x)
                        elif x.dontSave and x.isRunning():
-                               list.append(TimerEntryComponent(x, False))
+                               list.append((x, False))
 
                if answer[1] == "changeduration":
                        if len(self.recording) == 1:
 
                if answer[1] == "changeduration":
                        if len(self.recording) == 1:
@@ -1707,11 +1730,11 @@ class InfoBarCueSheetSupport:
 
        ENABLE_RESUME_SUPPORT = False
 
 
        ENABLE_RESUME_SUPPORT = False
 
-       def __init__(self):
-               self["CueSheetActions"] = HelpableActionMap(self, "InfobarCueSheetActions"
+       def __init__(self, actionmap = "InfobarCueSheetActions"):
+               self["CueSheetActions"] = HelpableActionMap(self, actionmap
                        {
                        {
-                               "jumpPreviousMark": (self.jumpPreviousMark, _("jump to next marked position")),
-                               "jumpNextMark": (self.jumpNextMark, _("jump to previous marked position")),
+                               "jumpPreviousMark": (self.jumpPreviousMark, _("jump to previous marked position")),
+                               "jumpNextMark": (self.jumpNextMark, _("jump to next marked position")),
                                "toggleMark": (self.toggleMark, _("toggle a cut mark at the current position"))
                        }, prio=1) 
 
                                "toggleMark": (self.toggleMark, _("toggle a cut mark at the current position"))
                        }, prio=1) 
 
@@ -1744,6 +1767,11 @@ class InfoBarCueSheetSupport:
                        seekable = self.__getSeekable()
                        if seekable is not None:
                                seekable.seekTo(self.resume_point)
                        seekable = self.__getSeekable()
                        if seekable is not None:
                                seekable.seekTo(self.resume_point)
+               self.hideAfterResume()
+       
+       def hideAfterResume(self):
+               if isinstance(self, InfoBarShowHide):
+                       self.hide()
 
        def __getSeekable(self):
                service = self.session.nav.getCurrentService()
 
        def __getSeekable(self):
                service = self.session.nav.getCurrentService()
@@ -1812,10 +1840,6 @@ class InfoBarCueSheetSupport:
                if onlyreturn:
                        return None
 
                if onlyreturn:
                        return None
 
-       def showAfterCuesheetOperation(self):
-               if isinstance(self, InfoBarShowHide):
-                       self.doShow()
-
        def addMark(self, point):
                insort(self.cut_list, point)
                self.uploadCuesheet()
        def addMark(self, point):
                insort(self.cut_list, point)
                self.uploadCuesheet()