fixes crash in DVDBurn
[enigma2.git] / lib / python / Screens / TaskView.py
index 299c0fa2cee83d05e0716cd15144d6bf3e39515f..790e9bc68ea52ffdd70846539d67cbf3120c8e0e 100644 (file)
@@ -1,12 +1,14 @@
 from Screen import Screen
+from InfoBarGenerics import InfoBarNotifications
 
-class JobView(Screen):
+class JobView(InfoBarNotifications, Screen):
        def __init__(self, session, job, cancelable = True, close_on_finish = False):
                from Components.Sources.StaticText import StaticText
                from Components.Sources.Progress import Progress
                from Components.Sources.Boolean import Boolean
                from Components.ActionMap import ActionMap
                Screen.__init__(self, session)
+               InfoBarNotifications.__init__(self)
                self.job = job
                self.close_on_finish = close_on_finish
                self.cancelable = cancelable
@@ -31,7 +33,8 @@ class JobView(Screen):
                self.state_changed()
 
        def windowHide(self):
-               self.job.state_changed.remove(self.state_changed)
+               if len(self.job.state_changed) > 0:
+                   self.job.state_changed.remove(self.state_changed)
 
        def state_changed(self):
                j = self.job