Screen: clear all elements on close
[enigma2.git] / lib / python / Screens / TimerEdit.py
index 6f050aaebe5093a889b1f1d353b996e4489de8a8..5233da9b759eb099ab5c05e821053a82091b5a94 100644 (file)
@@ -21,15 +21,15 @@ class TimerEditList(Screen):
 
                self["timerlist"] = TimerList(list)
                
-               self["key_red"] = Button("Delete")
-               self["key_green"] = Button("Add")
+               self["key_red"] = Button(_("Delete"))
+               self["key_green"] = Button(_("Add"))
                self["key_yellow"] = Button("")
                self["key_blue"] = Button("")
 
                self["actions"] = ActionMap(["OkCancelActions", "ShortcutActions"], 
                        {
                                "ok": self.openEdit,
-                               "cancel": self.close,
+                               "cancel": self.leave,
                                "red": self.removeTimer,
                                "green": self.addCurrentTimer
                        })
@@ -51,7 +51,7 @@ class TimerEditList(Screen):
                # FIXME doesn't work...
                self.session.nav.RecordTimer.removeEntry(self["timerlist"].getCurrent()[0])
                self.fillTimerList()
-               self["timerlist"].l.invalidate()
+               self["timerlist"].invalidate()
        
        def addCurrentTimer(self):
                begin = time()
@@ -89,6 +89,7 @@ class TimerEditList(Screen):
        def finishedEdit(self, answer):
                if (answer[0]):
                        print "Edited timer"
+                       self.session.nav.RecordTimer.timeChanged(answer[1])
                        self.fillTimerList()
                else:
                        print "Timeredit aborted"
@@ -99,3 +100,7 @@ class TimerEditList(Screen):
                        self.fillTimerList()
                else:
                        print "Timeredit aborted"               
+
+       def leave(self):
+               self.session.nav.RecordTimer.saveTimer()
+               self.close()
\ No newline at end of file