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):
|
class OptCols(urwid.WidgetWrap):
|
||||||
# tuples = [(key,desc)], on_event gets passed a key
|
# tuples = [(key,desc)], on_event gets passed a key
|
||||||
# attrs = (attr_key,attr_desc)
|
# 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
|
# mentions of 'left' and right will be converted to <- and -> respectively
|
||||||
def __init__(self,tuples,handler,attrs=('body','infobar'),debug=False):
|
def __init__(self,tuples,handler,attrs=('body','infobar'),debug=False):
|
||||||
# Find the longest string. Keys for this bar should be no greater than
|
# Find the longest string. Keys for this bar should be no greater than
|
||||||
@@ -578,9 +579,11 @@ class OptCols(urwid.WidgetWrap):
|
|||||||
key = ''
|
key = ''
|
||||||
for part in splitcmd:
|
for part in splitcmd:
|
||||||
if part == 'ctrl':
|
if part == 'ctrl':
|
||||||
key+='C^'
|
key+='Ctrl+'
|
||||||
elif part == 'meta':
|
elif part == 'meta':
|
||||||
key+='M^'
|
# If anyone has a problem with this, they can bother me
|
||||||
|
# about it.
|
||||||
|
key+='Alt+'
|
||||||
else:
|
else:
|
||||||
if part == 'left':
|
if part == 'left':
|
||||||
key += '<-'
|
key += '<-'
|
||||||
@@ -588,6 +591,8 @@ class OptCols(urwid.WidgetWrap):
|
|||||||
key += '->'
|
key += '->'
|
||||||
elif part == 'esc':
|
elif part == 'esc':
|
||||||
key += 'ESC'
|
key += 'ESC'
|
||||||
|
elif part == 'enter':
|
||||||
|
key += 'Enter'
|
||||||
else:
|
else:
|
||||||
key += part
|
key += part
|
||||||
|
|
||||||
|
|||||||
@@ -571,15 +571,12 @@ class appGUI():
|
|||||||
|
|
||||||
def init_other_optcols(self):
|
def init_other_optcols(self):
|
||||||
# The "tabbed" preferences dialog
|
# The "tabbed" preferences dialog
|
||||||
self.prefCols = OptCols( [('meta enter','OK'),
|
self.prefCols = OptCols( [ ('meta enter','OK'),
|
||||||
('esc','Cancel'),
|
('meta [','Tab Left',),
|
||||||
('meta [','Tab Left',),
|
('meta ]','Tab Right'),
|
||||||
('meta ]','Tab Right')],self.handle_keys
|
('esc','Cancel') ], self.handle_keys)
|
||||||
)
|
self.confCols = OptCols( [ ('meta enter','OK'),
|
||||||
self.confCols = OptCols( [
|
('esc','Cancel') ],self.handle_keys)
|
||||||
('meta enter','OK'),
|
|
||||||
('esc','Cancel')
|
|
||||||
],self.handle_keys)
|
|
||||||
|
|
||||||
# Does what it says it does
|
# Does what it says it does
|
||||||
def lock_screen(self):
|
def lock_screen(self):
|
||||||
|
|||||||
Reference in New Issue
Block a user