From 6d00df2675765f9c39fa80cd01bd8060147fda5a Mon Sep 17 00:00:00 2001 From: Andrew Psaltis Date: Sat, 23 May 2009 00:32:29 -0400 Subject: [PATCH] Made M^ and C^ into Alt+ and Ctrl+ respectively in OptCols. Rearranged the OptCols for the preferences dialog to match those in the others. --- curses/curses_misc.py | 9 +++++++-- curses/wicd-curses.py | 15 ++++++--------- 2 files changed, 13 insertions(+), 11 deletions(-) diff --git a/curses/curses_misc.py b/curses/curses_misc.py index 9639c9a..e8feefe 100644 --- a/curses/curses_misc.py +++ b/curses/curses_misc.py @@ -558,6 +558,7 @@ class ClickCols(urwid.WidgetWrap): class OptCols(urwid.WidgetWrap): # tuples = [(key,desc)], on_event gets passed a key # attrs = (attr_key,attr_desc) + # handler = function passed the key of the "button" pressed # mentions of 'left' and right will be converted to <- and -> respectively def __init__(self,tuples,handler,attrs=('body','infobar'),debug=False): # Find the longest string. Keys for this bar should be no greater than @@ -578,9 +579,11 @@ class OptCols(urwid.WidgetWrap): key = '' for part in splitcmd: if part == 'ctrl': - key+='C^' + key+='Ctrl+' elif part == 'meta': - key+='M^' + # If anyone has a problem with this, they can bother me + # about it. + key+='Alt+' else: if part == 'left': key += '<-' @@ -588,6 +591,8 @@ class OptCols(urwid.WidgetWrap): key += '->' elif part == 'esc': key += 'ESC' + elif part == 'enter': + key += 'Enter' else: key += part diff --git a/curses/wicd-curses.py b/curses/wicd-curses.py index 2d4d0ea..a2e0b51 100755 --- a/curses/wicd-curses.py +++ b/curses/wicd-curses.py @@ -571,15 +571,12 @@ class appGUI(): def init_other_optcols(self): # The "tabbed" preferences dialog - self.prefCols = OptCols( [('meta enter','OK'), - ('esc','Cancel'), - ('meta [','Tab Left',), - ('meta ]','Tab Right')],self.handle_keys - ) - self.confCols = OptCols( [ - ('meta enter','OK'), - ('esc','Cancel') - ],self.handle_keys) + self.prefCols = OptCols( [ ('meta enter','OK'), + ('meta [','Tab Left',), + ('meta ]','Tab Right'), + ('esc','Cancel') ], self.handle_keys) + self.confCols = OptCols( [ ('meta enter','OK'), + ('esc','Cancel') ],self.handle_keys) # Does what it says it does def lock_screen(self):