X-Git-Url: https://git.cweiske.de/enigma2.git/blobdiff_plain/e4e4d2b588a0f82e1b0c0278e3ef8ff442277a54..92929c357751afc31f7f1acbe3e724bdf307cf23:/lib/python/Plugins/Extensions/CutListEditor/plugin.py diff --git a/lib/python/Plugins/Extensions/CutListEditor/plugin.py b/lib/python/Plugins/Extensions/CutListEditor/plugin.py index 4c425532..c3456675 100644 --- a/lib/python/Plugins/Extensions/CutListEditor/plugin.py +++ b/lib/python/Plugins/Extensions/CutListEditor/plugin.py @@ -4,11 +4,10 @@ from Screens.Screen import Screen from Screens.MessageBox import MessageBox from Components.ServicePosition import ServicePositionGauge from Components.ActionMap import HelpableActionMap -from Components.MenuList import MenuList 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, InfoBarServiceName +from Screens.InfoBarGenerics import InfoBarSeek, InfoBarCueSheetSupport from Components.GUIComponent import GUIComponent from enigma import eListboxPythonMultiContent, eListbox, gFont, iPlayableService, RT_HALIGN_RIGHT from Screens.FixedMenu import FixedMenu @@ -122,6 +121,10 @@ class CutList(GUIComponent): instance.setItemHeight(30) instance.selectionChanged.get().append(self.selectionChanged) + def preWidgetRemove(self, instance): + instance.setContent(None) + instance.selectionChanged.get().remove(self.selectionChanged) + def selectionChanged(self): for x in self.onSelectionChanged: x() @@ -141,33 +144,34 @@ class CutList(GUIComponent): if self.instance is not None: self.instance.moveSelectionTo(index) -class CutListEditor(Screen, InfoBarSeek, InfoBarCueSheetSupport, InfoBarServiceName, HelpableScreen): +class CutListEditor(Screen, InfoBarBase, InfoBarSeek, InfoBarCueSheetSupport, HelpableScreen): skin = """ - - - - - - - - Name - - - - PositionDetailed - + + + + Format:%A %B %d, %H:%M + + + + + Name + + + Position,Detailed + + + + + + + """ - - - """ def __init__(self, session, service): self.skin = CutListEditor.skin Screen.__init__(self, session) InfoBarSeek.__init__(self, actionmap = "CutlistSeekActions") InfoBarCueSheetSupport.__init__(self) - InfoBarServiceName.__init__(self) + InfoBarBase.__init__(self, steal_current_service = True) HelpableScreen.__init__(self) self.old_service = session.nav.getCurrentlyPlayingServiceReference() session.nav.playService(service) @@ -209,6 +213,10 @@ class CutListEditor(Screen, InfoBarSeek, InfoBarCueSheetSupport, InfoBarServiceN # to track new entries we save the last version of the cutlist self.last_cuts = [ ] self.cut_start = None + self.onClose.append(self.__onClose) + + def __onClose(self): + self.session.nav.playService(self.old_service) def showTutorial(self): if not self.tutorial_seen: @@ -254,7 +262,6 @@ Then seek to the end, press OK, select 'end cut'. That's it. self.removeMark(m) def exit(self): - self.session.nav.playService(self.old_service) self.close() def getCutlist(self): @@ -390,10 +397,10 @@ Then seek to the end, press OK, select 'end cut'. That's it. bisect.insort(self.cut_list, (self.context_position, 1)) self.uploadCuesheet() - # we modify the "play" behaviour a bit: + # we modify the "play" behavior a bit: # if we press pause while being in slowmotion, we will pause (and not play) def playpauseService(self): - if self.seekstate not in [self.SEEK_STATE_PLAY, self.SEEK_STATE_SM_HALF, self.SEEK_STATE_SM_QUARTER, self.SEEK_STATE_SM_EIGHTH]: + if self.seekstate != self.SEEK_STATE_PLAY and not self.isStateSlowMotion(self.seekstate): self.unPauseService() else: self.pauseService()