aboutsummaryrefslogtreecommitdiff
path: root/lib/python
diff options
context:
space:
mode:
authorStefan Pluecken <stefan.pluecken@multimedia-labs.de>2009-11-16 19:03:34 +0100
committerStefan Pluecken <stefan.pluecken@multimedia-labs.de>2009-11-16 19:07:32 +0100
commit58965c6783464b3390b7ad0687f4ed4a559f9ce2 (patch)
tree7f3bc7c0d88f708c0aaac9a83f2fb60198e332aa /lib/python
parentb01b4beb24bab09840bf11e2f7ca06cccfd5677c (diff)
downloadenigma2-58965c6783464b3390b7ad0687f4ed4a559f9ce2.tar.gz
enigma2-58965c6783464b3390b7ad0687f4ed4a559f9ce2.zip
fixes bug #291
don't crash if auto scart switching is enabled and the scart voltage is high on enigma2 startup not the best solution since the whole scart switching stuff is broken by design, but this fix prevents the crash
Diffstat (limited to 'lib/python')
-rw-r--r--lib/python/Screens/MessageBox.py4
-rw-r--r--lib/python/Screens/Scart.py19
2 files changed, 21 insertions, 2 deletions
diff --git a/lib/python/Screens/MessageBox.py b/lib/python/Screens/MessageBox.py
index 86bf07d3..f3538b7b 100644
--- a/lib/python/Screens/MessageBox.py
+++ b/lib/python/Screens/MessageBox.py
@@ -12,9 +12,11 @@ class MessageBox(Screen):
TYPE_WARNING = 2
TYPE_ERROR = 3
- def __init__(self, session, text, type = TYPE_YESNO, timeout = -1, close_on_any_key = False, default = True, enable_input = True):
+ def __init__(self, session, text, type = TYPE_YESNO, timeout = -1, close_on_any_key = False, default = True, enable_input = True, msgBoxID = None):
self.type = type
Screen.__init__(self, session)
+
+ self.msgBoxID = msgBoxID
self["text"] = Label(text)
self["Text"] = StaticText(text)
diff --git a/lib/python/Screens/Scart.py b/lib/python/Screens/Scart.py
index dc511448..00e78593 100644
--- a/lib/python/Screens/Scart.py
+++ b/lib/python/Screens/Scart.py
@@ -1,10 +1,13 @@
from Screen import Screen
from MessageBox import MessageBox
from Components.AVSwitch import AVSwitch
+from Tools import Notifications
class Scart(Screen):
def __init__(self, session, start_visible=True):
Screen.__init__(self, session)
+ self.msgBox = None
+ self.notificationVisible = None
self.avswitch = AVSwitch()
@@ -22,7 +25,11 @@ class Scart(Screen):
if not self.msgVisible:
self.msgVisible = True
self.avswitch.setInput("SCART")
- self.msgBox = self.session.openWithCallback(self.MsgBoxClosed, MessageBox, _("If you see this, something is wrong with\nyour scart connection. Press OK to return."), MessageBox.TYPE_ERROR)
+ if not self.session.in_exec:
+ self.notificationVisible = True
+ Notifications.AddNotificationWithCallback(self.MsgBoxClosed, MessageBox, _("If you see this, something is wrong with\nyour scart connection. Press OK to return."), MessageBox.TYPE_ERROR, msgBoxID = "scart_msgbox")
+ else:
+ self.msgBox = self.session.openWithCallback(self.MsgBoxClosed, MessageBox, _("If you see this, something is wrong with\nyour scart connection. Press OK to return."), MessageBox.TYPE_ERROR)
def MsgBoxClosed(self, *val):
self.msgBox = None
@@ -35,3 +42,13 @@ class Scart(Screen):
return
self.avswitch.setInput("ENCODER")
self.msgVisible = False
+ if self.notificationVisible:
+ self.avswitch.setInput("ENCODER")
+ self.notificationVisible = False
+ for notification in Notifications.current_notifications:
+ try:
+ if notification[1].msgBoxID == "scart_msgbox":
+ notification[1].close()
+ except:
+ print "other notification is open. try another one."
+ \ No newline at end of file