comparison urwid_satext/sat_widgets.py @ 82:c456beff1779

ConfirmDialog now manage a body message
author Goffi <goffi@goffi.org>
date Wed, 03 Sep 2014 17:42:06 +0200
parents 0ebd13729039
children 9f683df69a4c
comparison
equal deleted inserted replaced
81:0ebd13729039 82:c456beff1779
924 924
925 925
926 class ConfirmDialog(GenericDialog): 926 class ConfirmDialog(GenericDialog):
927 """Dialog with buttons for confirm or cancel an action""" 927 """Dialog with buttons for confirm or cancel an action"""
928 928
929 def __init__(self, title, style=None, **kwargs): 929 def __init__(self, title, message=None, style=None, **kwargs):
930 if style is None: 930 if style is None:
931 style = ['YES/NO'] 931 style = ['YES/NO']
932 GenericDialog.__init__(self, [], title, style, **kwargs) 932 GenericDialog.__init__(self,
933 [urwid.Text(message, 'center')] if message is not None else [],
934 title,
935 style,
936 **kwargs)
933 937
934 938
935 class Alert(GenericDialog): 939 class Alert(GenericDialog):
936 """Dialog with just a message and a OK button""" 940 """Dialog with just a message and a OK button"""
937 941