changeset 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 12b5b1435e17
files urwid_satext/sat_widgets.py
diffstat 1 files changed, 6 insertions(+), 2 deletions(-) [+]
line wrap: on
line diff
--- a/urwid_satext/sat_widgets.py	Wed May 07 19:49:07 2014 +0200
+++ b/urwid_satext/sat_widgets.py	Wed Sep 03 17:42:06 2014 +0200
@@ -926,10 +926,14 @@
 class ConfirmDialog(GenericDialog):
     """Dialog with buttons for confirm or cancel an action"""
 
-    def __init__(self, title, style=None, **kwargs):
+    def __init__(self, title, message=None, style=None, **kwargs):
         if style is None:
             style = ['YES/NO']
-        GenericDialog.__init__(self, [], title, style, **kwargs)
+        GenericDialog.__init__(self,
+                               [urwid.Text(message, 'center')] if message is not None else [],
+                               title,
+                               style,
+                               **kwargs)
 
 
 class Alert(GenericDialog):