Skip to content

Commit

Permalink
MessageBox: Add option to set a custom screen title
Browse files Browse the repository at this point in the history
  • Loading branch information
littlesat committed Dec 23, 2016
1 parent fdb61bc commit c3384c5
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions lib/python/Screens/MessageBox.py
Expand Up @@ -13,7 +13,7 @@ class MessageBox(Screen):
TYPE_ERROR = 3
TYPE_MESSAGE = 4

def __init__(self, session, text, type=TYPE_YESNO, timeout=-1, close_on_any_key=False, default=True, enable_input=True, msgBoxID=None, picon=None, simple=False, list=[], timeout_default=None):
def __init__(self, session, text, type=TYPE_YESNO, timeout=-1, close_on_any_key=False, default=True, enable_input=True, msgBoxID=None, picon=None, simple=False, list=[], timeout_default=None, title=None):
self.type = type
Screen.__init__(self, session)
self.setScreenPathMode(None)
Expand Down Expand Up @@ -46,7 +46,7 @@ def __init__(self, session, text, type=TYPE_YESNO, timeout=-1, close_on_any_key=
self["InfoPixmap"].hide()
if picon != self.TYPE_WARNING:
self["WarningPixmap"].hide()
self.title = self.type < self.TYPE_MESSAGE and [_("Question"), _("Information"), _("Warning"), _("Error")][self.type] or _("Message")
self.title = title if title else self.type < self.TYPE_MESSAGE and [_("Question"), _("Information"), _("Warning"), _("Error")][self.type] or _("Message")
if type == self.TYPE_YESNO:
if list:
self.list = list
Expand Down

0 comments on commit c3384c5

Please sign in to comment.