+
+class TimerSanityConflict(Screen):
+ def __init__(self, session, timer):
+ Screen.__init__(self, session)
+ self.timer = timer
+ print "TimerSanityConflict", timer
+
+ self["timer1"] = TimerList(self.getTimerList(timer[0]))
+ if len(timer) > 1:
+ self["timer2"] = TimerList(self.getTimerList(timer[1]))
+ else:
+ self["timer2"] = TimerList([])
+
+ self.list = []
+ count = 0
+ for x in timer:
+ if count != 0:
+ self.list.append((_("Conflicting timer") + " " + str(count), x))
+ count += 1
+
+ self["list"] = MenuList(self.list)
+
+ self["key_red"] = Button("Edit")
+ self["key_green"] = Button("Disable")
+ self["key_yellow"] = Button("Edit")
+ self["key_blue"] = Button("Disable")
+
+ self["actions"] = ActionMap(["OkCancelActions", "DirectionActions", "ShortcutActions", "TimerEditActions"],
+ {
+ "ok": self.close,
+ #"cancel": self.leave,
+ "red": self.editTimer1,
+ "green": self.disableTimer1,
+# "yellow": self.editTimer2,
+# "blue": self.disableTimer2,
+ #"log": self.showLog,
+ #"left": self.left,
+ #"right": self.right,
+ "up": self.up,
+ "down": self.down
+ }, -1)
+
+ def getTimerList(self, timer):
+ return [(timer, False)]
+
+ def editTimer1(self):
+ self.session.openWithCallback(self.finishedEdit, TimerEntry, self["timer1"].getCurrent())
+
+ def disableTimer1(self):
+ self.timer[0].disabled = True
+ self.finishedEdit((True, self.timer[0]))
+
+ def finishedEdit(self, answer):
+ self.close((True, self.timer[0]))
+
+ def up(self):
+ self["list"].instance.moveSelection(self["list"].instance.moveUp)
+ self["timer2"].l.setList(self.getTimerList(self["list"].getCurrent()))
+
+ def down(self):
+ self["list"].instance.moveSelection(self["list"].instance.moveDown)
+ self["timer2"].l.setList(self.getTimerList(self["list"].getCurrent()))