~nacl/wicd/1.6-urwid-0.9.9-compat

« back to all changes in this revision

Viewing changes to curses/wicd-curses.py

  • Committer: Andrew Psaltis
  • Date: 2009-11-21 02:14:15 UTC
  • Revision ID: ampsaltis@gmail.com-20091121021415-0sn05o7g7clxc626
Added support for the new and improved DropDown that is based on Ian Ward's PopUpTarget.

Show diffs side-by-side

added added

removed removed

Lines of Context:
59
59
from curses_misc import *
60
60
from prefs_curses import PrefsDialog
61
61
import netentry_curses
 
62
from popup import DropDown, PopUpTarget
62
63
 
63
64
from netentry_curses import WirelessSettingsDialog, WiredSettingsDialog,AdvancedSettingsDialog
64
65
 
534
535
        self.init_other_optcols()
535
536
 
536
537
        self.frame.set_body(self.thePile)
537
 
        urwid.WidgetWrap.__init__(self,self.frame)
 
538
        self.target = PopUpTarget(self.frame)
 
539
        urwid.WidgetWrap.__init__(self,self.target)
538
540
        # Booleans gallore!
539
541
        self.prev_state    = False
540
542
        self.connecting    = False
868
870
                            event, button, col, row,
869
871
                            focus=True)
870
872
                    continue
871
 
                k = self.frame.keypress(size, k)
 
873
                k = self.target.keypress(size, k)
872
874
                if self.diag:
873
875
                    if  k == 'esc' or k == 'q' or k == 'Q':
874
876
                        self.restore_primary()
938
940
        ('red','dark red','default'),
939
941
        ('bold','white','black','bold')]
940
942
 
941
 
    # This is a wrapper around a function that calls another a function that
942
 
    # is a wrapper around a infinite loop.  Fun.
943
943
    urwid.set_encoding('utf8')
944
944
    try: 
945
945
        ui.run_wrapper(run)