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

Ad-hoc network support is added ("O").

This commit is should be the last one containing new interface elements. :-D
This also may not work directly from the install.  I need to change some stuff
first.
curses/curses_misc.py:
  Fixed bug in Dialog2 where mouse clicks would cause the program to crash
  Added DynEdit and DynIntEdit, Simple DynWrapped widgets, nothing special
    about them
curses/wicd-curses.py:
  Added support for Ad-Hoc network controls (I don't know exactly how this
    works)
curses/README,TODO,in/man=wicd-curses.8.in:
  Ad-Hoc network support has been added
This commit is contained in:
Andrew Psaltis
2009-01-23 21:13:36 -05:00
parent fa2a5a3704
commit abf05c782f
5 changed files with 97 additions and 10 deletions

View File

@@ -88,6 +88,20 @@ class DynWrap(urwid.AttrWrap):
def selectable(self):
return self._sensitive
# Just an Edit Dynwrapped to the most common specifications
class DynEdit(DynWrap):
def __init__(self,caption='',edit_text='',sensitive=True,attrs=('editbx','editnfc'),focus_attr='editfc'):
caption = ('editcp',caption + ': ')
edit = urwid.Edit(caption,edit_text)
self.__super.__init__(edit,sensitive,attrs,focus_attr)
# Just an IntEdit Dynwrapped to the most common specifications
class DynIntEdit(DynWrap):
def __init__(self,caption='',edit_text='',sensitive=True,attrs=('editbx','editnfc'),focus_attr='editfc'):
caption = ('editcp',caption + ':')
edit = urwid.IntEdit(caption,edit_text)
self.__super.__init__(edit,sensitive,attrs,focus_attr)
class MaskingEditException(Exception):
pass
@@ -436,13 +450,14 @@ class Dialog2(urwid.WidgetWrap):
overlay.mouse_event( size,
event, button, col, row,
focus=True)
if k == 'window resize':
size = ui.get_cols_rows()
k = self.view.keypress( size, k )
if k == 'esc':
raise DialogExit(-1)
if k:
self.unhandled_key( size, k)
else:
if k == 'window resize':
size = ui.get_cols_rows()
k = self.view.keypress( size, k )
if k == 'esc':
raise DialogExit(-1)
if k:
self.unhandled_key( size, k)
except DialogExit, e:
return self.on_exit( e.args[0] )