mirror of
https://github.com/gryf/wicd.git
synced 2025-12-19 20:38:00 +01:00
Made M^ and C^ into Alt+ and Ctrl+ respectively in OptCols.
Rearranged the OptCols for the preferences dialog to match those in the others.
This commit is contained in:
@@ -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
|
||||
|
||||
|
||||
@@ -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):
|
||||
|
||||
Reference in New Issue
Block a user