X-Git-Url: http://code.vuplus.com/gitweb/?p=vuplus_dvbapp;a=blobdiff_plain;f=lib%2Fpython%2FScreens%2FMessageBox.py;h=f3538b7b730090e71cd6e1fdc4041ec39ec33eee;hp=8477fe04b97c04e68e4882f958c0f0faecc99a31;hb=HEAD;hpb=3259f96f2e8f864709b819b4d27ee8ef551eeb2c diff --git a/lib/python/Screens/MessageBox.py b/lib/python/Screens/MessageBox.py index 8477fe0..f3538b7 100644 --- a/lib/python/Screens/MessageBox.py +++ b/lib/python/Screens/MessageBox.py @@ -12,9 +12,11 @@ class MessageBox(Screen): TYPE_WARNING = 2 TYPE_ERROR = 3 - def __init__(self, session, text, type = TYPE_YESNO, timeout = -1, close_on_any_key = False, default = True): + def __init__(self, session, text, type = TYPE_YESNO, timeout = -1, close_on_any_key = False, default = True, enable_input = True, msgBoxID = None): self.type = type Screen.__init__(self, session) + + self.msgBoxID = msgBoxID self["text"] = Label(text) self["Text"] = StaticText(text) @@ -43,24 +45,25 @@ class MessageBox(Screen): else: self.list = [ (_("no"), 1), (_("yes"), 0) ] - if len(self.list): + if self.list: self["selectedChoice"].setText(self.list[0][0]) self["list"] = MenuList(self.list) - self["actions"] = ActionMap(["MsgBoxActions", "DirectionActions"], - { - "cancel": self.cancel, - "ok": self.ok, - "alwaysOK": self.alwaysOK, - "up": self.up, - "down": self.down, - "left": self.left, - "right": self.right, - "upRepeated": self.up, - "downRepeated": self.down, - "leftRepeated": self.left, - "rightRepeated": self.right - }, -1) + if enable_input: + self["actions"] = ActionMap(["MsgBoxActions", "DirectionActions"], + { + "cancel": self.cancel, + "ok": self.ok, + "alwaysOK": self.alwaysOK, + "up": self.up, + "down": self.down, + "left": self.left, + "right": self.right, + "upRepeated": self.up, + "downRepeated": self.down, + "leftRepeated": self.left, + "rightRepeated": self.right + }, -1) def initTimeout(self, timeout): self.timeout = timeout @@ -87,6 +90,7 @@ class MessageBox(Screen): def stopTimer(self): if self.timerRunning: del self.timer + self.onExecBegin.remove(self.startTimer) self.setTitle(self.origTitle) self.timerRunning = False @@ -133,7 +137,7 @@ class MessageBox(Screen): if self.close_on_any_key: self.close(True) self["list"].instance.moveSelection(direction) - if len(self.list): + if self.list: self["selectedChoice"].setText(self["list"].getCurrent()[0]) self.stopTimer()