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

curses/curses_misc.py:

Added a get_edit_text function to ToggleEdit.
  Changed the get_selected function in ComboBox to return the index only.
curses/prefs_curses.py:
  Completed the load+save functions of the UI
  Buttons are now functional.  Only selecting the OK button will save the data for now.
curses/wicd-curses.py:
  Added support for the "Always Show Wired Interface" config option
  Completed support for the preferences dialog
curses/TODO,README: Preferences dialog is done. :-)
This commit is contained in:
Andrew Psaltis
2008-12-30 23:10:18 -05:00
parent 5fd6cca50b
commit 64741b032a
4 changed files with 181 additions and 58 deletions

View File

@@ -67,6 +67,9 @@ class ToggleEdit(urwid.WidgetWrap):
def set_edit_text(self,text):
self._w.set_edit_text(text)
def get_edit_text(self):
return self._w.get_edit_text()
# If we aren't sensitive, don't be selectable
def selectable(self):
return self.sensitive
@@ -75,7 +78,7 @@ class ToggleEdit(urwid.WidgetWrap):
def keypress(self,size,key):
return self._w.keypress(size,key)
# Tabbed interface
# Tabbed interface, mostly for use in the Preferences Dialog
class TabColumns(urwid.WidgetWrap):
"""
titles_dict = dictionary of tab_contents (a SelText) : tab_widget (box)
@@ -265,6 +268,7 @@ class ComboBox(urwid.WidgetWrap):
def selectable(self):
return True
# Return a tuple of (widget,position)
# Return the index of the selected element
def get_selected(self):
return self.overlay._listbox.get_focus()
wid,pos = self.overlay._listbox.get_focus()
return pos