fix timer disable/reenable
[enigma2.git] / RecordTimer.py
index 386e03f06da3841063b3b5b063c5af81a87f7c82..9a874a4c066c24a7df678e4fbfe974f4f13095f4 100644 (file)
@@ -61,6 +61,7 @@ class RecordTimerEntry(timer.TimerEntry):
        
        def resetState(self):
                self.state = self.StateWaiting
+               self.cancelled = False
                self.first_try_prepare = True
                self.timeChanged()
        
@@ -148,6 +149,10 @@ class RecordTimerEntry(timer.TimerEntry):
                        self.start_prepare = time.time() + self.backoff
                        return False
                elif next_state == self.StateRunning:
+                       # if this timer has been cancelled, just go to "end" state.
+                       if self.cancelled:
+                               return True
+
                        if self.justplay:
                                self.log(11, "zapping")
                                NavigationInstance.instance.playService(self.service_ref.ref)
@@ -365,10 +370,6 @@ class RecordTimer(timer.Timer):
                                                if time_match < diff:
                                                        time_match = diff
                return time_match
-                                                       
-                                               
-                                               
-                       
 
        def removeEntry(self, entry):
                print "[Timer] Remove " + str(entry)