mirror of
https://github.com/gryf/wicd.git
synced 2025-12-19 20:38:00 +01:00
curses/curses_misc.py:
Fixed some of the arguments in MaskingEdit
curses/netentry_curses.py:
Added an autoconnect switch to the WirelessSettingsDialog
Reformatted some code
Ensured that the buttons are glued to the bottom of the dialog
AUTHORS:
Changed Adam's e-mail to match the ones in the man page.
AUTHORS, in/man=wicd.8.in:
Added/updated my e-mail
in/man=wicd-curses.8.in:
Removed mention of the keymap modification (too difficult/potentially
problematic)
Removed mention of my branch, bugs can be tagged with "wicd-curses" or something
like that
This commit is contained in:
3
AUTHORS
3
AUTHORS
@@ -1,2 +1,3 @@
|
||||
Adam Blackburn (compwiz18@users.sourceforge.net)
|
||||
Adam Blackburn (compwiz18@gmail.com)
|
||||
Dan O'Reilly (oreilldf@gmail.com)
|
||||
Andrew Psaltis (ampsaltis@gmail.com) (wicd-curses)
|
||||
|
||||
@@ -110,13 +110,13 @@ class MaskingEdit(urwid.Edit):
|
||||
"""
|
||||
mask_mode = one of:
|
||||
"always" : everything is a '*' all of the time
|
||||
"on_focus" : everything is a '*' only when not in focus
|
||||
"no_focus" : everything is a '*' only when not in focus
|
||||
"off" : everything is always unmasked
|
||||
mask_char = the single character that masks all other characters in the field
|
||||
"""
|
||||
def __init__(self, caption = "", edit_text = "", multiline = False,
|
||||
align = 'left', wrap = 'space', allow_tab = False,
|
||||
edit_pos = None, layout=None, mask_mode="masked",mask_char='*'):
|
||||
edit_pos = None, layout=None, mask_mode="always",mask_char='*'):
|
||||
self.mask_mode = mask_mode
|
||||
if len(mask_char) > 1:
|
||||
raise MaskingEditException('Masks of more than one character are not supported!')
|
||||
@@ -137,7 +137,7 @@ class MaskingEdit(urwid.Edit):
|
||||
focus.
|
||||
"""
|
||||
# If we aren't masking anything ATM, then act like an Edit. No problems.
|
||||
if self.mask_mode == "off" or (self.mask_mode == 'on_focus' and focus == True):
|
||||
if self.mask_mode == "off" or (self.mask_mode == 'no_focus' and focus == True):
|
||||
canv = self.__super.render((maxcol,),focus)
|
||||
# The cache messes this thing up, because I am totally changing what
|
||||
# is displayed.
|
||||
|
||||
@@ -54,11 +54,11 @@ class AdvancedSettingsDialog(urwid.WidgetWrap):
|
||||
|
||||
use_static_dns_t = language['use_static_dns']
|
||||
use_global_dns_t = language['use_global_dns']
|
||||
dns_dom_t = ('editcp',language['dns_domain']+': ')
|
||||
search_dom_t = ('editcp',language['search_domain']+':')
|
||||
dns1_t = ('editcp',language['dns']+ ' ' + language['1']+':'+' '*8)
|
||||
dns2_t = ('editcp',language['dns']+ ' ' + language['2']+':'+' '*8)
|
||||
dns3_t = ('editcp',language['dns']+ ' ' + language['3']+':'+' '*8)
|
||||
dns_dom_t = ('editcp',language['dns_domain']+': ')
|
||||
search_dom_t = ('editcp',language['search_domain']+':')
|
||||
dns1_t = ('editcp',language['dns']+ ' ' + language['1']+':'+' '*8)
|
||||
dns2_t = ('editcp',language['dns']+ ' ' + language['2']+':'+' '*8)
|
||||
dns3_t = ('editcp',language['dns']+ ' ' + language['3']+':'+' '*8)
|
||||
|
||||
cancel_t = 'Cancel'
|
||||
ok_t = 'OK'
|
||||
@@ -105,7 +105,7 @@ class AdvancedSettingsDialog(urwid.WidgetWrap):
|
||||
|
||||
self._listbox = urwid.ListBox(walker)
|
||||
#self._frame = urwid.Frame(self._listbox)
|
||||
self._frame = urwid.Frame(self._listbox)
|
||||
self._frame = urwid.Frame(self._listbox,footer=self.button_cols)
|
||||
self.__super.__init__(self._frame)
|
||||
|
||||
|
||||
@@ -192,7 +192,12 @@ class AdvancedSettingsDialog(urwid.WidgetWrap):
|
||||
self.overlay.mouse_event( dim,
|
||||
event, button, col, row,
|
||||
focus=True)
|
||||
self.overlay.keypress(dim, k)
|
||||
k = self.overlay.keypress(dim, k)
|
||||
if k in ('up','page up'):
|
||||
self._w.set_focus('body')
|
||||
elif k in ('down','page down'):
|
||||
self._w.set_focus('footer')
|
||||
|
||||
if "window resize" in keys:
|
||||
dim = ui.get_cols_rows()
|
||||
if "esc" in keys or 'Q' in keys:
|
||||
@@ -204,6 +209,7 @@ class AdvancedSettingsDialog(urwid.WidgetWrap):
|
||||
if self.CANCEL_PRESSED:
|
||||
return False
|
||||
|
||||
|
||||
class WiredSettingsDialog(AdvancedSettingsDialog):
|
||||
def __init__(self,name):
|
||||
global wired, daemon
|
||||
@@ -212,7 +218,6 @@ class WiredSettingsDialog(AdvancedSettingsDialog):
|
||||
#self.cur_default =
|
||||
# Add widgets to listbox
|
||||
self._w.body.body.append(self.set_default)
|
||||
self._w.body.body.append(self.button_cols)
|
||||
|
||||
self.prof_name = name
|
||||
title = ">"+language['configuring_wired'].replace('$A',self.prof_name)
|
||||
@@ -265,16 +270,19 @@ class WirelessSettingsDialog(AdvancedSettingsDialog):
|
||||
self.networkID = networkID
|
||||
global_settings_t = language['global_settings']
|
||||
encryption_t = language['use_encryption']
|
||||
|
||||
autoconnect_t = language['automatic_connect']
|
||||
|
||||
self.global_settings_chkbox = urwid.CheckBox(global_settings_t)
|
||||
self.encryption_chkbox = urwid.CheckBox(encryption_t,on_state_change=self.encryption_toggle)
|
||||
self.encryption_combo = ComboBox(callback=self.combo_on_change)
|
||||
self.autoconnect_chkbox = urwid.CheckBox(autoconnect_t)
|
||||
self.pile_encrypt = None
|
||||
# _w is a Frame, _w.body is a ListBox, _w.body.body is the ListWalker :-)
|
||||
self._w.body.body.append(self.global_settings_chkbox)
|
||||
self._w.body.body.append(self.encryption_chkbox)
|
||||
self._w.body.body.append(self.encryption_combo)
|
||||
self._w.body.body.append(self.button_cols)
|
||||
self._listbox.body.append(urwid.Text(""))
|
||||
self._listbox.body.append(self.global_settings_chkbox)
|
||||
self._listbox.body.append(self.autoconnect_chkbox)
|
||||
self._listbox.body.append(self.encryption_chkbox)
|
||||
self._listbox.body.append(self.encryption_combo)
|
||||
self.encrypt_types = misc.LoadEncryptionMethods()
|
||||
self.set_values()
|
||||
|
||||
@@ -306,6 +314,7 @@ class WirelessSettingsDialog(AdvancedSettingsDialog):
|
||||
self.dns_dom_edit.set_edit_text(self.format_entry(networkID, "dns_domain"))
|
||||
self.search_dom_edit.set_edit_text(self.format_entry(networkID, "search_domain"))
|
||||
|
||||
self.autoconnect_chkbox.set_state(to_bool(self.format_entry(networkID, "automatic")))
|
||||
|
||||
#self.reset_static_checkboxes()
|
||||
self.encryption_chkbox.set_state(bool(wireless.GetWirelessProperty(networkID,
|
||||
@@ -367,6 +376,10 @@ class WirelessSettingsDialog(AdvancedSettingsDialog):
|
||||
#print "no encryption specified..."
|
||||
self.set_net_prop("enctype", "None")
|
||||
AdvancedSettingsDialog.save_settings(self)
|
||||
|
||||
# Save the autoconnect setting. This is not where it originally was
|
||||
# in the GTK UI.
|
||||
self.set_net_prop("automatic",self.autoconnect_chkbox.get_state())
|
||||
|
||||
if self.global_settings_chkbox.get_state():
|
||||
self.set_net_prop('use_settings_globally', True)
|
||||
@@ -385,7 +398,7 @@ class WirelessSettingsDialog(AdvancedSettingsDialog):
|
||||
self.encryption_info = {}
|
||||
|
||||
if self._w.body.body.__contains__(self.pile_encrypt):
|
||||
self._w.body.body.pop(self._w.body.body.__len__()-2)
|
||||
self._w.body.body.pop(self._w.body.body.__len__()-1)
|
||||
|
||||
# If nothing is selected, select the first entry.
|
||||
if ID == -1:
|
||||
@@ -397,9 +410,9 @@ class WirelessSettingsDialog(AdvancedSettingsDialog):
|
||||
for x in opts:
|
||||
edit = None
|
||||
if language.has_key(opts[x][0]):
|
||||
edit = MaskingEdit(('editcp',language[opts[x][0].lower().replace(' ','_')]+': '),mask_mode='on_focus')
|
||||
edit = MaskingEdit(('editcp',language[opts[x][0].lower().replace(' ','_')]+': '),mask_mode='no_focus')
|
||||
else:
|
||||
edit = MaskingEdit(('editcp',opts[x][0].replace('_',' ')+': '),mask_mode='on_focus')
|
||||
edit = MaskingEdit(('editcp',opts[x][0].replace('_',' ')+': '),mask_mode='no_focus')
|
||||
theList.append(edit)
|
||||
# Add the data to any array, so that the information
|
||||
# can be easily accessed by giving the name of the wanted
|
||||
@@ -410,7 +423,7 @@ class WirelessSettingsDialog(AdvancedSettingsDialog):
|
||||
wireless.GetWirelessProperty(self.networkID, opts[x][1])))
|
||||
|
||||
self.pile_encrypt = DynWrap(urwid.Pile(theList),attrs=('editbx','editnfc'))
|
||||
self._w.body.body.insert(self._w.body.body.__len__()-1,self.pile_encrypt)
|
||||
self._w.body.body.insert(self._w.body.body.__len__(),self.pile_encrypt)
|
||||
#self._w.body.body.append(self.pile_encrypt)
|
||||
|
||||
def prerun(self,ui,dim,display):
|
||||
|
||||
@@ -64,20 +64,15 @@ Bring up instructions on how to edit the scripts. I have implemented a way to d
|
||||
Raise the Ad-Hoc network creation dialog
|
||||
|
||||
.SH "FILES"
|
||||
These are not used yet.
|
||||
.TP
|
||||
.I ~/.wicd/WHEREAREMYFILES
|
||||
Reminder that your network configuration files are not here ;-)
|
||||
.TP
|
||||
.I %LIB%keymap.py
|
||||
Tentative location of the system keymap
|
||||
.PP
|
||||
These following are not used yet:
|
||||
.TP
|
||||
.I %LIB%colors.py
|
||||
Tentative location of the system color schemes
|
||||
.TP
|
||||
.I ~/.wicd/keymap.py
|
||||
Custom keybindings. Also where you can (later) disable the mouse.
|
||||
.TP
|
||||
.I ~/.wicd/colors.py
|
||||
Custom color schemes.
|
||||
.SH "SEE ALSO"
|
||||
@@ -87,7 +82,7 @@ Custom color schemes.
|
||||
.SH BUGS
|
||||
Probably lots. ;-)
|
||||
|
||||
If you happen to find one, ask about it on #wicd on freenode, or submit a bug report to http://launchpad.net/wicd, branch experimental-nacl.
|
||||
If you happen to find one, ask about it on #wicd on freenode, or submit a bug report to http://launchpad.net/wicd.
|
||||
|
||||
.SH WICD-CURSES AUTHOR
|
||||
Andrew Psaltis <ampsaltis@gmail.com>
|
||||
|
||||
@@ -157,7 +157,7 @@ Adam Blackburn <compwiz18@gmail.com>
|
||||
.br
|
||||
Dan O'Reilly <oreilldf@gmail.com>
|
||||
.br
|
||||
Andrew Psaltis <insertmail@here> (curses client)
|
||||
Andrew Psaltis <ampsaltis@gmail.com> (curses client)
|
||||
|
||||
.SH MANPAGE AUTHOR
|
||||
Robby Workman <rworkman@slackware.com>
|
||||
|
||||
Reference in New Issue
Block a user