1
0
mirror of https://github.com/gryf/wicd.git synced 2026-03-07 18:15:48 +01:00

curses/prefs_curses.py: Adapted widgets for integration into the main UI

curses/curses_misc.py:
  Removed the "bottom_part" from the TabColumns
curses/wicd-curses.py:
  Added support for editing preferences directly in the main UI w/o a dialog
  'left' now only quits with saving for the NetworkSettingsDialogs
    (suggestions as for what to do here would be appreciated)
This commit is contained in:
Andrew Psaltis
2009-03-06 12:49:27 -05:00
parent 32d0d57b6d
commit 421c108f04
4 changed files with 19 additions and 76 deletions

View File

@@ -564,9 +564,6 @@ class appGUI():
('I' ,'Hidden',None),
('Q' ,'Quit',loop.quit)
]
#(' ' ,' ',None),
#(' ' ,' ',None),
#(' ' ,' ',None),
self.primaryCols = OptCols(keys,debug=True)
#self.time_label = urwid.Text(strftime('%H:%M:%S'))
@@ -608,7 +605,6 @@ class appGUI():
('ESC','Cancel')
],debug=True )
# Does what it says it does
def lock_screen(self):
self.frame.set_body(self.screen_locker)
@@ -650,7 +646,6 @@ class appGUI():
# Be clunky until I get to a later stage of development.
# Update the list of networks. Usually called by DBus.
# TODO: Preserve current focus when updating the list.
@wrap_exceptions()
def update_netlist(self,state=None, x=None, force_check=False,firstrun=False):
# Don't even try to do this if we are running a dialog
@@ -755,7 +750,6 @@ class appGUI():
self.update_ui()
return True
# Cheap little indicator stating that we are actually connecting
twirl = ['|','/','-','\\']
tcount = 0 # Counter for said indicator
@@ -873,11 +867,14 @@ class appGUI():
if not self.pref:
self.pref = PrefsDialog(self.frame,(0,1),ui,
dbusmanager.get_dbus_ifaces())
if self.pref.run(ui,self.size,self.frame):
self.pref.save_settings()
self.update_ui()
self.pref.load_settings()
self.pref.ready_widgets(ui,self.frame)
self.frame.set_footer(urwid.Pile([self.prefCols,self.footer2]))
self.diag = self.pref
self.frame.set_body(self.diag)
# Halt here, keypress gets passed to the dialog otherwise
return True
if "A" in keys:
self.footer1 = self.confCols
about_dialog(self.frame)
if "C" in keys:
# Same as "enter" for now
@@ -925,7 +922,8 @@ class appGUI():
if self.diag:
if k == 'esc':
self.restore_primary()
if k == 'left' or k == 'meta enter':
if (k == 'left' and self.diag.__class__.__mro__[0] == \
type(urwid.WidgetWrap)) or k == 'meta enter':
self.diag.save_settings()
self.restore_primary()
return True