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

Wired network control support is now more-or-less complete

curses/curses_misc.py:
  Made set_focus() actually set the focus
  Added ability for combobox to rebuild itself
curses/netentry_curses:
    Added WiredSettingsDialog.  Sometimes, the "Defaultness" of the network
      takes a little while to show up in the dialog.  Don't know why yet.
    Reorganized some of the AdvancedSettingsDialog code
curses/wicd-curses.py:
    Reactivated WiredComboBox
    Added support for WiredSettingsDialog
    Added ability to create and delete wired network profiles
    Fixed bug where the program could crash on the end of scanning networks if
      timing is slightly off
    Display the screen locker immediately after initiating a scan
curses/README,TODO: Wired network support is complete
in/man=wicd-curses.8.in:
  Wired network support is now complete
  Added revision information to the bottom of the man page
This commit is contained in:
Andrew Psaltis
2009-01-17 15:13:53 -05:00
parent bb0d43c222
commit be30004f0f
7 changed files with 167 additions and 67 deletions

View File

@@ -295,17 +295,28 @@ class ComboBox(urwid.WidgetWrap):
self.use_enter = use_enter
# The Focus
self.focus = focus
# The callback and friends
self.callback = callback
self.user_args = user_args
# Widget references to simplify some things
self.body = None
self.ui = None
self.row = None
def set_list(self,list):
self.list = list
def set_focus(self,index):
self.focus = index
self.cbox.set_w(SelText(self.list[index]+' vvv'))
def rebuild_combobox(self):
self.build_combobox(self.body,self.ui,self.row)
def build_combobox(self,body,ui,row):
str,trash = self.label.get_text()
self.cbox = DynWrap(SelText([self.list[self.focus]+' vvv']),attrs=self.attrs,focus_attr=self.focus_attr)
if str != '':
w = urwid.Columns([('fixed',len(str),self.label),self.cbox],dividechars=1)
@@ -319,6 +330,7 @@ class ComboBox(urwid.WidgetWrap):
self.set_w(w)
self.body = body
self.ui = ui
self.row = row
# If we press space or enter, be a combo box!
def keypress(self,size,key):
@@ -331,7 +343,8 @@ class ComboBox(urwid.WidgetWrap):
raise ComboBoxException('ComboBox must be built before use!')
retval = self.overlay.show(self.ui,self.body)
if retval != None:
self.cbox.set_w(SelText(retval+' vvv'))
self.set_focus(self.list.index(retval))
#self.cbox.set_w(SelText(retval+' vvv'))
if self.callback != None:
self.callback(self,self.overlay._listbox.get_focus()[1],self.user_args)
return self._w.keypress(size,key)