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

curses/curses_misc.py:

Refactored some ComboBox internals
  Renamed show_first to focus in ComboBox
  Added callback support
curses/netentry_curses.py:
  Renamed NetEntryBase to AdvancedSettingsDialog, and WirelessNetEntry to
    WirelessSettingsDialog
  The "WirelessSettingsDialog" is complete. :-)  Raise it by pressing "C" on a wireless
    network.  Much of the code was taken from netentry.py.  The buttons aren't pretty
    like they are in the Preferences Dialog, but they are fully functional.
curses/prefs_curses.py:
  Refactored to accommodate the ComboBox changes
  Added a warning about changing backends
curses/wicd-curses.py:
  Refactored to accommodate changes to the rest of the program
  Added a constantly displayed message saying how to exit the program, other than
    ctrl+c
curses/TODO: Removed a bunch of stuff that is already implemented, added some stuff that
    needs to be implemented
curses/README: Added/clearified some things
This commit is contained in:
Andrew Psaltis
2009-01-09 20:42:12 -05:00
parent 6fabed0974
commit d1846cb627
7 changed files with 210 additions and 95 deletions

View File

@@ -109,6 +109,7 @@ class PrefsDialog(urwid.WidgetWrap):
backend_cat_t = ('header',language['backend'])
backend_t = language['backend']+':'
backend_list = ['spam','double spam','triple spam','quadruple spam']
backend_warn_t = ('important','Changes to the backend (probably) requires a daemon restart')
debug_cat_t = ('header','Debugging')
debug_mode_t = language['use_debug_mode']
@@ -207,6 +208,7 @@ class PrefsDialog(urwid.WidgetWrap):
self.backend_cat = urwid.Text(backend_cat_t)
self.backend_cbox = ComboBox(backend_t)
self.backend_warn = urwid.Text(backend_warn_t)
self.debug_cat = urwid.Text(debug_cat_t)
self.debug_mode_checkb = urwid.CheckBox(debug_mode_t)
@@ -218,7 +220,7 @@ class PrefsDialog(urwid.WidgetWrap):
advancedLB = urwid.ListBox([self.wpa_cat,
self.wpa_cbox,self.wpa_warn,_blank,
self.backend_cat,
self.backend_cbox,_blank,
self.backend_cbox,self.backend_warn,_blank,
self.debug_cat,
self.debug_mode_checkb, _blank,
self.wless_cat,
@@ -315,7 +317,7 @@ class PrefsDialog(urwid.WidgetWrap):
# Pick where to begin first:
def_driver = daemon.GetWPADriver()
try:
self.wpa_cbox.set_show_first(self.wpadrivers.index(def_driver))
self.wpa_cbox.set_focus(self.wpadrivers.index(def_driver))
except ValueError:
pass # It defaults to 0 anyway
@@ -326,9 +328,9 @@ class PrefsDialog(urwid.WidgetWrap):
self.backend_cbox.set_list(self.thebackends)
cur_backend = daemon.GetSavedBackend()
try:
self.backend_cbox.set_show_first(self.thebackends.index(cur_backend))
self.backend_cbox.set_focus(self.thebackends.index(cur_backend))
except ValueError:
self.backend_cbox.set_show_first(0)
self.backend_cbox.set_focus(0)
# Two last checkboxes
self.debug_mode_checkb.set_state(daemon.GetDebugMode())