add possibility to remove timers in epglist
[vuplus_dvbapp] / lib / python / Screens / TimerEdit.py
index 800bab3..59e2bd0 100644 (file)
@@ -199,9 +199,11 @@ class TimerEditList(Screen):
                        self.updateState()
 
        def removeTimerQuestion(self):
-               if not self["timerlist"].getCurrent():
+               cur = self["timerlist"].getCurrent()
+               if not cur:
                        return
-               self.session.openWithCallback(self.removeTimer, MessageBox, _("Really delete this timer?"))
+
+               self.session.openWithCallback(self.removeTimer, MessageBox, _("Do you really want to delete %s?") % (cur.name))
 
        def removeTimer(self, result):
                if not result:
@@ -212,18 +214,6 @@ class TimerEditList(Screen):
                        timer = cur
                        timer.afterEvent = AFTEREVENT.NONE
                        self.session.nav.RecordTimer.removeEntry(timer)
-                       if not timer.dontSave:
-                               for timer in self.session.nav.RecordTimer.timer_list:
-                                       if timer.dontSave and timer.autoincrease:
-                                               timer.end = timer.begin + (3600 * 24 * 356 * 1)
-                                               self.session.nav.RecordTimer.timeChanged(timer)
-                                               timersanitycheck = TimerSanityCheck(self.session.nav.RecordTimer.timer_list,timer)
-                                               if not timersanitycheck.check():
-                                                       tsc_list = timersanitycheck.getSimulTimerList()
-                                                       if len(tsc_list) > 1:
-                                                               timer.end = tsc_list[1].begin - 30
-                                                               self.session.nav.RecordTimer.timeChanged(timer)
-
                        self.refill()
                        self.updateState()
 
@@ -259,6 +249,7 @@ class TimerEditList(Screen):
                
        def addTimer(self, timer):
                self.session.openWithCallback(self.finishedAdd, TimerEntry, timer)
+                       
                
        def finishedEdit(self, answer):
                print "finished edit"
@@ -317,6 +308,7 @@ class TimerSanityConflict(Screen):
        EMPTY = 0
        ENABLE = 1
        DISABLE = 2
+       EDIT = 3
        
        def __init__(self, session, timer):
                Screen.__init__(self, session)
@@ -332,16 +324,19 @@ class TimerSanityConflict(Screen):
                                self.list.append((_("Conflicting timer") + " " + str(count), x))
                                self.list2.append((timer[count], False))
                        count += 1
+               if count == 1:
+                       self.list.append((_("Channel not in services list")))
 
                self["list"] = MenuList(self.list)
                self["timer2"] = TimerList(self.list2)
 
                self["key_red"] = Button("Edit")
                self["key_green"] = Button(" ")
-               self["key_yellow"] = Button("Edit")
+               self["key_yellow"] = Button(" ")
                self["key_blue"] = Button(" ")
 
                self.key_green_choice = self.EMPTY
+               self.key_yellow_choice = self.EMPTY
                self.key_blue_choice = self.EMPTY
 
                self["actions"] = ActionMap(["OkCancelActions", "DirectionActions", "ShortcutActions", "TimerEditActions"], 
@@ -415,9 +410,14 @@ class TimerSanityConflict(Screen):
                                self["actions"].actions.update({"green":self.toggleTimer1})
                                self["key_green"].setText(_("Disable"))
                                self.key_green_choice = self.DISABLE
+               
                if len(self.timer) > 1:
                        x = self["list"].getSelectedIndex()
                        if self.timer[x] is not None:
+                               if self.key_yellow_choice == self.EMPTY:
+                                       self["actions"].actions.update({"yellow":self.editTimer2})
+                                       self["key_yellow"].setText(_("Edit"))
+                                       self.key_yellow_choice = self.EDIT
                                if self.timer[x].disabled and self.key_blue_choice != self.ENABLE:
                                        self["actions"].actions.update({"blue":self.toggleTimer2})
                                        self["key_blue"].setText(_("Enable"))
@@ -432,9 +432,11 @@ class TimerSanityConflict(Screen):
                                        self.key_blue_choice = self.DISABLE
                else:
 #FIXME.... this doesnt hide the buttons self.... just the text
-                       self.removeAction("yellow")
-                       self["key_yellow"].setText(" ")
-                       self.key_yellow_choice = self.EMPTY
-                       self.removeAction("blue")
-                       self["key_blue"].setText(" ")
-                       self.key_blue_choice = self.EMPTY
+                       if self.key_yellow_choice != self.EMPTY:
+                               self.removeAction("yellow")
+                               self["key_yellow"].setText(" ")
+                               self.key_yellow_choice = self.EMPTY
+                       if self.key_blue_choice != self.EMPTY:
+                               self.removeAction("blue")
+                               self["key_blue"].setText(" ")
+                               self.key_blue_choice = self.EMPTY