diff --git a/AUTHORS b/AUTHORS index df3f6b5..0c03fec 100644 --- a/AUTHORS +++ b/AUTHORS @@ -1,2 +1,3 @@ Adam Blackburn (compwiz18@gmail.com) Dan O'Reilly (oreilldf@gmail.com) +Andrew Psaltis (ampsaltis@gmail.com) (wicd-curses) diff --git a/curses/curses_misc.py b/curses/curses_misc.py index 9e641fc..e5079c7 100644 --- a/curses/curses_misc.py +++ b/curses/curses_misc.py @@ -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. diff --git a/curses/netentry_curses.py b/curses/netentry_curses.py index 7ff07d9..c00c887 100644 --- a/curses/netentry_curses.py +++ b/curses/netentry_curses.py @@ -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): diff --git a/in/man=wicd-curses.8.in b/in/man=wicd-curses.8.in index c38e426..9e0e549 100644 --- a/in/man=wicd-curses.8.in +++ b/in/man=wicd-curses.8.in @@ -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 diff --git a/in/man=wicd.8.in b/in/man=wicd.8.in index 55a5afb..ead0b52 100644 --- a/in/man=wicd.8.in +++ b/in/man=wicd.8.in @@ -157,7 +157,7 @@ Adam Blackburn .br Dan O'Reilly .br -Andrew Psaltis (curses client) +Andrew Psaltis (curses client) .SH MANPAGE AUTHOR Robby Workman diff --git a/setup.py b/setup.py index a87076a..1ab38bc 100755 --- a/setup.py +++ b/setup.py @@ -28,7 +28,7 @@ import subprocess VERSION_NUM = '1.6.0a1' # REVISION_NUM is automatically updated REVISION_NUM = 'unknown' -CURSES_REVNO = 'r274' +CURSES_REVNO = 'r275' try: if not os.path.exists('vcsinfo.py'):