aboutsummaryrefslogtreecommitdiff
path: root/lib/python
diff options
context:
space:
mode:
authorAndreas Monzner <andreas.monzner@multimedia-labs.de>2008-07-01 21:38:07 +0000
committerAndreas Monzner <andreas.monzner@multimedia-labs.de>2008-07-01 21:38:07 +0000
commit7f088b2e0ec5051c3b9b9a1942198f0be28f315b (patch)
tree81ff377dca05dd34872806f28cd325e8e0d8a7c3 /lib/python
parentf21ed7557f028e334810bf1094251f93520dce2a (diff)
downloadenigma2-7f088b2e0ec5051c3b9b9a1942198f0be28f315b.tar.gz
enigma2-7f088b2e0ec5051c3b9b9a1942198f0be28f315b.zip
restart previous running services in onClose event
remove some debug output
Diffstat (limited to 'lib/python')
-rw-r--r--lib/python/Plugins/Extensions/CutListEditor/plugin.py5
-rw-r--r--lib/python/Plugins/SystemPlugins/PositionerSetup/plugin.py11
-rw-r--r--lib/python/Plugins/SystemPlugins/Satfinder/plugin.py7
-rw-r--r--lib/python/Screens/ChannelSelection.py7
-rw-r--r--lib/python/Screens/InfoBar.py6
-rw-r--r--lib/python/Screens/InfoBarGenerics.py12
-rw-r--r--lib/python/Screens/Standby.py7
-rw-r--r--lib/python/Screens/SubservicesQuickzap.py6
8 files changed, 43 insertions, 18 deletions
diff --git a/lib/python/Plugins/Extensions/CutListEditor/plugin.py b/lib/python/Plugins/Extensions/CutListEditor/plugin.py
index 7ebc42b5..c3456675 100644
--- a/lib/python/Plugins/Extensions/CutListEditor/plugin.py
+++ b/lib/python/Plugins/Extensions/CutListEditor/plugin.py
@@ -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):
diff --git a/lib/python/Plugins/SystemPlugins/PositionerSetup/plugin.py b/lib/python/Plugins/SystemPlugins/PositionerSetup/plugin.py
index 90de8b2f..4ade7fe0 100644
--- a/lib/python/Plugins/SystemPlugins/PositionerSetup/plugin.py
+++ b/lib/python/Plugins/SystemPlugins/PositionerSetup/plugin.py
@@ -125,15 +125,20 @@ class PositionerSetup(Screen):
self.statusTimer = eTimer()
self.statusTimer.callback.append(self.updateStatus)
self.statusTimer.start(50, False)
+ self.onClose.append(self.__onClose)
+
+ def __onClose(self):
+ self.session.nav.playService(self.oldref)
def restartPrevService(self, yesno):
if yesno:
if self.frontend:
self.frontend = None
del self.raw_channel
- self.session.nav.playService(self.oldref)
- self.close(None)
-
+ else:
+ self.oldref=None
+ self.close(None)
+
def keyCancel(self):
if self.oldref:
self.session.openWithCallback(self.restartPrevService, MessageBox, _("Zap back to service before positioner setup?"), MessageBox.TYPE_YESNO)
diff --git a/lib/python/Plugins/SystemPlugins/Satfinder/plugin.py b/lib/python/Plugins/SystemPlugins/Satfinder/plugin.py
index 90650406..d6d967d2 100644
--- a/lib/python/Plugins/SystemPlugins/Satfinder/plugin.py
+++ b/lib/python/Plugins/SystemPlugins/Satfinder/plugin.py
@@ -115,6 +115,10 @@ class Satfinder(ScanSetup):
self["introduction"].setText("")
self["Frontend"] = FrontendStatus(frontend_source = lambda : self.frontend, update_interval = 100)
self.initcomplete = True
+ self.onClose.append(self.__onClose)
+
+ def __onClose(self):
+ self.session.nav.playService(self.oldref)
def createSetup(self):
self.typeOfTuningEntry = None
@@ -227,7 +231,8 @@ class Satfinder(ScanSetup):
if self.frontend:
self.frontend = None
del self.raw_channel
- self.session.nav.playService(self.oldref)
+ else:
+ self.oldref = None
self.close(None)
def keyCancel(self):
diff --git a/lib/python/Screens/ChannelSelection.py b/lib/python/Screens/ChannelSelection.py
index 64ae5492..2fd3bd8b 100644
--- a/lib/python/Screens/ChannelSelection.py
+++ b/lib/python/Screens/ChannelSelection.py
@@ -1371,6 +1371,11 @@ class ChannelSelectionRadio(ChannelSelectionBase, ChannelSelectionEdit, ChannelS
},-1)
self["RdsActions"].setEnabled(False)
infobar.rds_display.onRassInteractivePossibilityChanged.append(self.RassInteractivePossibilityChanged)
+ self.onClose.append(self.__onClose)
+
+ def __onClose(self):
+ lastservice=eServiceReference(config.tv.lastservice.value)
+ self.session.nav.playService(lastservice)
def startRassInteractive(self):
self.info.hide();
@@ -1389,8 +1394,6 @@ class ChannelSelectionRadio(ChannelSelectionBase, ChannelSelectionEdit, ChannelS
self.infobar.rds_display.onRassInteractivePossibilityChanged.remove(self.RassInteractivePossibilityChanged)
self.info.hide()
#set previous tv service
- lastservice=eServiceReference(config.tv.lastservice.value)
- self.session.nav.playService(lastservice)
self.close(None)
def __evServiceStart(self):
diff --git a/lib/python/Screens/InfoBar.py b/lib/python/Screens/InfoBar.py
index 8f400d24..05c5c98a 100644
--- a/lib/python/Screens/InfoBar.py
+++ b/lib/python/Screens/InfoBar.py
@@ -152,6 +152,10 @@ class MoviePlayer(InfoBarBase, InfoBarShowHide, \
self.lastservice = self.session.nav.getCurrentlyPlayingServiceReference()
self.session.nav.playService(service)
self.returning = False
+ self.onClose.append(self.__onClose)
+
+ def __onClose(self):
+ self.session.nav.playService(self.lastservice)
def leavePlayer(self):
self.is_closing = True
@@ -171,14 +175,12 @@ class MoviePlayer(InfoBarBase, InfoBarShowHide, \
def leavePlayerConfirmed(self, answer):
answer = answer and answer[1]
if answer == "quit":
- self.session.nav.playService(self.lastservice)
config.movielist.last_videodir.cancel()
self.close()
elif answer == "movielist":
ref = self.session.nav.getCurrentlyPlayingServiceReference()
self.returning = True
self.session.openWithCallback(self.movieSelected, MovieSelection, ref)
- self.session.nav.playService(self.lastservice)
elif answer == "restart":
self.doSeek(0)
diff --git a/lib/python/Screens/InfoBarGenerics.py b/lib/python/Screens/InfoBarGenerics.py
index 2227f8b9..85f34200 100644
--- a/lib/python/Screens/InfoBarGenerics.py
+++ b/lib/python/Screens/InfoBarGenerics.py
@@ -730,14 +730,14 @@ class InfoBarSeek:
return True
def __seekableStatusChanged(self):
- print "seekable status changed!"
+# print "seekable status changed!"
if not self.isSeekable():
self["SeekActions"].setEnabled(False)
- print "not seekable, return to play"
+# print "not seekable, return to play"
self.setSeekState(self.SEEK_STATE_PLAY)
else:
self["SeekActions"].setEnabled(True)
- print "seekable"
+# print "seekable"
def __serviceStarted(self):
self.seekstate = self.SEEK_STATE_PLAY
@@ -1170,8 +1170,8 @@ class InfoBarTimeshift:
def __seekableStatusChanged(self):
enabled = False
- print "self.isSeekable", self.isSeekable()
- print "self.timeshift_enabled", self.timeshift_enabled
+# print "self.isSeekable", self.isSeekable()
+# print "self.timeshift_enabled", self.timeshift_enabled
# when this service is not seekable, but timeshift
# is enabled, this means we can activate
@@ -1179,7 +1179,7 @@ class InfoBarTimeshift:
if not self.isSeekable() and self.timeshift_enabled:
enabled = True
- print "timeshift activate:", enabled
+# print "timeshift activate:", enabled
self["TimeshiftActivateActions"].setEnabled(enabled)
def __serviceStarted(self):
diff --git a/lib/python/Screens/Standby.py b/lib/python/Screens/Standby.py
index 4cda9d19..f7c819de 100644
--- a/lib/python/Screens/Standby.py
+++ b/lib/python/Screens/Standby.py
@@ -12,8 +12,6 @@ class Standby(Screen):
#set input to encoder
self.avswitch.setInput("ENCODER")
#restart last played service
- if self.prev_running_service:
- self.session.nav.playService(self.prev_running_service)
#unmute adc
self.leaveMute()
#set brightness of lcd
@@ -56,6 +54,11 @@ class Standby(Screen):
config.lcd.standby.apply()
self.onShow.append(self.__onShow)
self.onHide.append(self.__onHide)
+ self.onClose.append(self.__onClose)
+
+ def __onClose(self):
+ if self.prev_running_service:
+ self.session.nav.playService(self.prev_running_service)
def createSummary(self):
return StandbySummary
diff --git a/lib/python/Screens/SubservicesQuickzap.py b/lib/python/Screens/SubservicesQuickzap.py
index 84c8317c..24af517d 100644
--- a/lib/python/Screens/SubservicesQuickzap.py
+++ b/lib/python/Screens/SubservicesQuickzap.py
@@ -46,6 +46,11 @@ class SubservicesQuickzap(InfoBarBase, InfoBarShowHide, InfoBarMenu, InfoBarInst
"9": self.keyNumberGlobal,
"0": self.keyNumberGlobal
}, 0)
+
+ self.onClose.append(self.__onClose)
+
+ def __onClose(self):
+ self.session.nav.playService(self.restoreService, False)
def onLayoutFinished(self):
self.timer.start(0,True)
@@ -113,7 +118,6 @@ class SubservicesQuickzap(InfoBarBase, InfoBarShowHide, InfoBarMenu, InfoBarInst
def quit(self, answer):
if answer:
- self.session.nav.playService(self.restoreService, False)
self.close()
def playSubservice(self, number = 0):