restart previous running services in onClose event
[enigma2.git] / lib / python / Plugins / Extensions / CutListEditor / plugin.py
index 61acf042e8fe1265c28e3005356c6f06c1884b4c..c345667597bd99994daf94cdb66ec6ea47734785 100644 (file)
@@ -171,7 +171,7 @@ class CutListEditor(Screen, InfoBarBase, InfoBarSeek, InfoBarCueSheetSupport, He
                Screen.__init__(self, session)
                InfoBarSeek.__init__(self, actionmap = "CutlistSeekActions")
                InfoBarCueSheetSupport.__init__(self)
-               InfoBarBase.__init__(self)
+               InfoBarBase.__init__(self, steal_current_service = True)
                HelpableScreen.__init__(self)
                self.old_service = session.nav.getCurrentlyPlayingServiceReference()
                session.nav.playService(service)
@@ -213,6 +213,10 @@ class CutListEditor(Screen, InfoBarBase, InfoBarSeek, InfoBarCueSheetSupport, He
                # 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:
@@ -258,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):