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

curses/curses_misc.py:

Modified TextDialog to use a listbox as opposed to one long text box
  Aligned the header on the right in Dialog2 by default
curses/wicd-curses.py:
  Removed the traceback if the user presses ctrl+c
  Refactored about_dialog to support the modified TextDialog
  Added a help dialog.  Raise it with "H"
  Refactored some code in the appGUI constructor so that I can recycle update_netlist()
curses/TODO, curses/README, in/man=wicd-curses.8.in:
  Help dialog now active
in/man=wicd-curses.8.in: Removed redundant scipt selector command
This commit is contained in:
Andrew Psaltis
2009-01-13 18:13:24 -05:00
parent d842c163b2
commit 2685a49779
5 changed files with 66 additions and 52 deletions

View File

@@ -370,7 +370,7 @@ class Dialog2(urwid.WidgetWrap):
self.frame = urwid.Frame( body, focus_part='footer')
if text is not None:
self.frame.header = urwid.Pile( [urwid.Text(text),
self.frame.header = urwid.Pile( [urwid.Text(text,align='right'),
urwid.Divider()] )
w = self.frame
self.view = w
@@ -428,13 +428,12 @@ class Dialog2(urwid.WidgetWrap):
def unhandled_key(self, size, key):
pass
# Simple dialog with text in it and "OK"
class TextDialog(Dialog2):
def __init__(self, text, height, width, header=None):
def __init__(self, text, height, width, header=None,align='left'):
l = []
# read the whole file (being slow, not lazy this time)
#for line in open(file).readlines():
# l.append( urwid.Text( line.rstrip() ))
l = [urwid.Text(text)]
for line in text:
l.append( urwid.Text( line,align=align))
body = urwid.ListBox(l)
body = urwid.AttrWrap(body, 'body')