1 from Screen import Screen
2 from Components.ActionMap import ActionMap
3 from Components.Label import Label
4 from Components.Button import Button
5 from Components.Pixmap import Pixmap
6 from Components.MenuList import MenuList
7 from enigma import eSize, ePoint
9 class MessageBox(Screen):
15 def __init__(self, session, text, type = TYPE_YESNO):
17 Screen.__init__(self, session)
19 self["text"] = Label(text)
21 self["ErrorPixmap"] = Pixmap()
22 self["QuestionPixmap"] = Pixmap()
23 self["InfoPixmap"] = Pixmap()
26 if type != self.TYPE_ERROR:
27 self["ErrorPixmap"].hide()
28 if type != self.TYPE_YESNO:
29 self["QuestionPixmap"].hide()
30 if type != self.TYPE_INFO:
31 self["InfoPixmap"].hide()
33 if type == self.TYPE_YESNO:
34 self.list = [ (_("yes"), 0), (_("no"), 1) ]
37 self["list"] = MenuList(self.list)
39 self["actions"] = ActionMap(["MsgBoxActions"],
41 "cancel": self.cancel,
43 "alwaysOK": self.alwaysOK
51 if self.type == self.TYPE_YESNO:
52 self.close(self["list"].getCurrent()[1] == 0)