1
0
mirror of https://github.com/gryf/wicd.git synced 2025-12-19 12:28:08 +01:00

New feature: dialogs to "forget" saved networks

This commit is contained in:
David Paleino
2012-05-06 17:16:15 +02:00
parent 1f9f5596f9
commit 11e8a96677
7 changed files with 188 additions and 5 deletions

View File

@@ -511,14 +511,17 @@ class Dialog2(urwid.WidgetWrap):
# Simple dialog with text in it and "OK"
class TextDialog(Dialog2):
def __init__(self, text, height, width, header=None,align='left'):
def __init__(self, text, height, width, header=None, align='left',
buttons=(_('OK'), 1)):
l = [urwid.Text(text)]
body = urwid.ListBox(l)
body = urwid.AttrWrap(body, 'body')
Dialog2.__init__(self, header, height+2, width+2, body)
self.add_buttons([('OK',1)])
if type(buttons) == list:
self.add_buttons(buttons)
else:
self.add_buttons([buttons])
def unhandled_key(self, size, k):
if k in ('up','page up','down','page down'):