From 940f563ec5ecf760929c2ef304da572c54a2897b Mon Sep 17 00:00:00 2001 From: Andrew Psaltis Date: Sat, 28 Feb 2009 18:58:12 -0500 Subject: [PATCH 001/186] curses/curses_misc.py: Added a htop-like OptCols curses/wicd-curses.py: Added support for OptCols. Some of the keys in there are not valid as of yet. --- curses/curses_misc.py | 30 ++++++++++++++++++++++++++++++ curses/wicd-curses.py | 28 +++++++++++++++++++++++----- 2 files changed, 53 insertions(+), 5 deletions(-) diff --git a/curses/curses_misc.py b/curses/curses_misc.py index e5079c7..65346a5 100644 --- a/curses/curses_misc.py +++ b/curses/curses_misc.py @@ -512,3 +512,33 @@ class InputDialog(Dialog2): def on_exit(self, exitcode): return exitcode, self.edit.get_edit_text() + + +# htop-style menu menu-bar on the bottom of the screen +class OptCols(urwid.WidgetWrap): + # tuples = [(key,desc,on_event)], on_event currently ignored + # attrs = (attr_key,attr_desc) + def __init__(self,tuples,attrs=('body','infobar')): + # Find the longest string. Keys for this bar should be no greater than + # 2 characters long (e.g., -> for left) + maxlen = 6 + for i in tuples: + newmax = len(i[0])+len(i[1]) + if newmax > maxlen: + maxlen = newmax + + # Construct the texts + textList = [] + i = 0 + for cmd in tuples: + #theText = urwid.Text([(attrs[0],cmd[0]),(attrs[1],cmd[1])]) + col = urwid.Columns([('fixed',len(cmd[0]), + urwid.Text((attrs[0],cmd[0])) ), + urwid.AttrWrap(urwid.Text(cmd[1]),attrs[1])]) + if i != len(tuples)-1: + textList.append(('fixed',maxlen,col)) + else: # The last one + textList.append(col) + i+=1 + cols = urwid.Columns(textList) + self.__super.__init__(cols) diff --git a/curses/wicd-curses.py b/curses/wicd-curses.py index 01dc154..3937749 100644 --- a/curses/wicd-curses.py +++ b/curses/wicd-curses.py @@ -53,7 +53,7 @@ import sys from time import sleep # Curses UIs for other stuff -from curses_misc import SelText,DynEdit,DynIntEdit,ComboBox,Dialog2,TextDialog,InputDialog,error +from curses_misc import * from prefs_curses import PrefsDialog import netentry_curses @@ -524,9 +524,24 @@ class appGUI(): # spam,spam,spam,spam,spam,spam,spam,spam,spam,spam,spam,spam, # spam,spam,spam,spam] ] #self.spamLB = urwid.ListBox(spamL) + # Keymappings proposed by nanotube in #wicd + keys = [ + ('H' ,'Help' ,None), + ('->','Config',None), + #(' ',' ',None), + ('C' ,'Connect',None), + ('D' ,'Disconn',None), + ('R' ,'Refresh',None), + ('P' ,'Prefs',None), + ('I' ,'Hidden',None), + ('Q' ,'Quit',None) + ] + #(' ' ,' ',None), + #(' ' ,' ',None), + #(' ' ,' ',None), - self.footer1 = urwid.AttrWrap(urwid.Text("Something important will eventually go here."),'body') - self.footer2 = urwid.AttrWrap(urwid.Text("If you are seeing this, then something has gone wrong!"),'important') + self.footer1 = OptCols(keys) + self.footer2 = urwid.Columns([urwid.AttrWrap(urwid.Text("If you are seeing this, then something has gone wrong!"),'important'),urwid.Text('0',align='right')]) self.footerList = urwid.ListBox([self.footer1,self.footer2]) # Pop takes a number! #walker.pop(1) @@ -708,7 +723,9 @@ class appGUI(): if from_idle and self.connecting: # This is probably the wrong way to do this, but it works for now. toAppend=self.twirl[self.incr % 4] - self.footer2 = urwid.AttrWrap(urwid.Text(text+' '+toAppend),'important') + self.footer2 = urwid.Columns([ + urwid.AttrWrap(urwid.Text(text+' '+toAppend),'important'), + ('fixed',8,urwid.Text(str(self.incr),align='right'))]) self.frame.set_footer(urwid.BoxAdapter( urwid.ListBox([self.footer1,self.footer2]),2)) return True @@ -725,7 +742,7 @@ class appGUI(): else: theText += "-- Press H or ? for Help" quit_note = ' -- '+language["press_to_quit"] - self.footer1 = urwid.Text(str(self.incr) + theText+quit_note,wrap='clip') + #self.footer1 = urwid.Text(str(self.incr) + theText+quit_note,wrap='clip') self.incr+=1 return True @@ -891,6 +908,7 @@ def main(): ('editfc', 'white','dark blue', 'bold'), ('editnfc','dark gray','default'), ('tab active','dark green','light gray'), + ('infobar','black','dark cyan'), # Simple colors around text ('green','dark green','default'), ('blue','dark blue','default'), From 1bf166afe0b8fc4824e2c31930b84d24e6e00cf8 Mon Sep 17 00:00:00 2001 From: Andrew Psaltis Date: Sun, 1 Mar 2009 20:47:08 -0500 Subject: [PATCH 002/186] Things are coming along... curses/netentry_curses.py: Realigned some text curses/curses_misc.py: Added support for clicking stuff (doesn't do anything except change a label for now) The keys 'left' and 'right' now accepted, and translated into fake arrows Added a debug mode for the OptCols curses/wicd-curses.py: Removed if loop in locals() from the exception wrapper, this was causing bugs in OptCols to spam my console Debug mode on the optcols is set to default (for now) Cleaned up idle_incr Removed some of the exception wrappers --- curses/curses_misc.py | 81 +++++++++++++++++++++++++++++++-------- curses/netentry_curses.py | 4 +- curses/wicd-curses.py | 32 +++++++--------- 3 files changed, 81 insertions(+), 36 deletions(-) diff --git a/curses/curses_misc.py b/curses/curses_misc.py index 65346a5..0a3de8f 100644 --- a/curses/curses_misc.py +++ b/curses/curses_misc.py @@ -136,7 +136,8 @@ class MaskingEdit(urwid.Edit): Render edit widget and return canvas. Include cursor when in focus. """ - # If we aren't masking anything ATM, then act like an Edit. No problems. + # If we aren't masking anything ATM, then act like an Edit. + # No problems. 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 @@ -438,7 +439,8 @@ class Dialog2(urwid.WidgetWrap): def run(self,ui,parent): ui.set_mouse_tracking() size = ui.get_cols_rows() - overlay = urwid.Overlay(urwid.LineBox(self.view), parent, 'center', self.width, + overlay = urwid.Overlay(urwid.LineBox(self.view), + parent, 'center', self.width, 'middle', self.height) try: while True: @@ -514,31 +516,80 @@ class InputDialog(Dialog2): return exitcode, self.edit.get_edit_text() +class ClickCols(urwid.WidgetWrap): + def __init__(self,items,callback=None,args=None): + cols = urwid.Columns(items) + self.__super.__init__(cols) + self.callback = callback + self.args = args + def mouse_event(self,size,event,button,x,y,focus): + self.callback(self.args) + # htop-style menu menu-bar on the bottom of the screen class OptCols(urwid.WidgetWrap): # tuples = [(key,desc,on_event)], on_event currently ignored # attrs = (attr_key,attr_desc) - def __init__(self,tuples,attrs=('body','infobar')): + # mentions of 'left' and right will be converted to <- and -> respectively + def __init__(self,tuples,attrs=('body','infobar'),debug=False): # Find the longest string. Keys for this bar should be no greater than # 2 characters long (e.g., -> for left) - maxlen = 6 - for i in tuples: - newmax = len(i[0])+len(i[1]) - if newmax > maxlen: - maxlen = newmax + #maxlen = 6 + #for i in tuples: + # newmax = len(i[0])+len(i[1]) + # if newmax > maxlen: + # maxlen = newmax # Construct the texts textList = [] i = 0 + # callbacks map the text contents to its assigned callback. + self.callbacks = [] for cmd in tuples: + if cmd[0] == 'left': + key = '<-' + elif cmd[0] == 'right': + key = '->' + else: + key = cmd[0] #theText = urwid.Text([(attrs[0],cmd[0]),(attrs[1],cmd[1])]) - col = urwid.Columns([('fixed',len(cmd[0]), - urwid.Text((attrs[0],cmd[0])) ), - urwid.AttrWrap(urwid.Text(cmd[1]),attrs[1])]) - if i != len(tuples)-1: - textList.append(('fixed',maxlen,col)) - else: # The last one - textList.append(col) + if debug: + callback = self.debugClick + args = cmd[1] + #self.callbacks.append(cmd[2]) + col = ClickCols([ + ('fixed',len(key),urwid.Text((attrs[0],key)) ), + urwid.AttrWrap(urwid.Text(cmd[1]),attrs[1])], + callback,args) + #if i != len(tuples)-1: + # textList.append(('fixed',maxlen,col)) + #else: # The last one + textList.append(col) i+=1 + if debug: + self.debug = urwid.Text("DEBUG_MODE") + textList.append(('fixed',10,self.debug)) + cols = urwid.Columns(textList) self.__super.__init__(cols) + def debugClick(self,args): + self.debug.set_text(args) + + def mouse_event(self,size,event,button,x,y,focus): + # Widgets are evenly long (as of current), so... + return self._w.mouse_event(size,event,button,x,y,focus) + """ + if self.debug: + if x > size[0]-10: + return + widsize = (size[0]-10)/len(self.callbacks) + else: + widsize = size[0]/len(self.callbacks) + widnum = x/widsize + if self.debug: + text = str(widnum) + if self.callbacks[widnum] == None: + text += " None" + self.debug.set_text(text) + elif self.callbacks[widnum] != None: + self.callbacks[widnum]() + """ diff --git a/curses/netentry_curses.py b/curses/netentry_curses.py index 3eaccf4..5f30682 100644 --- a/curses/netentry_curses.py +++ b/curses/netentry_curses.py @@ -196,8 +196,8 @@ class AdvancedSettingsDialog(urwid.WidgetWrap): k = self.overlay.keypress(dim, k) if k in ('up','page up'): self._w.set_focus('body') - # Until I figure out a better way to do this, then this will - # have to do. + # Until I figure out a better way to do this, then + # this will have to do. self._w.body.get_focus()[0].get_focus()._invalidate() #self._w.body.keypress(dim,'down') elif k in ('down','page down'): diff --git a/curses/wicd-curses.py b/curses/wicd-curses.py index 3937749..b9d66bb 100644 --- a/curses/wicd-curses.py +++ b/curses/wicd-curses.py @@ -1,4 +1,5 @@ #!/usr/bin/env python +# -* coding: utf-8 -*- """ wicd-curses. (curses/urwid-based) console interface to wicd @@ -99,8 +100,8 @@ class wrap_exceptions: raise except : # Quit the loop - if 'loop' in locals(): - loop.quit() + #if 'loop' in locals(): + loop.quit() # Zap the screen ui.stop() # Print out standard notification: @@ -487,6 +488,7 @@ class AdHocDialog(Dialog2): class appGUI(): """The UI itself, all glory belongs to it!""" def __init__(self): + global loop self.size = ui.get_cols_rows() # Happy screen saying that you can't do anything because we're scanning # for networks. :-) @@ -527,20 +529,20 @@ class appGUI(): # Keymappings proposed by nanotube in #wicd keys = [ ('H' ,'Help' ,None), - ('->','Config',None), + ('right','Config',None), #(' ',' ',None), ('C' ,'Connect',None), ('D' ,'Disconn',None), ('R' ,'Refresh',None), ('P' ,'Prefs',None), ('I' ,'Hidden',None), - ('Q' ,'Quit',None) + ('Q' ,'Quit',loop.quit) ] #(' ' ,' ',None), #(' ' ,' ',None), #(' ' ,' ',None), - self.footer1 = OptCols(keys) + self.footer1 = OptCols(keys,debug=True) self.footer2 = urwid.Columns([urwid.AttrWrap(urwid.Text("If you are seeing this, then something has gone wrong!"),'important'),urwid.Text('0',align='right')]) self.footerList = urwid.ListBox([self.footer1,self.footer2]) # Pop takes a number! @@ -734,15 +736,8 @@ class appGUI(): # Not necessary in the end, but I will be using footer1 for stuff in # the long run, so I might as well put something there. incr = 0 - @wrap_exceptions() + #@wrap_exceptions() def idle_incr(self): - theText = " " - if self.connecting: - theText += "-- "+language['connecting']+' -- '+language["esc_to_cancel"] - else: - theText += "-- Press H or ? for Help" - quit_note = ' -- '+language["press_to_quit"] - #self.footer1 = urwid.Text(str(self.incr) + theText+quit_note,wrap='clip') self.incr+=1 return True @@ -765,7 +760,7 @@ class appGUI(): #self.update_status() canvas = self.frame.render( (self.size),True ) ### GRRRRRRRRRRRRRRRRRRRRR ->^^^^ - # It looks like if I wanted to get the statusbar to update itself + # It looks like if I want to get the statusbar to update itself # continuously, I would have to use overlay the canvasses and redirect # the input. I'll try to get that working at a later time, if people # want that "feature". @@ -793,7 +788,7 @@ class appGUI(): self.connect("wired",0) else: # wless list only other option - wid,pos = self.thePile.get_focus().get_focus() + wid,pos = self.thePile.get_focus().get_focus() self.connect("wireless",pos) if "esc" in keys: @@ -875,7 +870,6 @@ class appGUI(): def main(): global ui - # We are _not_ python. misc.RenameProcess('wicd-curses') @@ -908,7 +902,7 @@ def main(): ('editfc', 'white','dark blue', 'bold'), ('editnfc','dark gray','default'), ('tab active','dark green','light gray'), - ('infobar','black','dark cyan'), + ('infobar','black','dark blue'), # Simple colors around text ('green','dark green','default'), ('blue','dark blue','default'), @@ -921,7 +915,8 @@ def main(): def run(): global loop - + loop = gobject.MainLoop() + ui.set_mouse_tracking() app = appGUI() @@ -933,7 +928,6 @@ def run(): # I've left this commented out many times. bus.add_signal_receiver(app.update_netlist, 'StatusChanged', 'org.wicd.daemon') - loop = gobject.MainLoop() # Update what the interface looks like as an idle function gobject.idle_add(app.update_ui) # Update the connection status on the bottom every 1.5 s. From ab878c231f45ed3c149052689e4f09e11c608908 Mon Sep 17 00:00:00 2001 From: Andrew Psaltis Date: Sun, 1 Mar 2009 23:53:59 -0500 Subject: [PATCH 003/186] curses/curses_misc.py: Added a colon to each entry in OptCols curses/wicd-curses.py: Removed the 'print ""' from the end of the main entry point Changed the infobar colors to grey on dark blue --- curses/curses_misc.py | 2 +- curses/wicd-curses.py | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/curses/curses_misc.py b/curses/curses_misc.py index 0a3de8f..7559431 100644 --- a/curses/curses_misc.py +++ b/curses/curses_misc.py @@ -557,7 +557,7 @@ class OptCols(urwid.WidgetWrap): args = cmd[1] #self.callbacks.append(cmd[2]) col = ClickCols([ - ('fixed',len(key),urwid.Text((attrs[0],key)) ), + ('fixed',len(key)+1,urwid.Text((attrs[0],key+':')) ), urwid.AttrWrap(urwid.Text(cmd[1]),attrs[1])], callback,args) #if i != len(tuples)-1: diff --git a/curses/wicd-curses.py b/curses/wicd-curses.py index b9d66bb..e046970 100644 --- a/curses/wicd-curses.py +++ b/curses/wicd-curses.py @@ -902,7 +902,7 @@ def main(): ('editfc', 'white','dark blue', 'bold'), ('editnfc','dark gray','default'), ('tab active','dark green','light gray'), - ('infobar','black','dark blue'), + ('infobar','light gray','dark blue'), # Simple colors around text ('green','dark green','default'), ('blue','dark blue','default'), @@ -975,4 +975,4 @@ if __name__ == '__main__': main() # Make sure that the terminal does not try to overwrite the last line of # the program, so that everything looks pretty. - print "" + #print "" From a290b12e68dcafaeccd961708cbd8024a46cb8f2 Mon Sep 17 00:00:00 2001 From: Andrew Psaltis Date: Mon, 2 Mar 2009 14:05:25 -0500 Subject: [PATCH 004/186] curses/wicd-curses.py: Replaced idle_incr with a clock that counts seconds. Streamlined some of the footer functions The connecting progress-wheel now updates independently of any other counter. Increased status updating time to 2 seconds (from 1.5) --- curses/wicd-curses.py | 31 ++++++++++++++++++------------- 1 file changed, 18 insertions(+), 13 deletions(-) diff --git a/curses/wicd-curses.py b/curses/wicd-curses.py index e046970..56ab8c7 100644 --- a/curses/wicd-curses.py +++ b/curses/wicd-curses.py @@ -51,7 +51,7 @@ from wicd import dbusmanager # Internal Python stuff import sys -from time import sleep +from time import sleep, strftime, ctime # Curses UIs for other stuff from curses_misc import * @@ -543,7 +543,9 @@ class appGUI(): #(' ' ,' ',None), self.footer1 = OptCols(keys,debug=True) - self.footer2 = urwid.Columns([urwid.AttrWrap(urwid.Text("If you are seeing this, then something has gone wrong!"),'important'),urwid.Text('0',align='right')]) + self.time_label = urwid.Text(strftime('%H:%M:%S')) + self.status_label = urwid.AttrWrap(urwid.Text('blah'),'important') + self.footer2 = urwid.Columns([self.status_label,('fixed', 8, self.time_label)]) self.footerList = urwid.ListBox([self.footer1,self.footer2]) # Pop takes a number! #walker.pop(1) @@ -707,6 +709,7 @@ class appGUI(): # Cheap little indicator stating that we are actually connecting twirl = ['|','/','-','\\'] + tcount = 0 # Counter for said indicator def set_status(self,text,from_idle=False): # Set the status text, usually called by the update_status method # from_idle : a check to see if we are being called directly from the @@ -717,6 +720,7 @@ class appGUI(): if from_idle and not self.connecting: #self.update_netlist() self.update_status() + self.tcount = 0 #self.update_ui() return False toAppend = '' @@ -724,21 +728,22 @@ class appGUI(): # the wheel. if from_idle and self.connecting: # This is probably the wrong way to do this, but it works for now. - toAppend=self.twirl[self.incr % 4] - self.footer2 = urwid.Columns([ - urwid.AttrWrap(urwid.Text(text+' '+toAppend),'important'), - ('fixed',8,urwid.Text(str(self.incr),align='right'))]) - self.frame.set_footer(urwid.BoxAdapter( - urwid.ListBox([self.footer1,self.footer2]),2)) + toAppend=self.twirl[self.tcount % 4] + self.tcount+=1 + #self.footer2 = urwid.Columns([ + # urwid.AttrWrap(urwid.Text(text+' '+toAppend),'important'), + # ('fixed',8,urwid.Text(str(self.time),align='right'))]) + self.status_label.set_text(text+' '+toAppend) + #self.frame.set_footer(urwid.BoxAdapter( + # urwid.ListBox([self.footer1,self.footer2]),2)) return True # Make sure the screen is still working by providing a pretty counter. # Not necessary in the end, but I will be using footer1 for stuff in # the long run, so I might as well put something there. - incr = 0 #@wrap_exceptions() - def idle_incr(self): - self.incr+=1 + def update_time(self): + self.time_label.set_text(strftime('%H:%M:%S')) return True # Yeah, I'm copying code. Anything wrong with that? @@ -931,8 +936,8 @@ def run(): # Update what the interface looks like as an idle function gobject.idle_add(app.update_ui) # Update the connection status on the bottom every 1.5 s. - gobject.timeout_add(1500,app.update_status) - gobject.idle_add(app.idle_incr) + gobject.timeout_add(2000,app.update_status) + gobject.timeout_add(1000,app.update_time) # DEFUNCT: Terminate the loop if the UI is terminated. #gobject.idle_add(app.stop_loop) loop.run() From 0dfe5432bd806c2807bd17bce7fcdbe3aab6e50e Mon Sep 17 00:00:00 2001 From: Andrew Psaltis Date: Wed, 4 Mar 2009 00:56:17 -0500 Subject: [PATCH 005/186] curses/curses_misc.py: added support for Meta and Ctrl being applied to keys in OptCols curses/wicd-curses.py Changed the colors slightly, colorized the clock. --- curses/curses_misc.py | 21 +++++++++++++++------ curses/wicd-curses.py | 18 ++++++++++-------- 2 files changed, 25 insertions(+), 14 deletions(-) diff --git a/curses/curses_misc.py b/curses/curses_misc.py index 7559431..4448a4f 100644 --- a/curses/curses_misc.py +++ b/curses/curses_misc.py @@ -545,12 +545,21 @@ class OptCols(urwid.WidgetWrap): # callbacks map the text contents to its assigned callback. self.callbacks = [] for cmd in tuples: - if cmd[0] == 'left': - key = '<-' - elif cmd[0] == 'right': - key = '->' - else: - key = cmd[0] + splitcmd = cmd[0].split() + key = '' + for part in splitcmd: + if part == 'ctrl': + key+='C^' + elif part == 'meta': + key+='M^' + else: + if part == 'left': + key += '<-' + elif part == 'right': + key += '->' + else: + key += part + #theText = urwid.Text([(attrs[0],cmd[0]),(attrs[1],cmd[1])]) if debug: callback = self.debugClick diff --git a/curses/wicd-curses.py b/curses/wicd-curses.py index 56ab8c7..92abfe0 100644 --- a/curses/wicd-curses.py +++ b/curses/wicd-curses.py @@ -543,7 +543,9 @@ class appGUI(): #(' ' ,' ',None), self.footer1 = OptCols(keys,debug=True) - self.time_label = urwid.Text(strftime('%H:%M:%S')) + #self.time_label = urwid.Text(strftime('%H:%M:%S')) + self.time_label = \ + urwid.AttrWrap(urwid.Text(strftime('%H:%M:%S')), 'timebar') self.status_label = urwid.AttrWrap(urwid.Text('blah'),'important') self.footer2 = urwid.Columns([self.status_label,('fixed', 8, self.time_label)]) self.footerList = urwid.ListBox([self.footer1,self.footer2]) @@ -892,29 +894,29 @@ def main(): # Default Color scheme. # Other potential color schemes can be found at: # http://excess.org/urwid/wiki/RecommendedPalette - # Note: the current palette below is optimized for the linux console. - # For example, this looks particularly bad on a default-colored XTerm. - # NB: To find current terminal background use variable COLORFGBG + + # Thanks to nanotube on #wicd for helping with this ui.register_palette([ ('body','default','default'), ('focus','dark magenta','light gray'), ('header','light blue','default'), ('important','light red','default'), ('connected','dark green','default'), - ('connected focus','default','dark green'), + ('connected focus','black','dark green'), ('editcp', 'default', 'default', 'standout'), ('editbx', 'light gray', 'dark blue'), ('editfc', 'white','dark blue', 'bold'), - ('editnfc','dark gray','default'), + ('editnfc','dark gray','default','bold'), ('tab active','dark green','light gray'), ('infobar','light gray','dark blue'), + ('timebar','dark gray','default'), # Simple colors around text ('green','dark green','default'), ('blue','dark blue','default'), ('red','dark red','default'), ('bold','white','black','bold')]) - # This is a wrapper around a function that calls another a function that is a - # wrapper around a infinite loop. Fun. + # This is a wrapper around a function that calls another a function that + # is a wrapper around a infinite loop. Fun. urwid.set_encoding('utf8') ui.run_wrapper(run) From 48724d9065c2bfa515ef8c5277721cb444d3b0de Mon Sep 17 00:00:00 2001 From: Andrew Psaltis Date: Wed, 4 Mar 2009 16:54:26 -0500 Subject: [PATCH 006/186] curses/curses_misc.py: Added a non-selectable listbox for the wireless network header curses/wicd-curses.py: Updated the wireless list-header generating function and activated it. Removed/deactivated some unused code. --- curses/curses_misc.py | 7 ++++++- curses/wicd-curses.py | 29 ++++++++++++++++++++--------- 2 files changed, 26 insertions(+), 10 deletions(-) diff --git a/curses/curses_misc.py b/curses/curses_misc.py index 4448a4f..886ae40 100644 --- a/curses/curses_misc.py +++ b/curses/curses_misc.py @@ -49,7 +49,12 @@ class SelText(urwid.Text): """Don't handle any keys.""" return key -# This class is annoying. ^_^ +# ListBox that can't be selected. +class NSelListBox(urwid.ListBox): + def selectable(self): + return False + +# This class is annoying. :/ class DynWrap(urwid.AttrWrap): """ Makes an object have mutable selectivity. Attributes will change like diff --git a/curses/wicd-curses.py b/curses/wicd-curses.py index 92abfe0..3c41de1 100644 --- a/curses/wicd-curses.py +++ b/curses/wicd-curses.py @@ -161,9 +161,6 @@ def check_for_wireless(iwconfig, wireless_ip, set_status): # working... # Also defunct. # Current list header is STR,ESSID,ENCRYPT,BSSID,TYPE,CHANNEL -#def gen_list_header(): -# return '%3s %4s %s %19s %s ' % ('NUM','STR','BSSID','CHANNEL','ESSID') - # Generate the list of networks. # Mostly borrowed/stolen from wpa_cli, since I had no clue what all of those # DBUS interfaces do. ^_^ @@ -297,16 +294,26 @@ Once there, you can adjust (or add) the "beforescript", "afterscript", and "disc ##### URWID SUPPORT CLASSES ######################################## +def gen_list_header(): + if daemon.GetSignalDisplayType() == 0: + # Allocate 25 cols for the ESSID name + essidgap = 25 + else: + # Need 3 more to accomodate dBm strings (I think) + essidgap = 28 + return 'C %s %*s %9s %17s %6s %s' % ('STR',essidgap,'ESSID','ENCRYPT','BSSID','MODE','CHNL') + # Wireless network label class NetLabel(urwid.WidgetWrap): def __init__(self, id, is_active): - # Pick which strength measure to use based on what the daemon says + # Pick which strength measure to use based on what the daemon says + # gap allocates more space to the first module if daemon.GetSignalDisplayType() == 0: strenstr = 'quality' - gap = 3 + gap = 4 # Allow for 100% else: strenstr = 'strength' - gap = 5 + gap = 7 # -XX dbm = 7 self.id = id # All of that network property stuff self.stren = daemon.FormatSignalForPrinting( @@ -316,7 +323,7 @@ class NetLabel(urwid.WidgetWrap): self.encrypt = wireless.GetWirelessProperty(id,'encryption_method') if wireless.GetWirelessProperty(id, 'encryption') else language['unsecured'] self.mode = wireless.GetWirelessProperty(id, 'mode') # Master, Ad-Hoc self.channel = wireless.GetWirelessProperty(id, 'channel') - theString = ' %*s %25s %9s %17s %6s: %s' % (gap, + theString = ' %*s %25s %9s %17s %6s %4s' % (gap, self.stren,self.essid,self.encrypt,self.bssid,self.mode,self.channel) if is_active: theString = '>'+theString[1:] @@ -481,6 +488,7 @@ class AdHocDialog(Dialog2): self.key_edit.get_edit_text()) return exitcode, data + ######################################## ##### APPLICATION INTERFACE CLASS ######################################## @@ -504,7 +512,8 @@ class appGUI(): header = urwid.AttrWrap(urwid.Text(self.TITLE,align='right'), 'header') self.wiredH=urwid.Filler(urwid.Text("Wired Network(s)")) - self.wlessH=urwid.Filler(urwid.Text("Wireless Network(s)")) + self.list_header=urwid.AttrWrap(urwid.Text(gen_list_header()),'listbar') + self.wlessH=NSelListBox([urwid.Text("Wireless Network(s)"),self.list_header]) #if wireless.GetNumberOfNetworks() == 0: # wireless.Scan() @@ -614,6 +623,7 @@ class appGUI(): # Run focus-collecting code if we are not running this for the first time if not firstrun: self.update_focusloc() + self.list_header.set_text(gen_list_header()) """ Updates the overall network list.""" if not state: state, x = daemon.GetConnectionStatus() @@ -635,7 +645,7 @@ class appGUI(): #if firstrun: self.thePile = urwid.Pile([('fixed',1,self.wiredH), ('fixed',1,self.wiredCB), - ('fixed',1,self.wlessH), + ('fixed',2,self.wlessH), self.wlessLB] ) if not firstrun: self.frame.body = self.thePile @@ -910,6 +920,7 @@ def main(): ('tab active','dark green','light gray'), ('infobar','light gray','dark blue'), ('timebar','dark gray','default'), + ('listbar','dark gray','default'), # Simple colors around text ('green','dark green','default'), ('blue','dark blue','default'), From b4516aceadd94a55e4028dec07a0d2dea0f3ac6c Mon Sep 17 00:00:00 2001 From: Andrew Psaltis Date: Wed, 4 Mar 2009 17:01:00 -0500 Subject: [PATCH 007/186] Fixed the wireless network header when we are only seeing wireless networks. --- curses/wicd-curses.py | 19 ++++--------------- 1 file changed, 4 insertions(+), 15 deletions(-) diff --git a/curses/wicd-curses.py b/curses/wicd-curses.py index 3c41de1..125290a 100644 --- a/curses/wicd-curses.py +++ b/curses/wicd-curses.py @@ -157,25 +157,13 @@ def check_for_wireless(iwconfig, wireless_ip, set_status): return True -# Self explanitory, and not used until I can get some list sort function -# working... -# Also defunct. -# Current list header is STR,ESSID,ENCRYPT,BSSID,TYPE,CHANNEL # Generate the list of networks. # Mostly borrowed/stolen from wpa_cli, since I had no clue what all of those # DBUS interfaces do. ^_^ # Whatever calls this must be exception-wrapped if it is run if the UI is up def gen_network_list(): - # Pick which strength measure to use based on what the daemon says - if daemon.GetSignalDisplayType() == 0: - strenstr = 'quality' - gap = 3 - else: - strenstr = 'strength' - gap = 5 - - id = 0 - wiredL = [] + #id=0 + #wiredL = [] #is_active = wireless.GetWirelessIP('') == None and wired.GetWiredIP('') != None # This one makes a list of strings to put in a combo box. #for profile in wired.GetWiredProfileList(): @@ -615,6 +603,7 @@ class appGUI(): where = self.thePile.get_focus().get_focus()[1] #where = self.wlessLB.get_focus()[1] self.focusloc = (wlessorwired,where) + # Be clunky until I get to a later stage of development. # Update the list of networks. Usually called by DBus. # TODO: Preserve current focus when updating the list. @@ -660,7 +649,7 @@ class appGUI(): else: self.thePile.set_focus(self.wiredCB) else: - self.thePile = urwid.Pile([('fixed',1,self.wlessH),self.wlessLB] ) + self.thePile = urwid.Pile([('fixed',2,self.wlessH),self.wlessLB] ) if not firstrun: self.frame.body = self.thePile #if self.focusloc[0] == self.wlessLB: From ea7f8ac62761974a0ca36da07a14a097f00d7fcd Mon Sep 17 00:00:00 2001 From: Andrew Psaltis Date: Thu, 5 Mar 2009 10:09:23 -0500 Subject: [PATCH 008/186] Modified the help dialog in wicd-curses so that it fills up the entire screen. There may still a formatting issue, will wait on user opinion before changing. --- curses/wicd-curses.py | 61 +++++++++++++++++++++++++++++++------------ setup.py | 2 +- 2 files changed, 45 insertions(+), 18 deletions(-) diff --git a/curses/wicd-curses.py b/curses/wicd-curses.py index 125290a..2884dca 100644 --- a/curses/wicd-curses.py +++ b/curses/wicd-curses.py @@ -212,24 +212,51 @@ def about_dialog(body): about = TextDialog(theText,16,55,header=('header','About Wicd')) about.run(ui,body) +# Modeled after htop's help def help_dialog(body): - theText = [ + textT = urwid.Text(('header','Wicd-curses help'),'right') + textSH = urwid.Text(['This is ',('blue','wicd-curses-'+CURSES_REVNO),' using wicd ',unicode(daemon.Hello()),'\n']) + + textH = urwid.Text([ "For more detailed help, consult the wicd-curses(8) man page.\n", -"\n", "All controls are case sensitive\n", -('bold','H')," or ",('bold','h'),' or ',('bold','?')," Display this help dialog\n", -('bold','enter')," Connect to selected network\n", -('bold','D')," Disconnect from all networks\n", -('bold','ESC')," Stop a network connection in progress\n", -('bold','F5')," or ", ('bold','R')," Refresh network list\n", -('bold','P')," Prefrences dialog\n", -('bold','I')," Scan for hidden networks\n", -('bold','S')," Select scripts\n", -('bold','O')," Set up Ad-hoc network\n", -('bold','C')," Configure Selected Network\n", -('bold','A')," Display 'about' dialog\n" - ] - help = TextDialog(theText,18,62,header=('header',"Wicd-Curses Help")) - help.run(ui,body) +('bold','->'),' and ',('bold','<-')," are the right and left arrows respectively\n"]) + + text1 = urwid.Text([ +('bold','H h ?'),": Display this help dialog\n", +('bold','enter'),": Connect to selected network\n", +('bold',' D'),": Disconnect from all networks\n", +('bold',' ESC'),": Stop a network connection in progress\n", +('bold',' F5 R'),": Refresh network list\n", +('bold',' P'),": Prefrences dialog\n", + ]) + text2 = urwid.Text([ +('bold',' I'),": Scan for hidden networks\n", +('bold',' S'),": Select scripts\n", +('bold',' O'),": Set up Ad-hoc network\n", +('bold',' ->'),": Configure selected network\n", +('bold',' A'),": Display 'about' dialog\n", +('bold',' Q'),": Quit wicd-curses\n", + ]) + textF = urwid.Text('Press any key to return.') + blank = urwid.Text('') + # Pile containing a text and columns? + cols = urwid.Columns([text1,text2]) + pile = urwid.Pile([textH,cols]) + fill = urwid.Filler(pile) + frame = urwid.Frame(fill,header=urwid.Pile([textT,textSH]),footer=textF) + dim = ui.get_cols_rows() + while True: + ui.draw_screen(dim, frame.render(dim, True)) + + keys = ui.get_input() + if 'window resize' in keys: + dim = ui.get_cols_rows() + elif ui.get_input(): + break + #elif keys != '': + # break + #help = TextDialog(theText,18,62,header=('header',"Wicd-Curses Help")) + #help.run(ui,body) def run_configscript(parent,netname,nettype): configfile = wpath.etc+netname+'-settings.conf' @@ -912,7 +939,7 @@ def main(): ('listbar','dark gray','default'), # Simple colors around text ('green','dark green','default'), - ('blue','dark blue','default'), + ('blue','light blue','default'), ('red','dark red','default'), ('bold','white','black','bold')]) # This is a wrapper around a function that calls another a function that diff --git a/setup.py b/setup.py index 6d504de..489b24e 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 = 'r279' +CURSES_REVNO = 'uimod-r284' try: if not os.path.exists('vcsinfo.py'): From 6690d9bb32ef541b54d0a63a6338852c0add50b2 Mon Sep 17 00:00:00 2001 From: Andrew Psaltis Date: Thu, 5 Mar 2009 11:20:43 -0500 Subject: [PATCH 009/186] Actually made window resizing not drop the help screen. --- curses/wicd-curses.py | 2 +- setup.py | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/curses/wicd-curses.py b/curses/wicd-curses.py index 2884dca..072798d 100644 --- a/curses/wicd-curses.py +++ b/curses/wicd-curses.py @@ -251,7 +251,7 @@ def help_dialog(body): keys = ui.get_input() if 'window resize' in keys: dim = ui.get_cols_rows() - elif ui.get_input(): + elif keys: break #elif keys != '': # break diff --git a/setup.py b/setup.py index 489b24e..4a21ae4 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 = 'uimod-r284' +CURSES_REVNO = 'uimod-r286' try: if not os.path.exists('vcsinfo.py'): From dc49a2fc4f1e1464626bf29be28abbb22434093d Mon Sep 17 00:00:00 2001 From: Andrew Psaltis Date: Thu, 5 Mar 2009 23:09:17 -0500 Subject: [PATCH 010/186] More htoppish ui changes curses/prefs_curses.py: changed save_results to save_settings curses/curses_misc.py: M^[ and M^] shift the tabs left and right respectively. The curses module has trouble picking up M^left and M^right curses/netentry_curses.py: Removed the buttons and button-related code from the interface. Removed the overlay code. Adapted the code for direct insertion into the wicd-curses interface curses/wicd-curses.py: Teaked the wireless header. Added support for sticking the network config dialog into the interface, and changing the current OptCols when it is activated. Added new OptCols for other large dialogs --- curses/curses_misc.py | 5 +- curses/netentry_curses.py | 75 ++------------ curses/prefs_curses.py | 2 +- curses/wicd-curses.py | 204 +++++++++++++++++++++++--------------- setup.py | 2 +- 5 files changed, 139 insertions(+), 149 deletions(-) mode change 100644 => 100755 curses/wicd-curses.py diff --git a/curses/curses_misc.py b/curses/curses_misc.py index 886ae40..01b7f3a 100644 --- a/curses/curses_misc.py +++ b/curses/curses_misc.py @@ -206,9 +206,10 @@ class TabColumns(urwid.WidgetWrap): def keypress(self,size,key): self._w.keypress(size,key) - if key == "meta left" or key == "meta right": + if key == "meta [" or key == "meta ]": self._w.get_body().set_focus(0) - self.keypress(size,key[5:]) + newK = 'left' if key[-1] == '[' else 'right' + self.keypress(size,newK) self._w.get_body().set_focus(1) else: wid = self.pile.get_focus().get_body() diff --git a/curses/netentry_curses.py b/curses/netentry_curses.py index 5f30682..7bce8be 100644 --- a/curses/netentry_curses.py +++ b/curses/netentry_curses.py @@ -84,13 +84,6 @@ class AdvancedSettingsDialog(urwid.WidgetWrap): _blank = urwid.Text('') - # Buttons. These need to be added to the list in superclasses. - self.OK_PRESSED= False - self.CANCEL_PRESSED = False - self.ok_button = urwid.AttrWrap(urwid.Button('OK',self.ok_callback),'body','focus') - self.cancel_button = urwid.AttrWrap(urwid.Button('Cancel',self.cancel_callback),'body','focus') - self.button_cols = urwid.Columns([self.ok_button,self.cancel_button]) - walker = urwid.SimpleListWalker([self.static_ip_cb, self.ip_edit, self.netmask_edit, @@ -105,16 +98,9 @@ class AdvancedSettingsDialog(urwid.WidgetWrap): self._listbox = urwid.ListBox(walker) #self._frame = urwid.Frame(self._listbox) - self._frame = urwid.Frame(self._listbox,footer=self.button_cols) + self._frame = urwid.Frame(self._listbox) self.__super.__init__(self._frame) - - # Button callbacks - def ok_callback(self,button_object,user_data=None): - self.OK_PRESSED = True - def cancel_callback(self,button_object,user_data=None): - self.CANCEL_PRESSED = True - def static_ip_set_state(self,checkb,new_state,user_data=None): for w in [ self.ip_edit,self.netmask_edit,self.gateway_edit ]: w.set_sensitive(new_state) @@ -166,54 +152,9 @@ class AdvancedSettingsDialog(urwid.WidgetWrap): self.set_net_prop("dns1", '') self.set_net_prop("dns2", '') self.set_net_prop("dns3", '') - - def prerun(self,ui,dim,display): + # Prevent comboboxes from dying. + def ready_widgets(self,ui,body): pass - def run(self,ui,dim,display): - self.ui = ui - self.parent = display - width,height = ui.get_cols_rows() - - self.overlay = urwid.Overlay(self, display, ('fixed left', 0),width - , ('fixed top',1), height-3) - self.prerun(ui,dim,display) - #self.ready_comboboxes(ui,overlay) - - keys = True - while True: - if keys: - ui.draw_screen(dim, self.overlay.render(dim, True)) - keys = ui.get_input() - - for k in keys: - #Send key to underlying widget: - if urwid.is_mouse_event(k): - event, button, col, row = k - self.overlay.mouse_event( dim, - event, button, col, row, - focus=True) - else: - k = self.overlay.keypress(dim, k) - if k in ('up','page up'): - self._w.set_focus('body') - # Until I figure out a better way to do this, then - # this will have to do. - self._w.body.get_focus()[0].get_focus()._invalidate() - #self._w.body.keypress(dim,'down') - 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: - return False - if "meta enter" in keys or self.OK_PRESSED: - self.OK_PRESSED = False - if self.save_settings(): - return True - if self.CANCEL_PRESSED: - return False - class WiredSettingsDialog(AdvancedSettingsDialog): def __init__(self,name): @@ -367,13 +308,13 @@ class WirelessSettingsDialog(AdvancedSettingsDialog): encrypt_methods[self.encryption_combo.get_focus()[1] ][1]) for x in encryption_info: if encryption_info[x].get_edit_text() == "": - error(self.ui, self.overlay,language['encrypt_info_missing']) + error(self.ui, self.body,language['encrypt_info_missing']) return False self.set_net_prop(x, noneToString(encryption_info[x]. get_edit_text())) elif not self.encryption_chkbox.get_state() and \ wireless.GetWirelessProperty(self.networkID, "encryption"): - error(self.ui, self.overlay, language['enable_encryption']) + error(self.ui, self.body, language['enable_encryption']) return False else: #print 'encryption is ' + str(wireless.GetWirelessProperty(self.networkID, @@ -431,6 +372,8 @@ class WirelessSettingsDialog(AdvancedSettingsDialog): 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): - self.encryption_combo.build_combobox(self.overlay,ui,14) + def ready_widgets(self,ui,body): + self.ui = ui + self.body = body + self.encryption_combo.build_combobox(body,ui,14) self.change_encrypt_method() diff --git a/curses/prefs_curses.py b/curses/prefs_curses.py index 992bc84..86b60c2 100755 --- a/curses/prefs_curses.py +++ b/curses/prefs_curses.py @@ -322,7 +322,7 @@ class PrefsDialog(urwid.WidgetWrap): self.debug_mode_checkb.set_state(daemon.GetDebugMode()) self.use_dbm_checkb.set_state(daemon.GetSignalDisplayType()) - def save_results(self): + def save_settings(self): """ Pushes the selected settings to the daemon. This exact order is found in prefs.py""" daemon.SetUseGlobalDNS(self.global_dns_checkb.get_state()) diff --git a/curses/wicd-curses.py b/curses/wicd-curses.py old mode 100644 new mode 100755 index 072798d..0bdebe3 --- a/curses/wicd-curses.py +++ b/curses/wicd-curses.py @@ -314,9 +314,9 @@ def gen_list_header(): # Allocate 25 cols for the ESSID name essidgap = 25 else: - # Need 3 more to accomodate dBm strings (I think) + # Need 3 more to accomodate dBm strings essidgap = 28 - return 'C %s %*s %9s %17s %6s %s' % ('STR',essidgap,'ESSID','ENCRYPT','BSSID','MODE','CHNL') + return 'C %s %*s %9s %17s %6s %s' % ('STR ',essidgap,'ESSID','ENCRYPT','BSSID','MODE','CHNL') # Wireless network label class NetLabel(urwid.WidgetWrap): @@ -338,7 +338,7 @@ class NetLabel(urwid.WidgetWrap): self.encrypt = wireless.GetWirelessProperty(id,'encryption_method') if wireless.GetWirelessProperty(id, 'encryption') else language['unsecured'] self.mode = wireless.GetWirelessProperty(id, 'mode') # Master, Ad-Hoc self.channel = wireless.GetWirelessProperty(id, 'channel') - theString = ' %*s %25s %9s %17s %6s %4s' % (gap, + theString = ' %-*s %25s %9s %17s %6s %4s' % (gap, self.stren,self.essid,self.encrypt,self.bssid,self.mode,self.channel) if is_active: theString = '>'+theString[1:] @@ -536,7 +536,9 @@ class appGUI(): # These are empty to make sure that things go my way. wiredL,wlessL = [],[]# = gen_network_list() + self.frame = None + self.diag = None self.wiredCB = urwid.Filler(WiredComboBox(wiredL)) self.wlessLB = urwid.ListBox(wlessL) @@ -566,20 +568,23 @@ class appGUI(): #(' ' ,' ',None), #(' ' ,' ',None), - self.footer1 = OptCols(keys,debug=True) + self.primaryCols = OptCols(keys,debug=True) #self.time_label = urwid.Text(strftime('%H:%M:%S')) self.time_label = \ urwid.AttrWrap(urwid.Text(strftime('%H:%M:%S')), 'timebar') self.status_label = urwid.AttrWrap(urwid.Text('blah'),'important') self.footer2 = urwid.Columns([self.status_label,('fixed', 8, self.time_label)]) - self.footerList = urwid.ListBox([self.footer1,self.footer2]) + self.footerList = urwid.Pile([self.primaryCols,self.footer2]) # Pop takes a number! #walker.pop(1) self.frame = urwid.Frame(self.thePile, header=header, - footer=urwid.BoxAdapter(self.footerList,2)) + footer=self.footerList) self.wiredCB.get_body().build_combobox(self.frame,ui,3) + # Init the other columns used in the program + self.init_other_optcols() + self.frame.set_body(self.thePile) # Booleans gallore! self.prev_state = False @@ -592,6 +597,18 @@ class appGUI(): #self.dialog = PrefOverlay(self.frame,self.size) + def init_other_optcols(self): + # The "tabbed" preferences dialog + self.prefCols = OptCols( [('meta enter','OK'), + ('ESC','Cancel'), + ('meta [','Tab Left',), + ('meta ]','Tab Right')],debug=True ) + self.confCols = OptCols( [ + ('<-','OK'), + ('ESC','Cancel') + ],debug=True ) + + # Does what it says it does def lock_screen(self): self.frame.set_body(self.screen_locker) @@ -636,7 +653,11 @@ class appGUI(): # TODO: Preserve current focus when updating the list. @wrap_exceptions() def update_netlist(self,state=None, x=None, force_check=False,firstrun=False): - # Run focus-collecting code if we are not running this for the first time + # Don't even try to do this if we are running a dialog + if self.diag: + return + # Run focus-collecting code if we are not running this for the first + # time if not firstrun: self.update_focusloc() self.list_header.set_text(gen_list_header()) @@ -787,6 +808,11 @@ class appGUI(): def dbus_scan_started(self): self.lock_screen() + def restore_primary(self): + self.frame.set_body(self.thePile) + self.diag = None + self.frame.set_footer(urwid.Pile([self.primaryCols,self.footer2])) + self.update_ui() # Redraw the screen @wrap_exceptions() def update_ui(self): @@ -800,78 +826,92 @@ class appGUI(): #canvaso = urwid.CanvasOverlay(self.dialog.render( (80,20),True),canvas,0,1) ui.draw_screen((self.size),canvas) keys = ui.get_input() + + if not self.diag: + # Handle keystrokes + if "f8" in keys or 'Q' in keys or 'q' in keys: + loop.quit() + #return False + if "f5" in keys or 'R' in keys: + self.lock_screen() + wireless.Scan(True) + if "D" in keys: + # Disconnect from all networks. + daemon.Disconnect() + self.update_netlist() + if 'right' in keys: + focus = self.thePile.get_focus() + self.frame.set_footer(urwid.Pile([self.confCols,self.footer2])) + if focus == self.wiredCB: + self.diag = WiredSettingsDialog(self.wiredCB.get_body().get_selected_profile()) + self.frame.set_body(self.diag) + else: + # wireless list only other option + wid,pos = self.thePile.get_focus().get_focus() + self.diag = WirelessSettingsDialog(pos) + self.diag.ready_widgets(ui,self.frame) + self.frame.set_body(self.diag) + # Guess what! I actually need to put this here, else I'll have + # tons of references to self.frame lying around. ^_^ + if "enter" in keys: + focus = self.frame.body.get_focus() + if focus == self.wiredCB: + self.special = focus + self.connect("wired",0) + else: + # wless list only other option + wid,pos = self.thePile.get_focus().get_focus() + self.connect("wireless",pos) - # Handle keystrokes - if "f8" in keys or 'Q' in keys or 'q' in keys: - loop.quit() - #return False - if "f5" in keys or 'R' in keys: - self.lock_screen() - wireless.Scan(True) - if "D" in keys: - # Disconnect from all networks. - daemon.Disconnect() - self.update_netlist() - # Guess what! I actually need to put this here, else I'll have tons of - # references to self.frame lying around. ^_^ - if "enter" in keys: - focus = self.frame.body.get_focus() - if focus == self.wiredCB: - self.special = focus - self.connect("wired",0) - else: - # wless list only other option - wid,pos = self.thePile.get_focus().get_focus() - self.connect("wireless",pos) - - if "esc" in keys: - # Force disconnect here if connection in progress - if self.connecting: - daemon.CancelConnect() - # Prevents automatic reconnecting if that option is enabled - daemon.SetForcedDisconnect(True) - if "P" in keys: - if not self.pref: - self.pref = PrefsDialog(self.frame,(0,1),ui, - dbusmanager.get_dbus_ifaces()) - if self.pref.run(ui,self.size,self.frame): - self.pref.save_results() - self.update_ui() - if "A" in keys: - about_dialog(self.frame) - if "C" in keys: - focus = self.thePile.get_focus() - if focus == self.wiredCB: - WiredSettingsDialog(self.wiredCB.get_body(). - get_selected_profile()).run(ui,self.size,self.frame) - else: - # wireless list only other option - wid,pos = self.thePile.get_focus().get_focus() - WirelessSettingsDialog(pos).run(ui,self.size,self.frame) - #self.netentry = NetEntryBase(dbusmanager.get_dbus_ifaces()) - #self.netentry.run(ui,self.size,self.frame) - if "I" in keys: - self.raise_hidden_network_dialog() - if "H" in keys or 'h' in keys or '?' in keys: - help_dialog(self.frame) - if "S" in keys: - focus = self.thePile.get_focus() - if focus == self.wiredCB: - nettype = 'wired' - netname = self.wiredCB.get_body().get_selected_profile() - else: - nettype = 'wireless' - netname = str(self.wlessLB.get_focus()[1]) - run_configscript(self.frame,netname,nettype) - if "O" in keys: - exitcode,data = AdHocDialog().run(ui,self.frame) - #data = (essid,ip,channel,use_ics,use_encrypt,key_edit) - if exitcode == 1: - wireless.CreateAdHocNetwork(data[0], - data[2], - data[1], "WEP", - data[5], - data[4], False) + if "esc" in keys: + # Force disconnect here if connection in progress + if self.connecting: + daemon.CancelConnect() + # Prevents automatic reconnecting if that option is enabled + daemon.SetForcedDisconnect(True) + if "P" in keys: + if not self.pref: + self.pref = PrefsDialog(self.frame,(0,1),ui, + dbusmanager.get_dbus_ifaces()) + if self.pref.run(ui,self.size,self.frame): + self.pref.save_settings() + self.update_ui() + if "A" in keys: + self.footer1 = self.confCols + about_dialog(self.frame) + if "C" in keys: + focus = self.thePile.get_focus() + if focus == self.wiredCB: + WiredSettingsDialog(self.wiredCB.get_body(). + get_selected_profile()).run(ui,self.size,self.frame) + else: + # wireless list only other option + wid,pos = self.thePile.get_focus().get_focus() + WirelessSettingsDialog(pos).run(ui,self.size,self.frame) + #self.netentry = NetEntryBase(dbusmanager.get_dbus_ifaces()) + #self.netentry.run(ui,self.size,self.frame) + if "I" in keys: + self.raise_hidden_network_dialog() + if "H" in keys or 'h' in keys or '?' in keys: + help_dialog(self.frame) + if "S" in keys: + focus = self.thePile.get_focus() + if focus == self.wiredCB: + nettype = 'wired' + netname = self.wiredCB.get_body().get_selected_profile() + else: + nettype = 'wireless' + netname = str(self.wlessLB.get_focus()[1]) + run_configscript(self.frame,netname,nettype) + if "O" in keys: + exitcode,data = AdHocDialog().run(ui,self.frame) + #data = (essid,ip,channel,use_ics,use_encrypt,key_edit) + if exitcode == 1: + wireless.CreateAdHocNetwork(data[0], + data[2], + data[1], "WEP", + data[5], + data[4], False) for k in keys: if urwid.is_mouse_event(k): @@ -882,7 +922,13 @@ class appGUI(): if k == "window resize": self.size = ui.get_cols_rows() continue - self.frame.keypress( self.size, k ) + k = self.frame.keypress( self.size, k ) + if self.diag: + if k == 'esc': + self.restore_primary() + if k == 'left' or k == 'meta enter': + self.diag.save_settings() + self.restore_primary() return True def connect(self, nettype, networkid, networkentry=None): diff --git a/setup.py b/setup.py index 4a21ae4..728aa53 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 = 'uimod-r286' +CURSES_REVNO = 'uimod-r287' try: if not os.path.exists('vcsinfo.py'): From 32d0d57b6d616feb5bcc6449136cdb902d76612c Mon Sep 17 00:00:00 2001 From: Andrew Psaltis Date: Thu, 5 Mar 2009 23:13:29 -0500 Subject: [PATCH 011/186] Made the keymappings displayed in the OptCols actually do what they say they're suppoed to do. Updated the README --- curses/README | 10 +++++----- curses/wicd-curses.py | 15 +++++++-------- 2 files changed, 12 insertions(+), 13 deletions(-) diff --git a/curses/README b/curses/README index 3e5df9d..ecd25c3 100644 --- a/curses/README +++ b/curses/README @@ -14,15 +14,15 @@ All features that I plan on implementing (that are not mentioned above) are listed the TODO file in this same directory. If you want any other features, ask me. I try to be on the #wicd Freenode IRC channel most of the time. -Controls: +Controls (most of these should be viewable in wicd-curses itself): F5 : refresh wireless networks -F8 or Q or q: quit +F8 Q q : quit D : disconnect from all active networks ESC : if connecting to a network, stop doing so -ENTER : Attempt connection to selected network +ENTER C : Attempt connection to selected network P : Display preferences dialog -C : Display network configuration for selected network +right arrow : Display network configuration for selected network A : Display "About" dialog I : Raise the "Scan for hidden networks" dialog H or h or ? : Raise help dialog @@ -33,7 +33,7 @@ O : Raise ad-hoc network dialog IN DIALOGS (Meta usually is "Alt"): ESC or Q: Quit dialog without saving information (if present) -Meta+Left/Right: Change tabs Left/Right (if tabs present) +Meta+[/]: Change tabs Left/Right (if tabs present) Meta+Enter : Quit dialog and save information FAQ (WIP): diff --git a/curses/wicd-curses.py b/curses/wicd-curses.py index 0bdebe3..94c91e6 100755 --- a/curses/wicd-curses.py +++ b/curses/wicd-curses.py @@ -880,16 +880,15 @@ class appGUI(): self.footer1 = self.confCols about_dialog(self.frame) if "C" in keys: - focus = self.thePile.get_focus() + # Same as "enter" for now + focus = self.frame.body.get_focus() if focus == self.wiredCB: - WiredSettingsDialog(self.wiredCB.get_body(). - get_selected_profile()).run(ui,self.size,self.frame) + self.special = focus + self.connect("wired",0) else: - # wireless list only other option - wid,pos = self.thePile.get_focus().get_focus() - WirelessSettingsDialog(pos).run(ui,self.size,self.frame) - #self.netentry = NetEntryBase(dbusmanager.get_dbus_ifaces()) - #self.netentry.run(ui,self.size,self.frame) + # wless list only other option + wid,pos = self.thePile.get_focus().get_focus() + self.connect("wireless",pos) if "I" in keys: self.raise_hidden_network_dialog() if "H" in keys or 'h' in keys or '?' in keys: From 421c108f0485e023243218ed49e5f724a3ba44ac Mon Sep 17 00:00:00 2001 From: Andrew Psaltis Date: Fri, 6 Mar 2009 12:49:27 -0500 Subject: [PATCH 012/186] curses/prefs_curses.py: Adapted widgets for integration into the main UI curses/curses_misc.py: Removed the "bottom_part" from the TabColumns curses/wicd-curses.py: Added support for editing preferences directly in the main UI w/o a dialog 'left' now only quits with saving for the NetworkSettingsDialogs (suggestions as for what to do here would be appreciated) --- curses/curses_misc.py | 13 ++++----- curses/prefs_curses.py | 60 ++---------------------------------------- curses/wicd-curses.py | 20 +++++++------- setup.py | 2 +- 4 files changed, 19 insertions(+), 76 deletions(-) diff --git a/curses/curses_misc.py b/curses/curses_misc.py index 01b7f3a..eb42efc 100644 --- a/curses/curses_misc.py +++ b/curses/curses_misc.py @@ -171,9 +171,10 @@ class TabColumns(urwid.WidgetWrap): attr = normal attributes attrsel = attribute when active """ - def __init__(self,tab_str,tab_wid,title,bottom_part,attr=('body','focus'), + # FIXME Make the bottom_part optional + def __init__(self,tab_str,tab_wid,title,bottom_part=None,attr=('body','focus'), attrsel='tab active', attrtitle='header'): - self.bottom_part = bottom_part + #self.bottom_part = bottom_part #title_wid = urwid.Text((attrtitle,title),align='right') column_list = [] for w in tab_str: @@ -195,7 +196,7 @@ class TabColumns(urwid.WidgetWrap): self.pile = urwid.Pile([ ('fixed',1,urwid.Filler(self.columns,'top')), urwid.Filler(lbox,'top',height=('relative',99)), - ('fixed',1,urwid.Filler(self.bottom_part,'bottom')) + #('fixed',1,urwid.Filler(self.bottom_part,'bottom')) ]) if not firstrun: self.frame.set_body(self.pile) @@ -205,7 +206,7 @@ class TabColumns(urwid.WidgetWrap): return True def keypress(self,size,key): - self._w.keypress(size,key) + key = self._w.keypress(size,key) if key == "meta [" or key == "meta ]": self._w.get_body().set_focus(0) newK = 'left' if key[-1] == '[' else 'right' @@ -220,7 +221,8 @@ class TabColumns(urwid.WidgetWrap): self.columns.get_focus().set_attr('tab active') self.active_tab = self.columns.get_focus() self.gen_pile(self.tab_map[self.active_tab]) - return key + + return key # self.listbox.body = lw @@ -347,7 +349,6 @@ class ComboBox(urwid.WidgetWrap): def build_combobox(self,parent,ui,row): str,trash = self.label.get_text() - self.cbox = DynWrap(SelText([self.list[self.focus]+' vvv']), attrs=self.attrs,focus_attr=self.focus_attr) if str != '': diff --git a/curses/prefs_curses.py b/curses/prefs_curses.py index 86b60c2..532b2e5 100755 --- a/curses/prefs_curses.py +++ b/curses/prefs_curses.py @@ -237,27 +237,10 @@ class PrefsDialog(urwid.WidgetWrap): self.header2 : advancedLB} #self.load_settings() - # Now for the buttons: - ok_t = 'OK' - cancel_t = 'Cancel' - - ok_button = urwid.AttrWrap(urwid.Button('OK',self.ok_callback),'body','focus') - cancel_button = urwid.AttrWrap(urwid.Button('Cancel',self.cancel_callback),'body','focus') - # Variables set by the buttons' callback functions - self.CANCEL_PRESSED = False - self.OK_PRESSED = False - - - self.button_cols = urwid.Columns([ok_button,cancel_button], - dividechars=1) - - self.tabs = TabColumns(headerList,lbList,language['preferences'],self.button_cols) + self.tabs = TabColumns(headerList,lbList,language['preferences']) self.__super.__init__(self.tabs) def load_settings(self): - # Reset the buttons - self.CANCEL_PRESSED = False - self.OK_PRESSED = False ### General Settings # ComboBox does not like dbus.Strings as text markups. My fault. :/ @@ -378,45 +361,6 @@ class PrefsDialog(urwid.WidgetWrap): for w in self.dns1,self.dns2,self.dns3,self.dns_dom,self.search_dom: w.set_sensitive(new_state) - # Button callbacks - def ok_callback(self,button_object,user_data=None): - self.OK_PRESSED = True - def cancel_callback(self,button_object,user_data=None): - self.CANCEL_PRESSED = True - - def ready_comboboxes(self,ui,body): + def ready_widgets(self,ui,body): self.wpa_cbox.build_combobox(body,ui,4) self.backend_cbox.build_combobox(body,ui,8) - - # Put the widget into an overlay, and run! - def run(self,ui, dim, display): - width,height = ui.get_cols_rows() - self.load_settings() - - overlay = urwid.Overlay(self.tabs, display, ('fixed left', 0),width - , ('fixed top',1), height-3) - self.ready_comboboxes(ui,overlay) - - keys = True - while True: - if keys: - ui.draw_screen(dim, overlay.render(dim, True)) - keys = ui.get_input() - - if "window resize" in keys: - dim = ui.get_cols_rows() - if "esc" in keys or 'Q' in keys: - return False - for k in keys: - #Send key to underlying widget: - overlay.keypress(dim, k) - if urwid.is_mouse_event(k): - event, button, col, row = k - overlay.mouse_event( dim, - event, button, col, row, - focus=True) - # Check if buttons are pressed. - if self.CANCEL_PRESSED: - return False - if self.OK_PRESSED or 'meta enter' in keys: - return True diff --git a/curses/wicd-curses.py b/curses/wicd-curses.py index 94c91e6..c5355ad 100755 --- a/curses/wicd-curses.py +++ b/curses/wicd-curses.py @@ -564,9 +564,6 @@ class appGUI(): ('I' ,'Hidden',None), ('Q' ,'Quit',loop.quit) ] - #(' ' ,' ',None), - #(' ' ,' ',None), - #(' ' ,' ',None), self.primaryCols = OptCols(keys,debug=True) #self.time_label = urwid.Text(strftime('%H:%M:%S')) @@ -608,7 +605,6 @@ class appGUI(): ('ESC','Cancel') ],debug=True ) - # Does what it says it does def lock_screen(self): self.frame.set_body(self.screen_locker) @@ -650,7 +646,6 @@ class appGUI(): # Be clunky until I get to a later stage of development. # Update the list of networks. Usually called by DBus. - # TODO: Preserve current focus when updating the list. @wrap_exceptions() def update_netlist(self,state=None, x=None, force_check=False,firstrun=False): # Don't even try to do this if we are running a dialog @@ -755,7 +750,6 @@ class appGUI(): self.update_ui() return True - # Cheap little indicator stating that we are actually connecting twirl = ['|','/','-','\\'] tcount = 0 # Counter for said indicator @@ -873,11 +867,14 @@ class appGUI(): if not self.pref: self.pref = PrefsDialog(self.frame,(0,1),ui, dbusmanager.get_dbus_ifaces()) - if self.pref.run(ui,self.size,self.frame): - self.pref.save_settings() - self.update_ui() + self.pref.load_settings() + self.pref.ready_widgets(ui,self.frame) + self.frame.set_footer(urwid.Pile([self.prefCols,self.footer2])) + self.diag = self.pref + self.frame.set_body(self.diag) + # Halt here, keypress gets passed to the dialog otherwise + return True if "A" in keys: - self.footer1 = self.confCols about_dialog(self.frame) if "C" in keys: # Same as "enter" for now @@ -925,7 +922,8 @@ class appGUI(): if self.diag: if k == 'esc': self.restore_primary() - if k == 'left' or k == 'meta enter': + if (k == 'left' and self.diag.__class__.__mro__[0] == \ + type(urwid.WidgetWrap)) or k == 'meta enter': self.diag.save_settings() self.restore_primary() return True diff --git a/setup.py b/setup.py index 728aa53..c232c4b 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 = 'uimod-r287' +CURSES_REVNO = 'uimod-r288' try: if not os.path.exists('vcsinfo.py'): From a217f0fdc2b146a45706ba58706839a7f3d3fd58 Mon Sep 17 00:00:00 2001 From: Andrew Psaltis Date: Fri, 6 Mar 2009 15:41:19 -0500 Subject: [PATCH 013/186] Fixed the "left does not quit the preferences dialog" problem in wicd-curses. --- curses/wicd-curses.py | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/curses/wicd-curses.py b/curses/wicd-curses.py index c5355ad..152dfeb 100755 --- a/curses/wicd-curses.py +++ b/curses/wicd-curses.py @@ -58,7 +58,7 @@ from curses_misc import * from prefs_curses import PrefsDialog import netentry_curses -from netentry_curses import WirelessSettingsDialog, WiredSettingsDialog +from netentry_curses import WirelessSettingsDialog, WiredSettingsDialog,AdvancedSettingsDialog from optparse import OptionParser @@ -922,8 +922,7 @@ class appGUI(): if self.diag: if k == 'esc': self.restore_primary() - if (k == 'left' and self.diag.__class__.__mro__[0] == \ - type(urwid.WidgetWrap)) or k == 'meta enter': + if (k == 'left' and issubclass(self.diag.__class__,AdvancedSettingsDialog)) or k == 'meta enter': self.diag.save_settings() self.restore_primary() return True From 7d5fac6f0a9810cfb3bf2b5c04ba37ca10f38252 Mon Sep 17 00:00:00 2001 From: Andrew Psaltis Date: Sat, 7 Mar 2009 16:26:41 -0500 Subject: [PATCH 014/186] Added mouse support to OptCols. Everything works :-). This branch will be merged into experimental-nacl once I'm sure that everything works, and I update the documentation. --- curses/curses_misc.py | 12 +++-- curses/wicd-curses.py | 101 +++++++++++++++++++++--------------------- setup.py | 2 +- 3 files changed, 61 insertions(+), 54 deletions(-) diff --git a/curses/curses_misc.py b/curses/curses_misc.py index eb42efc..b55163e 100644 --- a/curses/curses_misc.py +++ b/curses/curses_misc.py @@ -530,14 +530,15 @@ class ClickCols(urwid.WidgetWrap): self.callback = callback self.args = args def mouse_event(self,size,event,button,x,y,focus): - self.callback(self.args) + if event == "mouse press": + self.callback(self.args) # htop-style menu menu-bar on the bottom of the screen class OptCols(urwid.WidgetWrap): - # tuples = [(key,desc,on_event)], on_event currently ignored + # tuples = [(key,desc)], on_event gets passed a key # attrs = (attr_key,attr_desc) # mentions of 'left' and right will be converted to <- and -> respectively - def __init__(self,tuples,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 # 2 characters long (e.g., -> for left) #maxlen = 6 @@ -564,6 +565,8 @@ class OptCols(urwid.WidgetWrap): key += '<-' elif part == 'right': key += '->' + elif part == 'esc': + key += 'ESC' else: key += part @@ -571,6 +574,9 @@ class OptCols(urwid.WidgetWrap): if debug: callback = self.debugClick args = cmd[1] + else: + callback = handler + args = cmd[0] #self.callbacks.append(cmd[2]) col = ClickCols([ ('fixed',len(key)+1,urwid.Text((attrs[0],key+':')) ), diff --git a/curses/wicd-curses.py b/curses/wicd-curses.py index a66f8cb..e5ff4ad 100755 --- a/curses/wicd-curses.py +++ b/curses/wicd-curses.py @@ -163,24 +163,6 @@ def check_for_wireless(iwconfig, wireless_ip, set_status): # DBUS interfaces do. ^_^ # Whatever calls this must be exception-wrapped if it is run if the UI is up def gen_network_list(): - #id=0 - #wiredL = [] - #is_active = wireless.GetWirelessIP('') == None and wired.GetWiredIP('') != None - # This one makes a list of strings to put in a combo box. - #for profile in wired.GetWiredProfileList(): - #theString = '%4s %25s' % (id, profile) - #### THIS IS wired.blah() in experimental - #print config.GetLastUsedWiredNetwork() - # Tag if no wireless IP present, and wired one is - #if is_active: - # theString = '>'+theString[1:] - - #wiredL.append(urwid.AttrWrap(SelText(theString),'connected', - # 'connected focus')) - #else: - #wiredL.append(urwid.AttrWrap(SelText(theString),'body','focus')) - #wiredL.append(theString) - #id+=1 wiredL = wired.GetWiredProfileList() wlessL = [] # This one makes a list of NetLabels @@ -239,6 +221,9 @@ def help_dialog(body): ('bold',' Q'),": Quit wicd-curses\n", ]) textF = urwid.Text('Press any key to return.') + + # textJ = urwid.Text('Nobody expects the Spanish Inquisition!') + blank = urwid.Text('') # Pile containing a text and columns? cols = urwid.Columns([text1,text2]) @@ -250,6 +235,14 @@ def help_dialog(body): ui.draw_screen(dim, frame.render(dim, True)) keys = ui.get_input() + # Don't stop because someone let go of the mouse on the frame + mouse_release = False + for k in keys: + if urwid.is_mouse_event(k) and k[0] == "mouse release": + mouse_release = True + break + if mouse_release : + continue if 'window resize' in keys: dim = ui.get_cols_rows() elif keys: @@ -306,10 +299,6 @@ Once there, you can adjust (or add) the "beforescript", "afterscript", and "disc main() """ -######################################## -##### URWID SUPPORT CLASSES -######################################## - def gen_list_header(): if daemon.GetSignalDisplayType() == 0: # Allocate 25 cols for the ESSID name @@ -319,6 +308,10 @@ def gen_list_header(): essidgap = 28 return 'C %s %*s %9s %17s %6s %s' % ('STR ',essidgap,'ESSID','ENCRYPT','BSSID','MODE','CHNL') +######################################## +##### URWID SUPPORT CLASSES +######################################## + # Wireless network label class NetLabel(urwid.WidgetWrap): def __init__(self, id, is_active): @@ -566,7 +559,7 @@ class appGUI(): ('Q' ,'Quit',loop.quit) ] - self.primaryCols = OptCols(keys,debug=True) + self.primaryCols = OptCols(keys,self.handle_keys) #self.time_label = urwid.Text(strftime('%H:%M:%S')) self.time_label = \ urwid.AttrWrap(urwid.Text(strftime('%H:%M:%S')), 'timebar') @@ -598,13 +591,14 @@ class appGUI(): def init_other_optcols(self): # The "tabbed" preferences dialog self.prefCols = OptCols( [('meta enter','OK'), - ('ESC','Cancel'), + ('esc','Cancel'), ('meta [','Tab Left',), - ('meta ]','Tab Right')],debug=True ) + ('meta ]','Tab Right')],self.handle_keys + ) self.confCols = OptCols( [ - ('<-','OK'), - ('ESC','Cancel') - ],debug=True ) + ('left','OK'), + ('esc','Cancel') + ],self.handle_keys) # Does what it says it does def lock_screen(self): @@ -808,20 +802,8 @@ class appGUI(): self.diag = None self.frame.set_footer(urwid.Pile([self.primaryCols,self.footer2])) self.update_ui() - # Redraw the screen - @wrap_exceptions() - def update_ui(self): - #self.update_status() - canvas = self.frame.render( (self.size),True ) - ### GRRRRRRRRRRRRRRRRRRRRR ->^^^^ - # It looks like if I want to get the statusbar to update itself - # continuously, I would have to use overlay the canvasses and redirect - # the input. I'll try to get that working at a later time, if people - # want that "feature". - #canvaso = urwid.CanvasOverlay(self.dialog.render( (80,20),True),canvas,0,1) - ui.draw_screen((self.size),canvas) - keys = ui.get_input() - + + def handle_keys(self,keys): if not self.diag: # Handle keystrokes if "f8" in keys or 'Q' in keys or 'q' in keys: @@ -890,7 +872,10 @@ class appGUI(): if "I" in keys: self.raise_hidden_network_dialog() if "H" in keys or 'h' in keys or '?' in keys: - help_dialog(self.frame) + # FIXME I shouldn't need this, OptCols messes up this one + # particular button + if not self.diag: + help_dialog(self.frame) if "S" in keys: focus = self.thePile.get_focus() if focus == self.wiredCB: @@ -910,22 +895,38 @@ class appGUI(): data[5], data[4], False) + if self.diag: + if 'esc' in keys: + self.restore_primary() + if ('left' in keys and issubclass(self.diag.__class__,AdvancedSettingsDialog)) or 'meta enter' in keys: + self.diag.save_settings() + self.restore_primary() for k in keys: if urwid.is_mouse_event(k): event, button, col, row = k self.frame.mouse_event( self.size, event, button, col, row, focus=True) + continue if k == "window resize": self.size = ui.get_cols_rows() continue - k = self.frame.keypress( self.size, k ) - if self.diag: - if k == 'esc': - self.restore_primary() - if (k == 'left' and issubclass(self.diag.__class__,AdvancedSettingsDialog)) or k == 'meta enter': - self.diag.save_settings() - self.restore_primary() + + # Redraw the screen + @wrap_exceptions() + def update_ui(self): + #self.update_status() + canvas = self.frame.render( (self.size),True ) + ### GRRRRRRRRRRRRRRRRRRRRR ->^^^^ + # It looks like if I want to get the statusbar to update itself + # continuously, I would have to use overlay the canvasses and redirect + # the input. I'll try to get that working at a later time, if people + # want that "feature". + #canvaso = urwid.CanvasOverlay(self.dialog.render( (80,20),True),canvas,0,1) + ui.draw_screen((self.size),canvas) + keys = ui.get_input() + self.handle_keys(keys) + return True def connect(self, nettype, networkid, networkentry=None): diff --git a/setup.py b/setup.py index 9444054..22e793b 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 = 'uimod-r288' +CURSES_REVNO = 'uimod-r289' try: if not os.path.exists('vcsinfo.py'): From df6955b963e9718e496313cddc2d6e52dee495b4 Mon Sep 17 00:00:00 2001 From: Andrew Psaltis Date: Sat, 7 Mar 2009 19:53:10 -0500 Subject: [PATCH 015/186] Fixed most keypresses not working. --- curses/wicd-curses.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/curses/wicd-curses.py b/curses/wicd-curses.py index e5ff4ad..1d08fe2 100755 --- a/curses/wicd-curses.py +++ b/curses/wicd-curses.py @@ -222,7 +222,7 @@ def help_dialog(body): ]) textF = urwid.Text('Press any key to return.') - # textJ = urwid.Text('Nobody expects the Spanish Inquisition!') + # textJ = urwid.Text(('important','Nobody expects the Spanish Inquisition!')) blank = urwid.Text('') # Pile containing a text and columns? @@ -902,6 +902,7 @@ class appGUI(): self.diag.save_settings() self.restore_primary() for k in keys: + self.frame.keypress(self.size,k) if urwid.is_mouse_event(k): event, button, col, row = k self.frame.mouse_event( self.size, From 2d3745f39b262116ccbdc968f582c14df91d7c21 Mon Sep 17 00:00:00 2001 From: Andrew Psaltis Date: Wed, 11 Mar 2009 10:21:20 -0400 Subject: [PATCH 016/186] Fixed some bugs/usability issues Enter is no longer mapped to anything Arrow left is no longer mapped to anything Edit text when it is unfocusable is now brown. Fixed problem where scrolling up on the Preferences Dialog would somehow shift the dab over one. --- curses/curses_misc.py | 2 +- curses/wicd-curses.py | 25 +++++++++++++------------ 2 files changed, 14 insertions(+), 13 deletions(-) diff --git a/curses/curses_misc.py b/curses/curses_misc.py index b55163e..399c512 100644 --- a/curses/curses_misc.py +++ b/curses/curses_misc.py @@ -206,13 +206,13 @@ class TabColumns(urwid.WidgetWrap): return True def keypress(self,size,key): - key = self._w.keypress(size,key) if key == "meta [" or key == "meta ]": self._w.get_body().set_focus(0) newK = 'left' if key[-1] == '[' else 'right' self.keypress(size,newK) self._w.get_body().set_focus(1) else: + key = self._w.keypress(size,key) wid = self.pile.get_focus().get_body() if wid == self.columns: # lw = self.listbox.body diff --git a/curses/wicd-curses.py b/curses/wicd-curses.py index 1d08fe2..52bbab6 100755 --- a/curses/wicd-curses.py +++ b/curses/wicd-curses.py @@ -206,7 +206,7 @@ def help_dialog(body): text1 = urwid.Text([ ('bold','H h ?'),": Display this help dialog\n", -('bold','enter'),": Connect to selected network\n", +('bold',' C'),": Connect to selected network\n", ('bold',' D'),": Disconnect from all networks\n", ('bold',' ESC'),": Stop a network connection in progress\n", ('bold',' F5 R'),": Refresh network list\n", @@ -596,7 +596,7 @@ class appGUI(): ('meta ]','Tab Right')],self.handle_keys ) self.confCols = OptCols( [ - ('left','OK'), + ('meta enter','OK'), ('esc','Cancel') ],self.handle_keys) @@ -831,14 +831,15 @@ class appGUI(): # Guess what! I actually need to put this here, else I'll have # tons of references to self.frame lying around. ^_^ if "enter" in keys: - focus = self.frame.body.get_focus() - if focus == self.wiredCB: - self.special = focus - self.connect("wired",0) - else: - # wless list only other option - wid,pos = self.thePile.get_focus().get_focus() - self.connect("wireless",pos) + pass + #focus = self.frame.body.get_focus() + #if focus == self.wiredCB: + # self.special = focus + # self.connect("wired",0) + #else: + # # wless list only other option + # wid,pos = self.thePile.get_focus().get_focus() + # self.connect("wireless",pos) if "esc" in keys: # Force disconnect here if connection in progress @@ -898,7 +899,7 @@ class appGUI(): if self.diag: if 'esc' in keys: self.restore_primary() - if ('left' in keys and issubclass(self.diag.__class__,AdvancedSettingsDialog)) or 'meta enter' in keys: + if 'meta enter' in keys: self.diag.save_settings() self.restore_primary() for k in keys: @@ -976,7 +977,7 @@ def main(): ('editcp', 'default', 'default', 'standout'), ('editbx', 'light gray', 'dark blue'), ('editfc', 'white','dark blue', 'bold'), - ('editnfc','dark gray','default','bold'), + ('editnfc','brown','default','bold'), ('tab active','dark green','light gray'), ('infobar','light gray','dark blue'), ('timebar','dark gray','default'), From f2f7299c9893cdb1dae8d241cdb58caa98ef74d3 Mon Sep 17 00:00:00 2001 From: Andrew Psaltis Date: Sat, 14 Mar 2009 20:54:45 -0400 Subject: [PATCH 017/186] Fixed some keypress shenanigans curses/wicd-curses.py: Fixed mouse events being passed to keypress functions (again) curses/prefs_curses.py: Fixed some translations curses/curses_misc.py: Fixed mouse handling in TabColumns Fixed callbacks to non-global keypresses in OptCols --- curses/curses_misc.py | 14 +++++++++++++- curses/prefs_curses.py | 4 ++-- curses/wicd-curses.py | 16 +++++++++------- 3 files changed, 24 insertions(+), 10 deletions(-) diff --git a/curses/curses_misc.py b/curses/curses_misc.py index 399c512..f2d1ba0 100644 --- a/curses/curses_misc.py +++ b/curses/curses_misc.py @@ -224,6 +224,17 @@ class TabColumns(urwid.WidgetWrap): return key # self.listbox.body = lw + def mouse_event(self,size,event,button,x,y,focus): + wid = self.pile.get_focus().get_body() + if wid == self.columns: + self.active_tab.set_attr('body') + + self._w.mouse_event(size,event,button,x,y,focus) + if wid == self.columns: + self.active_tab.set_attr('body') + self.columns.get_focus().set_attr('tab active') + self.active_tab = self.columns.get_focus() + self.gen_pile(self.tab_map[self.active_tab]) ### Combo box code begins here @@ -531,7 +542,8 @@ class ClickCols(urwid.WidgetWrap): self.args = args def mouse_event(self,size,event,button,x,y,focus): if event == "mouse press": - self.callback(self.args) + # The keypress dealie in wicd-curses.py expects a list of keystrokes + self.callback([self.args]) # htop-style menu menu-bar on the bottom of the screen class OptCols(urwid.WidgetWrap): diff --git a/curses/prefs_curses.py b/curses/prefs_curses.py index b2a37bf..b220597 100644 --- a/curses/prefs_curses.py +++ b/curses/prefs_curses.py @@ -68,8 +68,8 @@ class PrefsDialog(urwid.WidgetWrap): global_dns_cat_t = ('header',language['global_dns_servers']) global_dns_t = ('editcp',language['use_global_dns']) - dns_dom_t = ('editcp',' DNS Domain: ') - search_dom_t = ('editcp',' Search domain:') + dns_dom_t = ('editcp',' '+language['dns_domain']+': ') + search_dom_t = ('editcp',' '+language['search_domain']+':') dns1_t = ('editcp',' DNS server 1: ') dns2_t = ('editcp',' DNS server 2: ') dns3_t = ('editcp',' DNS server 3: ') diff --git a/curses/wicd-curses.py b/curses/wicd-curses.py index 52bbab6..34fff9d 100755 --- a/curses/wicd-curses.py +++ b/curses/wicd-curses.py @@ -896,20 +896,22 @@ class appGUI(): data[5], data[4], False) - if self.diag: - if 'esc' in keys: - self.restore_primary() - if 'meta enter' in keys: - self.diag.save_settings() - self.restore_primary() for k in keys: - self.frame.keypress(self.size,k) if urwid.is_mouse_event(k): event, button, col, row = k self.frame.mouse_event( self.size, event, button, col, row, focus=True) continue + if self.diag: + if k == 'esc': + self.restore_primary() + break + if k == 'meta enter': + self.diag.save_settings() + self.restore_primary() + break + self.frame.keypress(self.size,k) if k == "window resize": self.size = ui.get_cols_rows() continue From 4a8c98e6d26cf819b5ec171d66d19b15316bbf49 Mon Sep 17 00:00:00 2001 From: Andrew Psaltis Date: Mon, 16 Mar 2009 21:12:36 -0400 Subject: [PATCH 018/186] Dump descriptions of error messages to stderr instead of stdout. --- curses/wicd-curses.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/curses/wicd-curses.py b/curses/wicd-curses.py index 323d7e8..9586d3b 100755 --- a/curses/wicd-curses.py +++ b/curses/wicd-curses.py @@ -90,13 +90,13 @@ class wrap_exceptions: #gobject.source_remove(redraw_tag) loop.quit() ui.stop() - print "\n"+language['terminated'] + print >> sys.stderr, "\n"+language['terminated'] #raise except DBusException: #gobject.source_remove(redraw_tag) loop.quit() ui.stop() - print "\n"+language['dbus_fail'] + print >> sys.stderr,"\n"+language['dbus_fail'] raise except : # Quit the loop @@ -105,7 +105,7 @@ class wrap_exceptions: # Zap the screen ui.stop() # Print out standard notification: - print "\n" + language['exception'] + print >> sys.stderr, "\n" + language['exception'] # Flush the buffer so that the notification is always above the # backtrace sys.stdout.flush() @@ -933,7 +933,7 @@ def setup_dbus(force=True): except DBusException: # I may need to be a little more verbose here. # Suggestions as to what should go here, please? - print language['cannot_connect_to_daemon'] + print >> sys.stderr, language['cannot_connect_to_daemon'] #raise # return False # <- Will need soon. bus = dbusmanager.get_bus() From 547a3f1b889f842c84111a990f42aab13cb5c4c5 Mon Sep 17 00:00:00 2001 From: Andrew Psaltis Date: Thu, 19 Mar 2009 12:48:28 -0400 Subject: [PATCH 019/186] Re-enabled "enter" in wicd-curses.py. --- curses/wicd-curses.py | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/curses/wicd-curses.py b/curses/wicd-curses.py index 9f574bc..17bf242 100755 --- a/curses/wicd-curses.py +++ b/curses/wicd-curses.py @@ -831,15 +831,15 @@ class appGUI(): # Guess what! I actually need to put this here, else I'll have # tons of references to self.frame lying around. ^_^ if "enter" in keys: - pass - #focus = self.frame.body.get_focus() - #if focus == self.wiredCB: - # self.special = focus - # self.connect("wired",0) - #else: - # # wless list only other option - # wid,pos = self.thePile.get_focus().get_focus() - # self.connect("wireless",pos) + #pass + focus = self.frame.body.get_focus() + if focus == self.wiredCB: + self.special = focus + self.connect("wired",0) + else: + # wless list only other option + wid,pos = self.thePile.get_focus().get_focus() + self.connect("wireless",pos) if "esc" in keys: # Force disconnect here if connection in progress From 064fa05d61c616acfb06d9a7bed01e2aec853308 Mon Sep 17 00:00:00 2001 From: Andrew Psaltis Date: Sat, 21 Mar 2009 23:18:03 -0400 Subject: [PATCH 020/186] Updated docs to note that enter results in connecting. --- curses/wicd-curses.py | 26 +++++++++++++------------- in/man=wicd-curses.8.in | 2 +- 2 files changed, 14 insertions(+), 14 deletions(-) diff --git a/curses/wicd-curses.py b/curses/wicd-curses.py index 17bf242..7d01658 100755 --- a/curses/wicd-curses.py +++ b/curses/wicd-curses.py @@ -202,23 +202,23 @@ def help_dialog(body): textH = urwid.Text([ "For more detailed help, consult the wicd-curses(8) man page.\n", -('bold','->'),' and ',('bold','<-')," are the right and left arrows respectively\n"]) +('bold','->'),' and ',('bold','<-')," are the right and left arrows respectively.\n"]) text1 = urwid.Text([ -('bold','H h ?'),": Display this help dialog\n", -('bold',' C'),": Connect to selected network\n", -('bold',' D'),": Disconnect from all networks\n", -('bold',' ESC'),": Stop a network connection in progress\n", -('bold',' F5 R'),": Refresh network list\n", -('bold',' P'),": Prefrences dialog\n", +('bold',' H h ?'),": Display this help dialog\n", +('bold','enter C'),": Connect to selected network\n", +('bold',' D'),": Disconnect from all networks\n", +('bold',' ESC'),": Stop a network connection in progress\n", +('bold',' F5 R'),": Refresh network list\n", +('bold',' P'),": Prefrences dialog\n", ]) text2 = urwid.Text([ -('bold',' I'),": Scan for hidden networks\n", -('bold',' S'),": Select scripts\n", -('bold',' O'),": Set up Ad-hoc network\n", -('bold',' ->'),": Configure selected network\n", -('bold',' A'),": Display 'about' dialog\n", -('bold',' Q'),": Quit wicd-curses\n", +('bold',' I'),": Scan for hidden networks\n", +('bold',' S'),": Select scripts\n", +('bold',' O'),": Set up Ad-hoc network\n", +('bold',' ->'),": Configure selected network\n", +('bold',' A'),": Display 'about' dialog\n", +('bold',' Q'),": Quit wicd-curses\n", ]) textF = urwid.Text('Press any key to return.') diff --git a/in/man=wicd-curses.8.in b/in/man=wicd-curses.8.in index 99cfd68..603b057 100644 --- a/in/man=wicd-curses.8.in +++ b/in/man=wicd-curses.8.in @@ -52,7 +52,7 @@ Raise the "About wicd-curses" dialog .\".PP .\"The following is a work in progress and might not be fully functional as of yet. .TP -.BR C +.BR "C " or "enter" Bring up network configuration controller for the selected network .TP .BR delete From 65c72ba3a22219f7751a34ed908f9573101060da Mon Sep 17 00:00:00 2001 From: Dan O'Reilly Date: Sun, 22 Mar 2009 17:36:55 -0400 Subject: [PATCH 021/186] Update copyrights and some docstrings. Make trayicon network menu scan-triggering behave better. --- wicd/autoconnect.py | 6 ++++-- wicd/backend.py | 4 ++-- wicd/backends/be-external.py | 4 ++-- wicd/backends/be-ioctl.py | 4 ++-- wicd/configmanager.py | 6 +++--- wicd/configscript.py | 6 +++--- wicd/dbusmanager.py | 4 ++-- wicd/gui.py | 9 ++++----- wicd/guiutil.py | 4 ++-- wicd/logfile.py | 2 +- wicd/misc.py | 11 ++++++++--- wicd/monitor.py | 4 ++-- wicd/netentry.py | 11 +++++++++-- wicd/networking.py | 6 +++--- wicd/prefs.py | 6 +++--- wicd/suspend.py | 4 ++-- wicd/translations.py | 1 + wicd/wicd-client.py | 21 +++++++++++---------- wicd/wicd-daemon.py | 15 ++++++--------- wicd/wnettools.py | 14 ++++++-------- 20 files changed, 76 insertions(+), 66 deletions(-) diff --git a/wicd/autoconnect.py b/wicd/autoconnect.py index be830dc..b591076 100755 --- a/wicd/autoconnect.py +++ b/wicd/autoconnect.py @@ -1,8 +1,10 @@ #!/usr/bin/python +""" autoconnect -- Triggers an automatic connection attempt. """ + # -# Copyright (C) 2007 - 2008 Adam Blackburn -# Copyright (C) 2007 - 2008 Dan O'Reilly +# Copyright (C) 2007 - 2009 Adam Blackburn +# Copyright (C) 2007 - 2009 Dan O'Reilly # # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License Version 2 as diff --git a/wicd/backend.py b/wicd/backend.py index bdd2b8b..15b4a7a 100644 --- a/wicd/backend.py +++ b/wicd/backend.py @@ -7,8 +7,8 @@ Manages and loads the pluggable backends for wicd. """ # -# Copyright (C) 2008 Adam Blackburn -# Copyright (C) 2008 Dan O'Reilly +# Copyright (C) 2008-2009 Adam Blackburn +# Copyright (C) 2008-2009 Dan O'Reilly # # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License Version 2 as diff --git a/wicd/backends/be-external.py b/wicd/backends/be-external.py index 2cce772..9bd0fbb 100644 --- a/wicd/backends/be-external.py +++ b/wicd/backends/be-external.py @@ -13,8 +13,8 @@ class WirelessInterface() -- Control a wireless network interface. """ # -# Copyright (C) 2008 Adam Blackburn -# Copyright (C) 2008 Dan O'Reilly +# Copyright (C) 2008-2009 Adam Blackburn +# Copyright (C) 2008-2009 Dan O'Reilly # # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License Version 2 as diff --git a/wicd/backends/be-ioctl.py b/wicd/backends/be-ioctl.py index 0b80a2b..fc9a278 100644 --- a/wicd/backends/be-ioctl.py +++ b/wicd/backends/be-ioctl.py @@ -14,8 +14,8 @@ class WirelessInterface() -- Control a wireless network interface. """ # -# Copyright (C) 2008 Adam Blackburn -# Copyright (C) 2008 Dan O'Reilly +# Copyright (C) 2008-2009 Adam Blackburn +# Copyright (C) 2008-2009 Dan O'Reilly # # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License Version 2 as diff --git a/wicd/configmanager.py b/wicd/configmanager.py index acfb8a1..19da2bc 100644 --- a/wicd/configmanager.py +++ b/wicd/configmanager.py @@ -1,6 +1,6 @@ #!/usr/bin/env python -""" Wicd Configuration Manager +""" configmanager -- Wicd configuration file manager Wrapper around ConfigParser for wicd, though it should be reusable for other purposes as well. @@ -8,8 +8,8 @@ reusable for other purposes as well. """ # -# Copyright (C) 2008 Adam Blackburn -# Copyright (C) 2008 Dan O'Reilly +# Copyright (C) 2008-2009 Adam Blackburn +# Copyright (C) 2008-2009 Dan O'Reilly # # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License Version 2 as diff --git a/wicd/configscript.py b/wicd/configscript.py index 9e1a7c5..bb6fa28 100755 --- a/wicd/configscript.py +++ b/wicd/configscript.py @@ -1,6 +1,6 @@ #!/usr/bin/env python -""" Configure the scripts for a particular network. +""" configscript -- Configure the scripts for a particular network. Script for configuring the scripts for a network passed in as a command line argument. This needs to run a separate process because @@ -10,8 +10,8 @@ run as the current user. """ # -# Copyright (C) 2007-2008 Adam Blackburn -# Copyright (C) 2007-2008 Dan O'Reilly +# Copyright (C) 2007-2009 Adam Blackburn +# Copyright (C) 2007-2009 Dan O'Reilly # # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License Version 2 as diff --git a/wicd/dbusmanager.py b/wicd/dbusmanager.py index 0c25b6c..6cd3ec3 100644 --- a/wicd/dbusmanager.py +++ b/wicd/dbusmanager.py @@ -7,8 +7,8 @@ A module for managing wicd's dbus interfaces. """ # -# Copyright (C) 2008 Adam Blackburn -# Copyright (C) 2008 Dan O'Reilly +# Copyright (C) 2008-2009 Adam Blackburn +# Copyright (C) 2008-2009 Dan O'Reilly # # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License Version 2 as diff --git a/wicd/gui.py b/wicd/gui.py index 6832337..61b0b5b 100644 --- a/wicd/gui.py +++ b/wicd/gui.py @@ -1,15 +1,14 @@ #!/usr/bin/python -""" Wicd GUI module. +""" gui -- The main wicd GUI module. -Module containg all the code (other than the tray icon) related to the -Wicd user interface. +Module containing the code for the main wicd GUI. """ # -# Copyright (C) 2007 Adam Blackburn -# Copyright (C) 2007 Dan O'Reilly +# Copyright (C) 2007-2009 Adam Blackburn +# Copyright (C) 2007-2009 Dan O'Reilly # # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License Version 2 as diff --git a/wicd/guiutil.py b/wicd/guiutil.py index 8eea489..454f37d 100644 --- a/wicd/guiutil.py +++ b/wicd/guiutil.py @@ -1,7 +1,7 @@ """ guiutil - A collection of commonly used gtk/gui functions and classes. """ # -# Copyright (C) 2007 - 2008 Adam Blackburn -# Copyright (C) 2007 - 2008 Dan O'Reilly +# Copyright (C) 2007 - 2009 Adam Blackburn +# Copyright (C) 2007 - 2009 Dan O'Reilly # # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License Version 2 as diff --git a/wicd/logfile.py b/wicd/logfile.py index c25dd03..408aea2 100644 --- a/wicd/logfile.py +++ b/wicd/logfile.py @@ -2,7 +2,7 @@ # # Copyright (C) 1999-2006 Keith Dart -# Copyright (C) 2008 Dan O'Reilly +# Copyright (C) 2008-2009 Dan O'Reilly # # This library is free software; you can redistribute it and/or # modify it under the terms of the GNU Lesser General Public diff --git a/wicd/misc.py b/wicd/misc.py index 0c6dbaa..2d552fd 100644 --- a/wicd/misc.py +++ b/wicd/misc.py @@ -1,8 +1,13 @@ -""" Misc - miscellaneous functions for wicd """ +""" misc - miscellaneous functions for wicd + +This module contains a large variety of utility functions used +throughout wicd. + +""" # -# Copyright (C) 2007 - 2008 Adam Blackburn -# Copyright (C) 2007 - 2008 Dan O'Reilly +# Copyright (C) 2007 - 2009 Adam Blackburn +# Copyright (C) 2007 - 2009 Dan O'Reilly # # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License Version 2 as diff --git a/wicd/monitor.py b/wicd/monitor.py index 7333724..d47add5 100755 --- a/wicd/monitor.py +++ b/wicd/monitor.py @@ -8,8 +8,8 @@ when appropriate. """ # -# Copyright (C) 2007 - 2008 Adam Blackburn -# Copyright (C) 2007 - 2008 Dan O'Reilly +# Copyright (C) 2007 - 2009 Adam Blackburn +# Copyright (C) 2007 - 2009 Dan O'Reilly # # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License Version 2 as diff --git a/wicd/netentry.py b/wicd/netentry.py index a6e1919..6ccd36c 100644 --- a/wicd/netentry.py +++ b/wicd/netentry.py @@ -1,6 +1,13 @@ +""" netentry -- Network entry widgets for the GUI. + +This module provides GUI widgets used to represent wired and wireless +entries in the GUI's network list, as well as any settings dialogs +contained within them. + +""" # -# Copyright (C) 2007 Adam Blackburn -# Copyright (C) 2007 Dan O'Reilly +# Copyright (C) 2008-2009 Adam Blackburn +# Copyright (C) 2008-2009 Dan O'Reilly # # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License Version 2 as diff --git a/wicd/networking.py b/wicd/networking.py index 6f8e42e..084b8e3 100644 --- a/wicd/networking.py +++ b/wicd/networking.py @@ -19,9 +19,9 @@ class WiredConnectThread() -- Connection thread for wired """ # -# Copyright (C) 2007 - 2008 Adam Blackburn -# Copyright (C) 2007 - 2008 Dan O'Reilly -# Copyright (C) 2007 - 2008 Byron Hillis +# Copyright (C) 2007 - 2009 Adam Blackburn +# Copyright (C) 2007 - 2009 Dan O'Reilly +# Copyright (C) 2007 - 2009 Byron Hillis # # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License Version 2 as diff --git a/wicd/prefs.py b/wicd/prefs.py index d25267b..f511c42 100644 --- a/wicd/prefs.py +++ b/wicd/prefs.py @@ -1,6 +1,6 @@ #!/usr/bin/python -""" Wicd Preferences Dialog. +""" prefs -- Wicd Preferences Dialog. Displays the main settings dialog window for wicd and handles recieving/sendings the settings from/to the daemon. @@ -8,8 +8,8 @@ handles recieving/sendings the settings from/to the daemon. """ # -# Copyright (C) 2007 Adam Blackburn -# Copyright (C) 2007 Dan O'Reilly +# Copyright (C) 2008-2009 Adam Blackburn +# Copyright (C) 2008-2009 Dan O'Reilly # # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License Version 2 as diff --git a/wicd/suspend.py b/wicd/suspend.py index 217a655..e60f5c6 100755 --- a/wicd/suspend.py +++ b/wicd/suspend.py @@ -8,8 +8,8 @@ Used for when a laptop enters hibernation/suspension. """ # -# Copyright (C) 2007 - 2008 Adam Blackburn -# Copyright (C) 2007 - 2008 Dan O'Reilly +# Copyright (C) 2007 - 2009 Adam Blackburn +# Copyright (C) 2007 - 2009 Dan O'Reilly # # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License Version 2 as diff --git a/wicd/translations.py b/wicd/translations.py index 308d620..327951c 100644 --- a/wicd/translations.py +++ b/wicd/translations.py @@ -1,6 +1,7 @@ #!/usr/bin/env python # -* coding: utf-8 -*- +""" translations -- module for handling the translation strings for wicd. """ # # Copyright (C) 2007 - 2009 Adam Blackburn # Copyright (C) 2007 - 2009 Dan O'Reilly diff --git a/wicd/wicd-client.py b/wicd/wicd-client.py index 8cac87e..715de5a 100755 --- a/wicd/wicd-client.py +++ b/wicd/wicd-client.py @@ -14,14 +14,12 @@ class TrayIcon() -- Parent class of TrayIconGUI and IconConnectionInfo. class StatusTrayIconGUI() -- Implements the tray icon using a gtk.StatusIcon. class EggTrayIconGUI() -- Implements the tray icon using egg.trayicon. -def usage() -- Prints usage information. -def main() -- Runs the wicd frontend main loop. """ # -# Copyright (C) 2007 - 2008 Adam Blackburn -# Copyright (C) 2007 - 2008 Dan O'Reilly +# Copyright (C) 2007 - 2009 Adam Blackburn +# Copyright (C) 2007 - 2009 Dan O'Reilly # # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License Version 2 as @@ -464,7 +462,6 @@ class TrayIcon(object): signal_img = 'signal-25.png' return wpath.images + signal_img - @catchdbus def on_net_menu_activate(self, item): """ Trigger a background scan to populate the network menu. @@ -475,18 +472,20 @@ class TrayIcon(object): mousing past the menu to select another menu item. """ - def dummy(x=None): pass - if self._is_scanning: return True self.init_network_menu() - time.sleep(.4) + gobject.timeout_add(800, self._trigger_scan_if_needed, item) + + @catchdbus + def _trigger_scan_if_needed(self, item): while gtk.events_pending(): gtk.main_iteration() if item.state != gtk.STATE_PRELIGHT: - return True + return False wireless.Scan(False) + return False @catchdbus def populate_network_menu(self, data=None): @@ -535,7 +534,7 @@ class TrayIcon(object): net_menuitem.show() def init_network_menu(self): - """ Set the right-click menu for to the scanning state. """ + """ Set the right-click network menu to the scanning state. """ net_menuitem = self.manager.get_widget("/Menubar/Menu/Connect/") submenu = net_menuitem.get_submenu() self._clear_menu(submenu) @@ -592,6 +591,7 @@ class TrayIcon(object): if event.button == 1: self.toggle_wicd_gui() elif event.button == 3: + self._menu_just_opened = True self.init_network_menu() self.menu.popup(None, None, None, event.button, event.time) @@ -629,6 +629,7 @@ class TrayIcon(object): def on_popup_menu(self, status, button, timestamp): """ Opens the right click menu for the tray icon. """ + self._menu_just_opened = True self.init_network_menu() self.menu.popup(None, None, None, button, timestamp) diff --git a/wicd/wicd-daemon.py b/wicd/wicd-daemon.py index 6525f27..5344d9c 100644 --- a/wicd/wicd-daemon.py +++ b/wicd/wicd-daemon.py @@ -8,19 +8,16 @@ connection management, for both wireless and wired networks. The daemon must be run as root to control the networks, however the user interface components should be run as a normal user. -class LogWriter() -- Class to redirect stdout and stderr to a log file. -class ConnectionWizard() -- DBUS interface to manage the network. -class ConnectionStatus() -- Updates the current connection state -def usage() -- Print usage information. -def daemonize() -- Daemonize the current process with a double fork. -def main() -- The wicd daemon main loop. +class WicdDaemon() -- DBus interface to manage general wicd processes. +class WiredDaemon() -- DBus interface to managed the wired network. +class WirelessDaemon() -- DBus interface to managed the wireless network. """ # -# Copyright (C) 2007 - 2008 Adam Blackburn -# Copyright (C) 2007 - 2008 Dan O'Reilly -# Copyright (C) 2007 - 2008 Byron Hillis +# Copyright (C) 2007 - 2009 Adam Blackburn +# Copyright (C) 2007 - 2009 Dan O'Reilly +# Copyright (C) 2007 - 2009 Byron Hillis # # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License Version 2 as diff --git a/wicd/wnettools.py b/wicd/wnettools.py index 968d3be..52cdda6 100644 --- a/wicd/wnettools.py +++ b/wicd/wnettools.py @@ -6,18 +6,16 @@ This module implements functions to control and obtain information from network interfaces. -def SetDNS() -- Set the DNS servers of the system. -def GetWirelessInterfaces() -- Get the wireless interfaces available. -class Interface() -- Control a network interface. -class WiredInterface() -- Control a wired network interface. -class WirelessInterface() -- Control a wireless network interface. +class BaseInterface() -- Control a network interface. +class BaseWiredInterface() -- Control a wired network interface. +class BaseWirelessInterface() -- Control a wireless network interface. """ # -# Copyright (C) 2007 - 2008 Adam Blackburn -# Copyright (C) 2007 - 2008 Dan O'Reilly -# Copyright (C) 2007 - 2008 Byron Hillis +# Copyright (C) 2007 - 2009 Adam Blackburn +# Copyright (C) 2007 - 2009 Dan O'Reilly +# Copyright (C) 2007 - 2009 Byron Hillis # # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License Version 2 as From d09344b32908ed8e42f6e1bb990ab72e52afa0e1 Mon Sep 17 00:00:00 2001 From: Dan O'Reilly Date: Sun, 22 Mar 2009 18:39:44 -0400 Subject: [PATCH 022/186] Update docstrings. --- wicd/wicd-client.py | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/wicd/wicd-client.py b/wicd/wicd-client.py index 715de5a..dc363f5 100755 --- a/wicd/wicd-client.py +++ b/wicd/wicd-client.py @@ -465,11 +465,9 @@ class TrayIcon(object): def on_net_menu_activate(self, item): """ Trigger a background scan to populate the network menu. - Called when the network submenu is moused over. We - sleep briefly, clear pending gtk events, and if - we're still being moused over we trigger a scan. - This is to prevent scans when the user is just - mousing past the menu to select another menu item. + Clear the network menu, and schedule a method to be + called in .8 seconds to trigger a scan if the menu + is still being moused over. """ if self._is_scanning: @@ -480,6 +478,7 @@ class TrayIcon(object): @catchdbus def _trigger_scan_if_needed(self, item): + """ Trigger a scan if the network menu is being hovered over. """ while gtk.events_pending(): gtk.main_iteration() if item.state != gtk.STATE_PRELIGHT: From 8f263c16dc2693198ebc8d58042fdaf03c43c5ab Mon Sep 17 00:00:00 2001 From: Andrew Psaltis Date: Sun, 22 Mar 2009 19:25:19 -0400 Subject: [PATCH 023/186] Changed the clock in wicd-curses.py to update every 0.9 seconds. --- curses/wicd-curses.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/curses/wicd-curses.py b/curses/wicd-curses.py index 7d01658..7dcf8d4 100755 --- a/curses/wicd-curses.py +++ b/curses/wicd-curses.py @@ -218,7 +218,7 @@ def help_dialog(body): ('bold',' O'),": Set up Ad-hoc network\n", ('bold',' ->'),": Configure selected network\n", ('bold',' A'),": Display 'about' dialog\n", -('bold',' Q'),": Quit wicd-curses\n", +('bold',' F8 q Q'),": Quit wicd-curses\n", ]) textF = urwid.Text('Press any key to return.') @@ -1013,7 +1013,8 @@ def run(): gobject.idle_add(app.update_ui) # Update the connection status on the bottom every 1.5 s. gobject.timeout_add(2000,app.update_status) - gobject.timeout_add(1000,app.update_time) + # This will make sure that it is updated on the second. + gobject.timeout_add(900,app.update_time) # DEFUNCT: Terminate the loop if the UI is terminated. #gobject.idle_add(app.stop_loop) loop.run() From 066f4017756e6c500769cb9bc61105474aac2f93 Mon Sep 17 00:00:00 2001 From: Andrew Psaltis Date: Sun, 22 Mar 2009 21:00:40 -0400 Subject: [PATCH 024/186] Improved the timing in general. Decreased the clock update time to 500 ms. Ensured that the wheel when connecting doesn't alternate weirdly. Fixing this may also improve performance. --- curses/wicd-curses.py | 60 ++++++++++++++++++++++++++----------------- 1 file changed, 36 insertions(+), 24 deletions(-) diff --git a/curses/wicd-curses.py b/curses/wicd-curses.py index 7dcf8d4..33db5c6 100755 --- a/curses/wicd-curses.py +++ b/curses/wicd-curses.py @@ -702,6 +702,7 @@ class appGUI(): self.wiredCB.get_body().set_focus(wired.GetWiredProfileList().index(wired.GetDefaultWiredNetwork())) # Update the footer/status bar + conn_status = False @wrap_exceptions() def update_status(self): wired_connecting = wired.CheckIfWiredConnecting() @@ -709,26 +710,13 @@ class appGUI(): self.connecting = wired_connecting or wireless_connecting fast = not daemon.NeedsExternalCalls() - if self.connecting: - #self.lock_screen() - #if self.statusID: - # gobject.idle_add(self.status_bar.remove, 1, self.statusID) - if wireless_connecting: - if not fast: - iwconfig = wireless.GetIwconfig() - else: - iwconfig = '' - # set_status is rigged to return false when it is not - # connecting to anything, so this should work. - gobject.idle_add(self.set_status, wireless.GetCurrentNetwork(iwconfig) + - ': ' + - language[str(wireless.CheckWirelessConnectingMessage())], - True ) - if wired_connecting: - gobject.idle_add(self.set_status, language['wired_network'] + - ': ' + - language[str(wired.CheckWiredConnectingMessage())], - True) + if self.connecting: + if not self.conn_status: + #self.lock_screen() + #if self.statusID: + # gobject.idle_add(self.status_bar.remove, 1, self.statusID) + self.conn_status = True + gobject.idle_add(self.set_connecting_status,fast) return True else: if check_for_wired(wired.GetWiredIP(''),self.set_status): @@ -745,6 +733,29 @@ class appGUI(): self.update_ui() return True + def set_connecting_status(self,fast): + wired_connecting = wired.CheckIfWiredConnecting() + wireless_connecting = wireless.CheckIfWirelessConnecting() + if wireless_connecting: + if not fast: + iwconfig = wireless.GetIwconfig() + else: + iwconfig = '' + # set_status is rigged to return false when it is not + # connecting to anything, so this should work. + return self.set_status(wireless.GetCurrentNetwork(iwconfig) + + ': ' + + language[str(wireless.CheckWirelessConnectingMessage())], + True) + if wired_connecting: + return self.set_status( language['wired_network'] + + ': ' + + language[str(wired.CheckWiredConnectingMessage())], + True) + else: + self.conn_status=False + return False + # Cheap little indicator stating that we are actually connecting twirl = ['|','/','-','\\'] tcount = 0 # Counter for said indicator @@ -758,7 +769,8 @@ class appGUI(): if from_idle and not self.connecting: #self.update_netlist() self.update_status() - self.tcount = 0 + self.conn_status=False + #self.tcount = 0 #self.update_ui() return False toAppend = '' @@ -766,8 +778,8 @@ class appGUI(): # the wheel. if from_idle and self.connecting: # This is probably the wrong way to do this, but it works for now. - toAppend=self.twirl[self.tcount % 4] self.tcount+=1 + toAppend=self.twirl[self.tcount % 4] #self.footer2 = urwid.Columns([ # urwid.AttrWrap(urwid.Text(text+' '+toAppend),'important'), # ('fixed',8,urwid.Text(str(self.time),align='right'))]) @@ -1012,9 +1024,9 @@ def run(): # Update what the interface looks like as an idle function gobject.idle_add(app.update_ui) # Update the connection status on the bottom every 1.5 s. - gobject.timeout_add(2000,app.update_status) + gobject.timeout_add(1500,app.update_status) # This will make sure that it is updated on the second. - gobject.timeout_add(900,app.update_time) + gobject.timeout_add(500,app.update_time) # DEFUNCT: Terminate the loop if the UI is terminated. #gobject.idle_add(app.stop_loop) loop.run() From bb9d3690de47e207bc5c867b6b81ba2fff8440d1 Mon Sep 17 00:00:00 2001 From: Dan O'Reilly Date: Mon, 23 Mar 2009 01:28:50 -0400 Subject: [PATCH 025/186] Make the ioctl backends use of python-iwscan and python-wpactrl optional. Don't use __all__ in wnettools.py, and make the backends explicitly import the methods/classes they need from wnettools.py. --- wicd/backends/be-external.py | 19 ++++++++-------- wicd/backends/be-ioctl.py | 43 +++++++++++++++++++++++++----------- wicd/wnettools.py | 3 --- 3 files changed, 40 insertions(+), 25 deletions(-) diff --git a/wicd/backends/be-external.py b/wicd/backends/be-external.py index 9bd0fbb..daa8a08 100644 --- a/wicd/backends/be-external.py +++ b/wicd/backends/be-external.py @@ -31,7 +31,9 @@ class WirelessInterface() -- Control a wireless network interface. from wicd import misc from wicd import wnettools -from wicd.wnettools import * +from wicd.wnettools import GetDefaultGateway, GetWiredInterfaces, \ +GetWirelessInterfaces, IsValidWpaSuppDriver, BaseWirelessInterface, \ +BaseWiredInterface, BaseInterface import re import os import os.path @@ -53,11 +55,11 @@ RALINK_DRIVER = 'ralink legacy' def NeedsExternalCalls(*args, **kargs): - """ Return True, since this backend using iwconfig/ifconfig. """ + """ Return True, since this backend uses iwconfig/ifconfig. """ return True -class Interface(wnettools.BaseInterface): +class Interface(BaseInterface): """ Control a network interface. """ def __init__(self, iface, verbose=False): """ Initialize the object. @@ -67,11 +69,11 @@ class Interface(wnettools.BaseInterface): verbose -- whether to print every command run """ - wnettools.BaseInterface.__init__(self, iface, verbose) + BaseInterface.__init__(self, iface, verbose) self.Check() -class WiredInterface(Interface, wnettools.BaseWiredInterface): +class WiredInterface(Interface, BaseWiredInterface): """ Control a wired network interface. """ def __init__(self, iface, verbose=False): """ Initialise the wired network interface class. @@ -81,11 +83,11 @@ class WiredInterface(Interface, wnettools.BaseWiredInterface): verbose -- print all commands """ - wnettools.BaseWiredInterface.__init__(self, iface, verbose) + BaseWiredInterface.__init__(self, iface, verbose) Interface.__init__(self, iface, verbose) -class WirelessInterface(Interface, wnettools.BaseWirelessInterface): +class WirelessInterface(Interface, BaseWirelessInterface): """ Control a wireless network interface. """ def __init__(self, iface, verbose=False, wpa_driver='wext'): """ Initialise the wireless network interface class. @@ -95,7 +97,6 @@ class WirelessInterface(Interface, wnettools.BaseWirelessInterface): verbose -- print all commands """ - wnettools.BaseWirelessInterface.__init__(self, iface, verbose, - wpa_driver) + BaseWirelessInterface.__init__(self, iface, verbose, wpa_driver) Interface.__init__(self, iface, verbose) diff --git a/wicd/backends/be-ioctl.py b/wicd/backends/be-ioctl.py index fc9a278..868b47f 100644 --- a/wicd/backends/be-ioctl.py +++ b/wicd/backends/be-ioctl.py @@ -33,11 +33,23 @@ class WirelessInterface() -- Control a wireless network interface. from wicd import misc from wicd import wnettools from wicd import wpath -from wicd.wnettools import * +from wicd.wnettools import GetDefaultGateway, GetWiredInterfaces, \ +GetWirelessInterfaces, IsValidWpaSuppDriver, BaseWirelessInterface, \ +BaseWiredInterface, BaseInterface from wicd.wnettools import wep_pattern, signaldbm_pattern, neediface -import iwscan -import wpactrl +try: + import iwscan + IWSCAN_AVAIL = True +except ImportError: + print "WARNING: python-iwscan not found, falling back to using iwlist scan." + IWSCAN_AVAIL = False +try: + import wpactrl + WPACTRL_AVAIL = True +except ImportError: + print "WARNING: python-wpactrl not found, falling back to using wpa_cli." + WPACTRL_AVAIL = False import re import os @@ -56,7 +68,7 @@ This backend uses IOCTL calls and python libraries to query network information whenever possible. This makes it fast, but it may not work properly on all systems. -Dependencies: +(Optional) Dependencies: python-wpactrl (http://projects.otaku42.de/wiki/PythonWpaCtrl) python-iwscan (http://projects.otaku42.de/browser/python-iwscan/)""" @@ -105,7 +117,7 @@ def NeedsExternalCalls(*args, **kargs): return False -class Interface(wnettools.BaseInterface): +class Interface(BaseInterface): """ Control a network interface. """ def __init__(self, iface, verbose=False): """ Initialise the object. @@ -115,7 +127,7 @@ class Interface(wnettools.BaseInterface): verbose -- whether to print every command run """ - wnettools.BaseInterface.__init__(self, iface, verbose) + BaseInterface.__init__(self, iface, verbose) self.sock = socket.socket(socket.AF_INET, socket.SOCK_DGRAM) self.Check() @@ -162,7 +174,7 @@ class Interface(wnettools.BaseInterface): return bool(flags & 1) -class WiredInterface(Interface, wnettools.BaseWiredInterface): +class WiredInterface(Interface, BaseWiredInterface): """ Control a wired network interface. """ def __init__(self, iface, verbose=False): """ Initialise the wired network interface class. @@ -172,7 +184,7 @@ class WiredInterface(Interface, wnettools.BaseWiredInterface): verbose -- print all commands """ - wnettools.BaseWiredInterface.__init__(self, iface, verbose) + BaseWiredInterface.__init__(self, iface, verbose) Interface.__init__(self, iface, verbose) @neediface(False) @@ -240,7 +252,7 @@ class WiredInterface(Interface, wnettools.BaseWiredInterface): return bool(reg & 0x0004) -class WirelessInterface(Interface, wnettools.BaseWirelessInterface): +class WirelessInterface(Interface, BaseWirelessInterface): """ Control a wireless network interface. """ def __init__(self, iface, verbose=False, wpa_driver='wext'): """ Initialise the wireless network interface class. @@ -250,7 +262,7 @@ class WirelessInterface(Interface, wnettools.BaseWirelessInterface): verbose -- print all commands """ - wnettools.BaseWirelessInterface.__init__(self, iface, verbose, + BaseWirelessInterface.__init__(self, iface, verbose, wpa_driver) Interface.__init__(self, iface, verbose) self.scan_iface = None @@ -263,6 +275,10 @@ class WirelessInterface(Interface, wnettools.BaseWirelessInterface): A list containing available wireless networks. """ + if not IWSCAN_AVAIL: + # Use the slow version if python-iwscan isn't available. + return BaseWirelessInterface.GetNetworks(self) + if not self.scan_iface: try: self.scan_iface = iwscan.WirelessInterface(self.iface) @@ -361,9 +377,10 @@ class WirelessInterface(Interface, wnettools.BaseWirelessInterface): False otherwise. """ - error= "Unable to find ctrl_interface for wpa_supplicant. " + \ - "Could not validate authentication." - + if not WPACTRL_AVAIL: + # If we don't have python-wpactrl, use the slow version. + return BaseWirelessInterface.ValidateAuthentication(self, auth_time) + # Right now there's no way to do this for ralink drivers if self.wpa_driver == RALINK_DRIVER: return True diff --git a/wicd/wnettools.py b/wicd/wnettools.py index 52cdda6..f085206 100644 --- a/wicd/wnettools.py +++ b/wicd/wnettools.py @@ -72,9 +72,6 @@ blacklist_strict = '!"#$%&\'()*+,./:;<=>?@[\\]^`{|}~ ' blacklist_norm = ";`$!*|><&\\" blank_trans = maketrans("", "") -__all__ = ["GetDefaultGateway", "GetWiredInterfaces", - "GetWirelessInterfaces", "IsValidWpaSuppDriver"] - def _sanitize_string(string): if string: return translate(str(string), blank_trans, blacklist_norm) From ad09dea66e28acbdea0bab8bd24a8d64966145a2 Mon Sep 17 00:00:00 2001 From: Dan O'Reilly Date: Mon, 23 Mar 2009 01:30:16 -0400 Subject: [PATCH 026/186] Merge to import lines. --- wicd/backends/be-ioctl.py | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/wicd/backends/be-ioctl.py b/wicd/backends/be-ioctl.py index 868b47f..98c9aae 100644 --- a/wicd/backends/be-ioctl.py +++ b/wicd/backends/be-ioctl.py @@ -35,8 +35,7 @@ from wicd import wnettools from wicd import wpath from wicd.wnettools import GetDefaultGateway, GetWiredInterfaces, \ GetWirelessInterfaces, IsValidWpaSuppDriver, BaseWirelessInterface, \ -BaseWiredInterface, BaseInterface -from wicd.wnettools import wep_pattern, signaldbm_pattern, neediface +BaseWiredInterface, BaseInterface, wep_pattern, signaldbm_pattern, neediface try: import iwscan From 69585f203273657d2ea6e55b4ace647f879f566c Mon Sep 17 00:00:00 2001 From: Dan O'Reilly Date: Mon, 23 Mar 2009 17:53:59 -0400 Subject: [PATCH 027/186] Remove some unneeded imports. Remove unused variable. --- wicd/backends/be-external.py | 10 --------- wicd/backends/be-ioctl.py | 1 - wicd/wicd-client.py | 2 -- wicd/wnettools.py | 40 ++++++++++++++++++------------------ 4 files changed, 20 insertions(+), 33 deletions(-) diff --git a/wicd/backends/be-external.py b/wicd/backends/be-external.py index daa8a08..13f9303 100644 --- a/wicd/backends/be-external.py +++ b/wicd/backends/be-external.py @@ -29,17 +29,10 @@ class WirelessInterface() -- Control a wireless network interface. # along with this program. If not, see . # -from wicd import misc -from wicd import wnettools from wicd.wnettools import GetDefaultGateway, GetWiredInterfaces, \ GetWirelessInterfaces, IsValidWpaSuppDriver, BaseWirelessInterface, \ BaseWiredInterface, BaseInterface -import re -import os -import os.path -# Regular expressions for wpa_cli output -auth_patten = re.compile('.*wpa_state=(.*?)\n', wnettools.__re_mode) NAME = "external" UPDATE_INTERVAL = 5 DESCRIPTION = """External app (original) backend @@ -51,8 +44,6 @@ it doesn't require any third party libraries and may be more stable for some set ups. """ -RALINK_DRIVER = 'ralink legacy' - def NeedsExternalCalls(*args, **kargs): """ Return True, since this backend uses iwconfig/ifconfig. """ @@ -99,4 +90,3 @@ class WirelessInterface(Interface, BaseWirelessInterface): """ BaseWirelessInterface.__init__(self, iface, verbose, wpa_driver) Interface.__init__(self, iface, verbose) - diff --git a/wicd/backends/be-ioctl.py b/wicd/backends/be-ioctl.py index 98c9aae..ee7f95b 100644 --- a/wicd/backends/be-ioctl.py +++ b/wicd/backends/be-ioctl.py @@ -31,7 +31,6 @@ class WirelessInterface() -- Control a wireless network interface. # from wicd import misc -from wicd import wnettools from wicd import wpath from wicd.wnettools import GetDefaultGateway, GetWiredInterfaces, \ GetWirelessInterfaces, IsValidWpaSuppDriver, BaseWirelessInterface, \ diff --git a/wicd/wicd-client.py b/wicd/wicd-client.py index dc363f5..6c072a7 100755 --- a/wicd/wicd-client.py +++ b/wicd/wicd-client.py @@ -590,7 +590,6 @@ class TrayIcon(object): if event.button == 1: self.toggle_wicd_gui() elif event.button == 3: - self._menu_just_opened = True self.init_network_menu() self.menu.popup(None, None, None, event.button, event.time) @@ -628,7 +627,6 @@ class TrayIcon(object): def on_popup_menu(self, status, button, timestamp): """ Opens the right click menu for the tray icon. """ - self._menu_just_opened = True self.init_network_menu() self.menu.popup(None, None, None, button, timestamp) diff --git a/wicd/wnettools.py b/wicd/wnettools.py index f085206..35cb932 100644 --- a/wicd/wnettools.py +++ b/wicd/wnettools.py @@ -41,30 +41,30 @@ import misc from misc import find_path # Regular expressions. -__re_mode = (re.I | re.M | re.S) -essid_pattern = re.compile('.*ESSID:"?(.*?)"?\s*\n', __re_mode) -ap_mac_pattern = re.compile('.*Address: (.*?)\n', __re_mode) -channel_pattern = re.compile('.*Channel:? ?(\d\d?)', __re_mode) -strength_pattern = re.compile('.*Quality:?=? ?(\d+)\s*/?\s*(\d*)', __re_mode) -altstrength_pattern = re.compile('.*Signal level:?=? ?(\d+)\s*/?\s*(\d*)', __re_mode) -signaldbm_pattern = re.compile('.*Signal level:?=? ?(-\d\d*)', __re_mode) -bitrates_pattern = re.compile('.*Bit Rates:(.*?)E', __re_mode) -mode_pattern = re.compile('.*Mode:(.*?)\n', __re_mode) -freq_pattern = re.compile('.*Frequency:(.*?)\n', __re_mode) -wep_pattern = re.compile('.*Encryption key:(.*?)\n', __re_mode) -altwpa_pattern = re.compile('(wpa_ie)', __re_mode) -wpa1_pattern = re.compile('(WPA Version 1)', __re_mode) -wpa2_pattern = re.compile('(WPA2)', __re_mode) +_re_mode = (re.I | re.M | re.S) +essid_pattern = re.compile('.*ESSID:"?(.*?)"?\s*\n', _re_mode) +ap_mac_pattern = re.compile('.*Address: (.*?)\n', _re_mode) +channel_pattern = re.compile('.*Channel:? ?(\d\d?)', _re_mode) +strength_pattern = re.compile('.*Quality:?=? ?(\d+)\s*/?\s*(\d*)', _re_mode) +altstrength_pattern = re.compile('.*Signal level:?=? ?(\d+)\s*/?\s*(\d*)', _re_mode) +signaldbm_pattern = re.compile('.*Signal level:?=? ?(-\d\d*)', _re_mode) +bitrates_pattern = re.compile('.*Bit Rates:(.*?)E', _re_mode) +mode_pattern = re.compile('.*Mode:(.*?)\n', _re_mode) +freq_pattern = re.compile('.*Frequency:(.*?)\n', _re_mode) +wep_pattern = re.compile('.*Encryption key:(.*?)\n', _re_mode) +altwpa_pattern = re.compile('(wpa_ie)', _re_mode) +wpa1_pattern = re.compile('(WPA Version 1)', _re_mode) +wpa2_pattern = re.compile('(WPA2)', _re_mode) #iwconfig-only regular expressions. -ip_pattern = re.compile(r'inet [Aa]d?dr[^.]*:([^.]*\.[^.]*\.[^.]*\.[0-9]*)',re.S) -bssid_pattern = re.compile('.*Access Point: (([0-9A-Z]{2}:){5}[0-9A-Z]{2})', __re_mode) -bitrate_pattern = re.compile('.*Bit Rate=(.*?/s)', __re_mode) -opmode_pattern = re.compile('.*Mode:(.*?) ', __re_mode) -authmethods_pattern = re.compile('.*Authentication capabilities :\n(.*?)Current', __re_mode) +ip_pattern = re.compile(r'inet [Aa]d?dr[^.]*:([^.]*\.[^.]*\.[^.]*\.[0-9]*)', re.S) +bssid_pattern = re.compile('.*Access Point: (([0-9A-Z]{2}:){5}[0-9A-Z]{2})', _re_mode) +bitrate_pattern = re.compile('.*Bit Rate=(.*?/s)', _re_mode) +opmode_pattern = re.compile('.*Mode:(.*?) ', _re_mode) +authmethods_pattern = re.compile('.*Authentication capabilities :\n(.*?)Current', _re_mode) # Regular expressions for wpa_cli output -auth_pattern = re.compile('.*wpa_state=(.*?)\n', __re_mode) +auth_pattern = re.compile('.*wpa_state=(.*?)\n', _re_mode) RALINK_DRIVER = 'ralink legacy' From 8679831f0bdc282254e451ee06ab424aac53b1eb Mon Sep 17 00:00:00 2001 From: Andrew Psaltis Date: Tue, 24 Mar 2009 08:12:07 -0400 Subject: [PATCH 028/186] Made the help in wicd-curses.py all read out on one line. per entry --- curses/wicd-curses.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/curses/wicd-curses.py b/curses/wicd-curses.py index 33db5c6..a9f3ec5 100755 --- a/curses/wicd-curses.py +++ b/curses/wicd-curses.py @@ -208,7 +208,7 @@ def help_dialog(body): ('bold',' H h ?'),": Display this help dialog\n", ('bold','enter C'),": Connect to selected network\n", ('bold',' D'),": Disconnect from all networks\n", -('bold',' ESC'),": Stop a network connection in progress\n", +('bold',' ESC'),": Stop a connection in progress\n", ('bold',' F5 R'),": Refresh network list\n", ('bold',' P'),": Prefrences dialog\n", ]) From 444601673439f8cf876450790e6031c30d3420bd Mon Sep 17 00:00:00 2001 From: Andrew Psaltis Date: Wed, 25 Mar 2009 12:36:57 -0400 Subject: [PATCH 029/186] Various fixes. curses/curses_misc.py: Simplified changing the "arrow" on the ComboBox, if I decide to do so. curses/prefs_curses.py: Added a docstring curses/wicd-curses.py: 'q' or 'Q' quits a dialog without saving now. Fixed a bug where a scan run while a dialog is up would lock the screen and half-close the dialog when it is done. --- curses/curses_misc.py | 7 ++++--- curses/prefs_curses.py | 2 ++ curses/wicd-curses.py | 15 +++++++++++++-- 3 files changed, 19 insertions(+), 5 deletions(-) diff --git a/curses/curses_misc.py b/curses/curses_misc.py index f2d1ba0..d213b72 100644 --- a/curses/curses_misc.py +++ b/curses/curses_misc.py @@ -316,6 +316,7 @@ class ComboBox(urwid.WidgetWrap): user_args : user_args in the callback """ + self.DOWN_ARROW = ' vvv' self.label = urwid.Text(label) self.attrs = attrs self.focus_attr = focus_attr @@ -325,7 +326,7 @@ class ComboBox(urwid.WidgetWrap): self.overlay = None #w,sensitive=True,attrs=('editbx','editnfc'),focus_attr='editfc') - self.cbox = DynWrap(SelText(' vvv'),attrs=attrs,focus_attr=focus_attr) + self.cbox = DynWrap(SelText(self.DOWN_ARROW),attrs=attrs,focus_attr=focus_attr) # Unicode will kill me sooner or later. ^_^ if label != '': w = urwid.Columns([('fixed',len(str),self.label),self.cbox],dividechars=1) @@ -351,7 +352,7 @@ class ComboBox(urwid.WidgetWrap): def set_focus(self,index): self.focus = index - self.cbox.set_w(SelText(self.list[index]+' vvv')) + self.cbox.set_w(SelText(self.list[index]+self.DOWN_ARROW)) if self.overlay: self.overlay._listbox.set_focus(index) @@ -360,7 +361,7 @@ class ComboBox(urwid.WidgetWrap): def build_combobox(self,parent,ui,row): str,trash = self.label.get_text() - self.cbox = DynWrap(SelText([self.list[self.focus]+' vvv']), + self.cbox = DynWrap(SelText([self.list[self.focus]+self.DOWN_ARROW]), attrs=self.attrs,focus_attr=self.focus_attr) if str != '': w = urwid.Columns([('fixed',len(str),self.label),self.cbox], diff --git a/curses/prefs_curses.py b/curses/prefs_curses.py index b220597..45a2d86 100644 --- a/curses/prefs_curses.py +++ b/curses/prefs_curses.py @@ -1,5 +1,7 @@ #!/usr/bin/env python +"""prefs_curses.py -- Pretty, tabbable, console preferences dialog""" + # Copyright (C) 2008-2009 Andrew Psaltis # This program is free software; you can redistribute it and/or modify diff --git a/curses/wicd-curses.py b/curses/wicd-curses.py index a9f3ec5..ed8c01b 100755 --- a/curses/wicd-curses.py +++ b/curses/wicd-curses.py @@ -581,6 +581,7 @@ class appGUI(): self.prev_state = False self.connecting = False self.screen_locked = False + self.do_diag_lock = False self.pref = None @@ -602,11 +603,17 @@ class appGUI(): # Does what it says it does def lock_screen(self): + if self.diag: + self.do_diag_lock = True + return True self.frame.set_body(self.screen_locker) self.screen_locked = True self.update_ui() def unlock_screen(self): + if self.do_diag_lock: + self.do_diag_lock = False + return True self.update_netlist(force_check=True) self.frame.set_body(self.thePile) self.screen_locked = False @@ -810,7 +817,11 @@ class appGUI(): self.lock_screen() def restore_primary(self): - self.frame.set_body(self.thePile) + if self.do_diag_lock: + self.frame.set_body(self.screen_locker) + self.do_diag_lock = False + else: + self.frame.set_body(self.thePile) self.diag = None self.frame.set_footer(urwid.Pile([self.primaryCols,self.footer2])) self.update_ui() @@ -916,7 +927,7 @@ class appGUI(): focus=True) continue if self.diag: - if k == 'esc': + if k == 'esc' or k == 'q' or k == 'Q': self.restore_primary() break if k == 'meta enter': From d7f2fd47808e7b84f23e0d12231c06294153a30f Mon Sep 17 00:00:00 2001 From: Dan O'Reilly Date: Wed, 25 Mar 2009 20:19:11 -0400 Subject: [PATCH 030/186] Add a workaround for an issue where large integers got mishandled by python-dbus on 64-bit systems. Fix potential issue if encryption key is a number Close all open fd's in the daemonize code. --- wicd/configmanager.py | 7 + wicd/wicd-daemon.py | 316 ++++++++++++++++++++++-------------------- wicd/wnettools.py | 2 +- 3 files changed, 172 insertions(+), 153 deletions(-) diff --git a/wicd/configmanager.py b/wicd/configmanager.py index 19da2bc..9426e53 100644 --- a/wicd/configmanager.py +++ b/wicd/configmanager.py @@ -28,6 +28,7 @@ from ConfigParser import RawConfigParser from wicd.misc import Noneify, to_unicode +from dbus import Int32 class ConfigManager(RawConfigParser): """ A class that can be used to manage a given configuration file. """ @@ -108,6 +109,12 @@ class ConfigManager(RawConfigParser): ret = int(ret) except (ValueError, TypeError): ret = Noneify(ret) + # This is a workaround for a python-dbus issue on 64-bit systems. + if isinstance(ret, (int)): + try: + Int32(ret) + except OverflowError: + ret = long(ret) return ret def get(self, *args, **kargs): diff --git a/wicd/wicd-daemon.py b/wicd/wicd-daemon.py index 5344d9c..1daa5be 100644 --- a/wicd/wicd-daemon.py +++ b/wicd/wicd-daemon.py @@ -58,7 +58,7 @@ from wicd.configmanager import ConfigManager if __name__ == '__main__': wpath.chdir(__file__) - + misc.RenameProcess("wicd") wireless_conf = wpath.etc + "wireless-settings.conf" @@ -66,11 +66,11 @@ wired_conf = wpath.etc + "wired-settings.conf" class WicdDaemon(dbus.service.Object): """ The main wicd daemon class. - + This class mostly contains exported DBus methods that are not associated directly with either wired or wireless actions. There are a few exceptions to this, due to architectural limitations. - + """ def __init__(self, bus_name, object_path="/org/wicd/daemon", auto_connect=True): @@ -99,40 +99,40 @@ class WicdDaemon(dbus.service.Object): self.link_detect_tool = 0 self.flush_tool = 0 self.sudo_app = 0 - + # This will speed up the scanning process - if a client doesn't # need a fresh scan, just feed them the old one. A fresh scan # can be done by calling Scan(fresh=True). self.LastScan = [] - + # Load the config file self.ReadConfig() - + signal.signal(signal.SIGTERM, self.DaemonClosing) self.DaemonStarting() - + # Scan since we just got started if not auto_connect: print "--no-autoconnect detected, not autoconnecting..." self.SetForcedDisconnect(True) self.wireless_bus.Scan() - + def get_debug_mode(self): return self._debug_mode def set_debug_mode(self, mode): self._debug_mode = mode self.config.debug = mode debug_mode = property(get_debug_mode, set_debug_mode) - + @dbus.service.method('org.wicd.daemon') def Hello(self): """ Returns the version number. - + This number is major-minor-micro. Major is only incremented if minor reaches > 9. Minor is incremented if changes that break core stucture are implemented. Micro is for everything else, and micro may be anything >= 0. This number is effective starting wicd v1.2.0. - + """ return wpath.version @@ -196,7 +196,7 @@ class WicdDaemon(dbus.service.Object): print 'domain is %s' % dns_dom print 'search domain is %s' % search_dom self.config.write() - + @dbus.service.method('org.wicd.daemon') def SetBackend(self, backend): """ Sets a new backend. """ @@ -207,32 +207,32 @@ class WicdDaemon(dbus.service.Object): self.wifi.LoadBackend(backend) self.wired.LoadBackend(backend) self.SetSuspend(False) - + @dbus.service.method('org.wicd.daemon') def GetCurrentBackend(self): """ Returns the currently loaded backend. """ return networking.get_current_backend() - + @dbus.service.method('org.wicd.daemon') def GetBackendUpdateInterval(self): """ Returns status update interval for the loaded backend. """ return networking.get_backend_update_interval() - + @dbus.service.method('org.wicd.daemon') def GetBackendDescription(self, backend_name): """ Returns the description of the given backend. """ return networking.get_backend_description(backend_name) - + @dbus.service.method('org.wicd.daemon') def GetBackendDescriptionDict(self): """ Returns a dict of all backend names mapped to their description. """ return networking.get_backend_description_dict() - + @dbus.service.method('org.wicd.daemon') def GetSavedBackend(self): """ Returns the backend saved to disk. """ return self.config.get("Settings", "backend") - + @dbus.service.method('org.wicd.daemon') def GetBackendList(self): """ Returns a list of all backends available. """ @@ -257,7 +257,7 @@ class WicdDaemon(dbus.service.Object): def GetWirelessInterface(self): """ Returns the wireless interface the daemon is using. """ return str(self.wifi.wireless_interface) - + @dbus.service.method('org.wicd.daemon') def NeedsExternalCalls(self): """ Returns true if the loaded backend needs external calls. """ @@ -297,7 +297,7 @@ class WicdDaemon(dbus.service.Object): return (signal + " dBm") else: return (signal + "%") - + @dbus.service.method('org.wicd.daemon') def SetSuspend(self, val): """ Toggles whether or not monitoring connection status is suspended """ @@ -315,7 +315,7 @@ class WicdDaemon(dbus.service.Object): @dbus.service.method('org.wicd.daemon') def AutoConnect(self, fresh): """ Attempts to autoconnect to a wired or wireless network. - + Autoconnect will first try to connect to a wired network, if that fails it tries a wireless connection. @@ -347,11 +347,11 @@ class WicdDaemon(dbus.service.Object): @dbus.service.method('org.wicd.daemon') def SetAutoReconnect(self, value): """ Sets the value of self.auto_reconnect. - + If True, wicd will try to reconnect as soon as it detects that an internet connection is lost. If False, it will do nothing, and wait for the user to initiate reconnection. - + """ print 'setting automatically reconnect when connection drops %s' % value self.config.set("Settings", "auto_reconnect", misc.to_bool(value), @@ -373,7 +373,7 @@ class WicdDaemon(dbus.service.Object): return True else: return False - + @dbus.service.method('org.wicd.daemon') def CancelConnect(self): """ Cancels the wireless connection attempt """ @@ -391,12 +391,12 @@ class WicdDaemon(dbus.service.Object): self.wired.ReleaseDHCP() self.wired.KillDHCP() self.wired.connecting_thread.connect_result = 'aborted' - + @dbus.service.method('org.wicd.daemon') def GetCurrentInterface(self): """ Returns the active interface """ return self.current_interface - + @dbus.service.method('org.wicd.daemon') def SetCurrentInterface(self, iface): """ Sets the current active interface """ @@ -405,15 +405,15 @@ class WicdDaemon(dbus.service.Object): @dbus.service.method('org.wicd.daemon') def SetNeedWiredProfileChooser(self, val): """ Sets the need_wired_profile_chooser variable. - + If set to True, that alerts the wicd frontend to display the chooser, if False the frontend will do nothing. This function is only needed when the frontend starts up, to determine if the chooser was requested before the frontend was launched. - + """ self.need_profile_chooser = misc.to_bool(val) - + @dbus.service.method('org.wicd.daemon') def ShouldAutoReconnect(self): """ Returns True if it's the right time to try autoreconnecting. """ @@ -432,15 +432,15 @@ class WicdDaemon(dbus.service.Object): @dbus.service.method('org.wicd.daemon') def SetForcedDisconnect(self, value): """ Sets the forced_disconnect status. - + Set to True when a user manually disconnects or cancels a connection. It gets set to False as soon as the connection process is manually started. - + """ if self.debug_mode and value: print "Forced disconnect on" self.forced_disconnect = bool(value) - + @dbus.service.method('org.wicd.daemon') def GetSignalDisplayType(self): """ Returns the signal display type. @@ -451,14 +451,13 @@ class WicdDaemon(dbus.service.Object): """ return int(self.signal_display_type) - - + @dbus.service.method('org.wicd.daemon') def SetSignalDisplayType(self, value): """ Sets the signal display type and writes it the wicd config file. """ self.config.set("Settings", "signal_display_type", value, write=True) self.signal_display_type = int(value) - + @dbus.service.method('org.wicd.daemon') def GetGUIOpen(self): """ Returns the value of gui_open. @@ -467,21 +466,21 @@ class WicdDaemon(dbus.service.Object): of the state of the wicd GUI. If the GUI is open, wicd will not try to automatically reconnect to networks, as this behavior can be annoying for the user while trying to use the GUI. - + NOTE: It's possible for this to become out of sync, particularly if the wicd.py is not exited properly while the GUI is open. We should probably implement some kind of pid system to do it properly. - + ANOTHER NOTE: This isn't used by anything yet! - + """ return bool(self.gui_open) - + @dbus.service.method('org.wicd.daemon') def SetGUIOpen(self, val): """ Sets the value of gui_open. """ self.gui_open = bool(val) - + @dbus.service.method('org.wicd.daemon') def SetAlwaysShowWiredInterface(self, value): """ Sets always_show_wired_interface to the given value. """ @@ -493,7 +492,7 @@ class WicdDaemon(dbus.service.Object): def GetAlwaysShowWiredInterface(self): """ Returns always_show_wired_interface """ return bool(self.always_show_wired_interface) - + @dbus.service.method('org.wicd.daemon') def SetWiredAutoConnectMethod(self, method): """ Sets which method to use to autoconnect to wired networks. """ @@ -509,34 +508,34 @@ class WicdDaemon(dbus.service.Object): def GetWiredAutoConnectMethod(self): """ Returns the wired autoconnect method. """ return int(self.wired_connect_mode) - + @dbus.service.method('org.wicd.daemon') def GetPreferWiredNetwork(self): """ Returns True if wired network preference is set. - + If this is True, wicd will switch from a wireless connection to a wired one if an ethernet connection is available. - + """ return self.prefer_wired - + @dbus.service.method('org.wicd.daemon') def SetPreferWiredNetwork(self, value): """ Sets the prefer_wired state. """ self.config.set("Settings", "prefer_wired", bool(value), write=True) self.prefer_wired = bool(value) - + @dbus.service.method('org.wicd.daemon') def SetConnectionStatus(self, state, info): """ Sets the connection status. - + Keyword arguments: state - An int representing the state of the connection as defined in misc.py. - + info - a list of strings containing data about the connection state. The contents of this list are dependent on the connection state. - + state - info contents: NOT_CONNECTED - info[0] = "" CONNECTING - info[0] = "wired" or "wireless" @@ -547,32 +546,32 @@ class WicdDaemon(dbus.service.Object): info[2] = signal strength info[3] = internal networkid SUSPENDED - info[0] = "" - - + + """ self.connection_state = state self.connection_info = info - + @dbus.service.method('org.wicd.daemon', out_signature='(uas)') def GetConnectionStatus(self): """ Returns the current connection state in list form. - + See SetConnectionStatus for more information about the data structure being returned. - + """ return [self.connection_state, self.connection_info] @dbus.service.method('org.wicd.daemon') def GetNeedWiredProfileChooser(self): """ Returns need_profile_chooser. - + Returns a boolean specifying if the wired profile chooser needs to be launched. - + """ return bool(self.need_profile_chooser) - + @dbus.service.method("org.wicd.daemon") def GetAppAvailable(self, app): """ Determine if a given application is available.""" @@ -581,18 +580,18 @@ class WicdDaemon(dbus.service.Object): @dbus.service.method('org.wicd.daemon') def GetDHCPClient(self): """ Returns the current DHCP client constant. - + See misc.py for a definition of the constants. - + """ return self.dhcp_client - + @dbus.service.method('org.wicd.daemon') def SetDHCPClient(self, client): """ Sets the DHCP client constant. - + See misc.py for a definition of the constants. - + """ print "Setting dhcp client to %i" % (int(client)) self.dhcp_client = int(client) @@ -608,13 +607,13 @@ class WicdDaemon(dbus.service.Object): @dbus.service.method('org.wicd.daemon') def SetLinkDetectionTool(self, link_tool): """ Sets the link detection tool. - + Sets the value of the tool wicd should use to detect if a cable is plugged in. If using a backend that doesn't use an external call to get this information (such as ioctl) it will instead use the ioctls provided by the specified tool to query for link status. - + """ self.link_detect_tool = int(link_tool) self.wired.link_detect = int(link_tool) @@ -628,11 +627,11 @@ class WicdDaemon(dbus.service.Object): @dbus.service.method('org.wicd.daemon') def SetFlushTool(self, flush_tool): """ Sets the flush tool. - + Sets the value of the tool wicd should use to flush routing tables. The value is associated with a particular tool, as specified in misc.py - + """ self.flush_tool = int(flush_tool) self.wired.flush_tool = int(flush_tool) @@ -643,21 +642,21 @@ class WicdDaemon(dbus.service.Object): def GetSudoApp(self): """ Get the preferred sudo app. """ return self.sudo_app - + @dbus.service.method('org.wicd.daemon') def SetSudoApp(self, sudo_app): """ Set the preferred sudo app. """ self.sudo_app = sudo_app self.config.set("Settings", "sudo_app", sudo_app, write=True) - + @dbus.service.method('org.wicd.daemon') def WriteWindowSize(self, width, height, win_name): """ Write the desired default window size. - + win_name should be either 'main' or 'pref', and specifies whether the size being given applies to the main GUI window or the preferences dialog window. - + """ if win_name == "main": height_str = "window_height" @@ -669,14 +668,14 @@ class WicdDaemon(dbus.service.Object): self.config.set("Settings", width_str, width) self.config.set("Settings", height_str, height) self.config.write() - + @dbus.service.method('org.wicd.daemon') def ReadWindowSize(self, win_name): """Returns a list containing the desired default window size - + Attempts to read the default size from the config file, and if that fails, returns a default of 605 x 400. - + """ if win_name == "main": default_width = -1 @@ -692,12 +691,12 @@ class WicdDaemon(dbus.service.Object): width = self.config.get("Settings", width_str, default=default_width) height = self.config.get("Settings", height_str, default=default_height) self.config.write() - + size = [] size.append(int(width)) size.append(int(height)) return size - + def _wired_autoconnect(self, fresh=True): """ Attempts to autoconnect to a wired network. """ wiredb = self.wired_bus @@ -711,7 +710,7 @@ class WicdDaemon(dbus.service.Object): not self.GetNeedWiredProfileChooser(): self.LaunchChooser() return True - + # Default Profile. elif self.GetWiredAutoConnectMethod() == 1: network = wiredb.GetDefaultWiredNetwork() @@ -748,7 +747,7 @@ class WicdDaemon(dbus.service.Object): Helper method called on a timer that monitors a wired connection attempt and makes decisions about what to do next based on the result. - + """ wiredb = self.wired_bus if wiredb.CheckIfWiredConnecting(): @@ -761,7 +760,7 @@ class WicdDaemon(dbus.service.Object): return False self.auto_connecting = False return False - + @dbus.service.method("org.wicd.daemon") def ConnectResultsAvailable(self): if ((self.wired.connecting_thread and self.wired.connecting_thread.connect_result) or @@ -769,12 +768,12 @@ class WicdDaemon(dbus.service.Object): return True else: return False - + @dbus.service.method("org.wicd.daemon") def SendConnectResultsIfAvail(self): if self.ConnectResultsAvailable(): self.SendConnectResult() - + @dbus.service.method("org.wicd.daemon") def SendConnectResult(self): if self.wired.connecting_thread and self.wired.connecting_thread.connect_result: @@ -783,32 +782,32 @@ class WicdDaemon(dbus.service.Object): elif self.wifi.connecting_thread and self.wifi.connecting_thread.connect_result: self.ConnectResultsSent(self.wifi.connecting_thread.connect_result) self.wifi.connecting_thread.connect_result = "" - + @dbus.service.signal(dbus_interface="org.wicd.daemon",signature='s') def ConnectResultsSent(self, result): print "Sending connection attempt result %s" % result - + @dbus.service.method("org.wicd.daemon") @dbus.service.signal(dbus_interface="org.wicd.daemon", signature='') def UpdateState(self): pass - + @dbus.service.signal(dbus_interface='org.wicd.daemon', signature='') def LaunchChooser(self): """ Emits the wired profile chooser dbus signal. """ print 'calling wired profile chooser' self.SetNeedWiredProfileChooser(True) - + @dbus.service.signal(dbus_interface="org.wicd.daemon", signature='') def DaemonStarting(self): """ Emits a signa indicating the daemon is starting. """ pass - + @dbus.service.signal(dbus_interface='org.wicd.daemon', signature='') def DaemonClosing(self): """ Emits a signal indicating the daemon will be closing. """ pass - + @dbus.service.method('org.wicd.daemon', in_signature='uav') def EmitStatusChanged(self, state, info): """ Calls the StatusChanged signal method. """ @@ -817,19 +816,19 @@ class WicdDaemon(dbus.service.Object): @dbus.service.signal(dbus_interface='org.wicd.daemon', signature='uav') def StatusChanged(self, state, info): """ Emits a "status changed" dbus signal. - + This D-Bus signal is emitted when the connection status changes. This signal can be hooked to monitor the network state. - + """ pass - + def ReadConfig(self): """ Reads the manager-settings.conf file. - + Reads the manager-settings.conf file and loads the stored values into memory. - + """ b_wired = self.wired_bus b_wifi = self.wireless_bus @@ -837,7 +836,7 @@ class WicdDaemon(dbus.service.Object): # Load the backend. be_def = 'external' self.SetBackend(app_conf.get("Settings", "backend", default=be_def)) - + # Load network interfaces. iface = self.wireless_bus.DetectWirelessInterface() if not iface: iface = 'wlan0' @@ -847,7 +846,7 @@ class WicdDaemon(dbus.service.Object): if not iface: iface = 'eth0' self.SetWiredInterface(app_conf.get("Settings", "wired_interface", default=iface)) - + self.SetWPADriver(app_conf.get("Settings", "wpa_driver", default="wext")) self.SetAlwaysShowWiredInterface(app_conf.get("Settings", "always_show_wired_interface", @@ -906,11 +905,11 @@ class WicdDaemon(dbus.service.Object): print "Using wireless interface..." + self.GetWirelessInterface() print "Using wired interface..." + self.GetWiredInterface() - + ############################## ###### Wireless Daemon ####### ############################## - + class WirelessDaemon(dbus.service.Object): """ DBus interface for wireless connection operations. """ def __init__(self, bus_name, daemon, wifi=None, debug=False): @@ -926,29 +925,29 @@ class WirelessDaemon(dbus.service.Object): self.config = ConfigManager(os.path.join(wpath.etc, "wireless-settings.conf"), debug=debug) - + def get_debug_mode(self): return self._debug_mode def set_debug_mode(self, mode): self._debug_mode = mode self.config.debug = mode debug_mode = property(get_debug_mode, set_debug_mode) - + @dbus.service.method('org.wicd.daemon.wireless') def SetHiddenNetworkESSID(self, essid): """ Sets the ESSID of a hidden network for use with Scan(). """ self.hidden_essid = str(misc.Noneify(essid)) - + @dbus.service.method('org.wicd.daemon.wireless') def Scan(self, sync=False): """ Scan for wireless networks. - + Scans for wireless networks, optionally using a (hidden) essid set with SetHiddenNetworkESSID. - + The sync keyword argument specifies whether the scan should be done synchronously. - + """ if self._scanning: if self.debug_mode: @@ -962,12 +961,12 @@ class WirelessDaemon(dbus.service.Object): else: self._async_scan() return True - + @misc.threaded def _async_scan(self): """ Run a scan in its own thread. """ self._sync_scan() - + def _sync_scan(self): """ Run a scan and send a signal when its finished. """ scan = self.wifi.Scan(str(self.hidden_essid)) @@ -988,7 +987,7 @@ class WirelessDaemon(dbus.service.Object): def GetNumberOfNetworks(self): """ Returns number of networks. """ return len(self.LastScan) - + @dbus.service.method('org.wicd.daemon.wireless') def GetApBssid(self): """ Gets the MAC address for the active network. """ @@ -1037,7 +1036,7 @@ class WirelessDaemon(dbus.service.Object): # We don't write script settings here. if (property.strip()).endswith("script"): print "Setting script properties through the daemon is not" \ - + " permitted." + + " permitted." return False self.LastScan[networkid][property] = misc.Noneify(value) @@ -1050,7 +1049,7 @@ class WirelessDaemon(dbus.service.Object): else: print "Couldn't detect a wireless interface." return str(iface) - + @dbus.service.method('org.wicd.daemon.wireless') def DisconnectWireless(self): """ Disconnects the wireless network. """ @@ -1102,13 +1101,13 @@ class WirelessDaemon(dbus.service.Object): """ Calls a method to enable the wireless interface. """ result = self.wifi.EnableInterface() return result - + @dbus.service.method('org.wicd.daemon.wireless') def DisableWirelessInterface(self): """ Calls a method to disable the wireless interface. """ result = self.wifi.DisableInterface() return result - + @dbus.service.method('org.wicd.daemon.wireless') def ConnectWireless(self, id): """ Connects the the wireless network specified by i""" @@ -1118,7 +1117,7 @@ class WirelessDaemon(dbus.service.Object): self.wifi.before_script = self.GetWirelessProperty(id, 'beforescript') self.wifi.after_script = self.GetWirelessProperty(id, 'afterscript') self.wifi.disconnect_script = self.GetWirelessProperty(id, - 'disconnectscript') + 'disconnectscript') print 'Connecting to wireless network ' + self.LastScan[id]['essid'] self.daemon.wired_bus.wired.Disconnect() self.daemon.SetForcedDisconnect(False) @@ -1153,14 +1152,14 @@ class WirelessDaemon(dbus.service.Object): return stat else: return False - + @dbus.service.method('org.wicd.daemon.wireless') def ReadWirelessNetworkProfile(self, id): """ Reads in wireless profile as the active network """ cur_network = self.LastScan[id] essid_key = "essid:%s" % cur_network["essid"] bssid_key = cur_network["bssid"] - + if self.config.get(essid_key, 'use_settings_globally'): section = essid_key elif self.config.has_section(bssid_key): @@ -1168,7 +1167,7 @@ class WirelessDaemon(dbus.service.Object): else: cur_network["has_profile"] = False return "500: Profile Not Found" - + cur_network["has_profile"] = True # Read the essid because we need to name those hidden @@ -1184,7 +1183,7 @@ class WirelessDaemon(dbus.service.Object): 'use_settings_globally']: cur_network[option] = bool(cur_network.get(option)) return "100: Loaded Profile" - + @dbus.service.method('org.wicd.daemon.wireless') def SaveWirelessNetworkProfile(self, id): """ Writes a wireless profile to disk. """ @@ -1198,7 +1197,7 @@ class WirelessDaemon(dbus.service.Object): self.config.remove_section(bssid_key) self.config.add_section(bssid_key) - + # We want to write the essid in addition to bssid # sections if global settings are enabled. if cur_network["use_settings_globally"]: @@ -1209,16 +1208,16 @@ class WirelessDaemon(dbus.service.Object): self.config.set(bssid_key, x, cur_network[x]) if cur_network["use_settings_globally"]: self.config.set(essid_key, x, cur_network[x]) - + write_script_ent(bssid_key, "beforescript") write_script_ent(bssid_key, "afterscript") write_script_ent(bssid_key, "disconnectscript") - + if cur_network["use_settings_globally"]: write_script_ent(essid_key, "beforescript") write_script_ent(essid_key, "afterscript") write_script_ent(essid_key, "disconnectscript") - + self.config.write() @dbus.service.method('org.wicd.daemon.wireless') @@ -1231,40 +1230,40 @@ class WirelessDaemon(dbus.service.Object): config = self.config cur_network = self.LastScan[id] essid_key = "essid:" + cur_network["essid"] - + config.set(cur_network["bssid"], option, str(cur_network[option])) # Write the global section as well, if required. if config.get(essid_key, 'use_settings_globally'): config.set(essid_key, option, str(cur_network[option])) config.write() - + @dbus.service.method('org.wicd.daemon.wireless') def RemoveGlobalEssidEntry(self, networkid): """ Removes the global entry for the networkid provided. """ essid_key = "essid:" + str(self.LastScan[networkid]) self.config.remove_section(essid_key) - + @dbus.service.method('org.wicd.daemon.wireless') def GetWpaSupplicantDrivers(self, drivers): """ Returns all valid wpa_supplicant drivers in a given list. """ return self.wifi.GetWpaSupplicantDrivers(drivers) - + @dbus.service.method('org.wicd.daemon.wireless') def ReloadConfig(self): """ Reloads the active config file. """ self.config.reload() - + @dbus.service.signal(dbus_interface='org.wicd.daemon.wireless', signature='') def SendStartScanSignal(self): """ Emits a signal announcing a scan has started. """ self._scanning = True - + @dbus.service.signal(dbus_interface='org.wicd.daemon.wireless', signature='') def SendEndScanSignal(self): """ Emits a signal announcing a scan has finished. """ self._scanning = False - + def _wireless_autoconnect(self, fresh=True): """ Attempts to autoconnect to a wireless network. """ print "No wired connection present, attempting to autoconnect " + \ @@ -1274,7 +1273,7 @@ class WirelessDaemon(dbus.service.Object): return if fresh: self.Scan(sync=True) - + for x, network in enumerate(self.LastScan): if bool(network["has_profile"]): if self.debug_mode: @@ -1286,11 +1285,11 @@ class WirelessDaemon(dbus.service.Object): time.sleep(1) return print "Unable to autoconnect, you'll have to manually connect" - + ########################### ###### Wired Daemon ####### ########################### - + class WiredDaemon(dbus.service.Object): """ DBus interface for wired connection operations. """ def __init__(self, bus_name, daemon, wired=None, debug=False): @@ -1311,7 +1310,7 @@ class WiredDaemon(dbus.service.Object): self._debug_mode = mode self.config.debug = mode debug_mode = property(get_debug_mode, set_debug_mode) - + @dbus.service.method('org.wicd.daemon.wired') def GetWiredIP(self, ifconfig=""): """ Returns the wired interface's ip address. """ @@ -1333,7 +1332,7 @@ class WiredDaemon(dbus.service.Object): return self.wired.connecting_thread.GetStatus() else: return False - + @dbus.service.method('org.wicd.daemon.wired') def DetectWiredInterface(self): """ Returns an automatically detected wireless interface. """ @@ -1375,7 +1374,7 @@ class WiredDaemon(dbus.service.Object): return True else: return False - + @dbus.service.method('org.wicd.daemon.wired') def DisconnectWired(self): """ Disconnects the wired network. """ @@ -1389,12 +1388,12 @@ class WiredDaemon(dbus.service.Object): return self.wired.CheckPluggedIn() else: return None - + @dbus.service.method('org.wicd.daemon.wired') def IsWiredUp(self): """ Returns a boolean specifying if wired iface is up or down. """ return self.wired.IsUp() - + @dbus.service.method('org.wicd.daemon.wired') def EnableWiredInterface(self): """ Calls a method to enable the wired interface. """ @@ -1415,7 +1414,7 @@ class WiredDaemon(dbus.service.Object): self.daemon.SetForcedDisconnect(False) self.wired.Connect(self.WiredNetwork, debug=self.debug_mode) self.daemon.UpdateState() - + @dbus.service.method('org.wicd.daemon.wired') def CreateWiredNetworkProfile(self, profilename, default=False): """ Creates a wired network profile. """ @@ -1480,7 +1479,7 @@ class WiredDaemon(dbus.service.Object): def write_script_ent(prof, script): if not self.config.has_option(prof, script): self.config.set(prof, script, None) - + if profilename == "": self.config.write() return "500: Bad Profile name" @@ -1491,7 +1490,7 @@ class WiredDaemon(dbus.service.Object): self.config.add_section(profilename) for x in self.WiredNetwork: self.config.set(profilename, x, self.WiredNetwork[x]) - + write_script_ent(profilename, "beforescript") write_script_ent(profilename, "afterscript") write_script_ent(profilename, "disconnectscript") @@ -1523,7 +1522,7 @@ class WiredDaemon(dbus.service.Object): if not sections: sections = [""] return sections - + @dbus.service.method('org.wicd.daemon.wired') def ReloadConfig(self): """ Reloads the active config file. """ @@ -1567,14 +1566,12 @@ def daemonize(): # Decouple from parent environment to stop us from being a zombie. os.setsid() - os.umask(0) # Fork the second time to prevent us from opening a file that will # become our controlling terminal. try: pid = os.fork() if pid > 0: - print wpath.pidfile dirname = os.path.dirname(wpath.pidfile) if not os.path.exists(dirname): os.makedirs(dirname) @@ -1582,18 +1579,34 @@ def daemonize(): pidfile.write(str(pid) + '\n') pidfile.close() sys.exit(0) + else: + os.umask(0) + os.chdir('/') except OSError, e: print >> sys.stderr, "Fork #2 failed: %d (%s)" % (e.errno, e.strerror) sys.exit(1) - - sys.stdout.flush() - sys.stderr.flush() - os.close(sys.__stdin__.fileno()) - os.close(sys.__stdout__.fileno()) - os.close(sys.__stderr__.fileno()) - - # stdin always from /dev/null - sys.stdin = open('/dev/null', 'r') + + sys.stdin.close() + sys.stdout.close() + sys.stderr.close() + + try: + maxfd = os.sysconf("SC_OPEN_MAX") + except (AttributeError, ValueError): + maxfd = 1024 + + for fd in range(0, maxfd): + try: + os.close(fd) + except OSError: + pass + + os.open(os.devnull, os.O_RDWR) + + # Duplicate standard input to standard output and standard error. + os.dup2(0, 1) + os.dup2(0, 2) + child_pid = None @@ -1612,8 +1625,8 @@ def main(argv): try: opts, args = getopt.getopt(sys.argv[1:], 'fenoah', - ['help', 'no-daemon', 'no-poll', 'no-stderr', 'no-stdout', - 'no-autoconnect']) + ['help', 'no-daemon', 'no-poll', 'no-stderr', 'no-stdout', + 'no-autoconnect']) except getopt.GetoptError: # Print help information and exit usage() @@ -1636,7 +1649,7 @@ def main(argv): no_poll = True if do_daemonize: daemonize() - + if redirect_stderr or redirect_stdout: logpath = os.path.join(wpath.log, 'wicd.log') if not os.path.exists(wpath.log): @@ -1664,7 +1677,7 @@ def main(argv): (child_pid, x, y, z) = gobject.spawn_async( [misc.find_path("python"), "-O", os.path.join(wpath.lib, "monitor.py")]) signal.signal(signal.SIGTERM, sigterm_caught) - + # Enter the main loop mainloop = gobject.MainLoop() try: @@ -1697,4 +1710,3 @@ if __name__ == '__main__': sys.exit(1) gobject.threads_init() main(sys.argv) - diff --git a/wicd/wnettools.py b/wicd/wnettools.py index 35cb932..a0eae85 100644 --- a/wicd/wnettools.py +++ b/wicd/wnettools.py @@ -977,7 +977,7 @@ class BaseWirelessInterface(BaseInterface): if not wpa_pass_path: return None key_pattern = re.compile('network={.*?\spsk=(.*?)\n}.*', re.I | re.M | re.S) - cmd = [wpa_pass_path, network['essid'], network['key']] + cmd = [wpa_pass_path, network['essid'], str(network['key'])] if self.verbose: print cmd return misc.RunRegex(key_pattern, misc.Run(cmd)) From 6f276417f11d8791263d25812609e74b30b6e97c Mon Sep 17 00:00:00 2001 From: Andrew Psaltis Date: Fri, 27 Mar 2009 00:25:59 -0400 Subject: [PATCH 031/186] Changed some of the colors in wicd-curses.py and added the About to the OptCols on the main screen. --- curses/wicd-curses.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/curses/wicd-curses.py b/curses/wicd-curses.py index ed8c01b..b2b0251 100755 --- a/curses/wicd-curses.py +++ b/curses/wicd-curses.py @@ -556,6 +556,7 @@ class appGUI(): ('R' ,'Refresh',None), ('P' ,'Prefs',None), ('I' ,'Hidden',None), + ('A' ,'About',None), ('Q' ,'Quit',loop.quit) ] @@ -994,7 +995,7 @@ def main(): # Thanks to nanotube on #wicd for helping with this ui.register_palette([ ('body','default','default'), - ('focus','dark magenta','light gray'), + ('focus','black','light gray'), ('header','light blue','default'), ('important','light red','default'), ('connected','dark green','default'), @@ -1006,7 +1007,7 @@ def main(): ('tab active','dark green','light gray'), ('infobar','light gray','dark blue'), ('timebar','dark gray','default'), - ('listbar','dark gray','default'), + ('listbar','light blue','default'), # Simple colors around text ('green','dark green','default'), ('blue','light blue','default'), From 2b54f26c4e4f95d6ec0dce57dde56eb34a022eca Mon Sep 17 00:00:00 2001 From: Dan O'Reilly Date: Fri, 27 Mar 2009 23:13:16 -0400 Subject: [PATCH 032/186] Fix another issue with integer keys. --- wicd/misc.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/wicd/misc.py b/wicd/misc.py index 2d552fd..f380794 100644 --- a/wicd/misc.py +++ b/wicd/misc.py @@ -261,7 +261,8 @@ def ParseEncryption(network): else: rep_val = network.get(cur_val[0].lower()) if rep_val: - line = line.replace("$_%s" % cur_val[0], rep_val) + line = line.replace("$_%s" % cur_val[0], + str(rep_val)) config_file = ''.join([config_file, line]) else: print "Ignoring template line: '%s'" % line From 69fe67d6af53007bb4fd3cfa01f4a3a3daadd670 Mon Sep 17 00:00:00 2001 From: Andrew Psaltis Date: Wed, 1 Apr 2009 19:01:00 -0400 Subject: [PATCH 033/186] Generic updates and a bugfix. curses/README,curses/TODO: Cleaned up and updated respectively curses/curses_misc.py: added a get_caption() method to MaskingEdit curses/netentry_curses.py: Actually made the error dialogs work instead of crashing the program. curses/wicd-curses.py: Changed some capitalization in the help. --- curses/README | 4 ++-- curses/TODO | 3 +-- curses/curses_misc.py | 2 ++ curses/netentry_curses.py | 9 +++++---- curses/wicd-curses.py | 4 ++-- 5 files changed, 12 insertions(+), 10 deletions(-) diff --git a/curses/README b/curses/README index ecd25c3..29b21c1 100644 --- a/curses/README +++ b/curses/README @@ -32,8 +32,8 @@ F2 : Rename selected wired network profile (from the wired ComboBox) O : Raise ad-hoc network dialog IN DIALOGS (Meta usually is "Alt"): -ESC or Q: Quit dialog without saving information (if present) -Meta+[/]: Change tabs Left/Right (if tabs present) +ESC or Q or q: Quit dialog without saving information (if present) +Meta+[ / Meta+]: Change tabs Left/Right (if tabs present) Meta+Enter : Quit dialog and save information FAQ (WIP): diff --git a/curses/TODO b/curses/TODO index 9861ba4..fb7502c 100644 --- a/curses/TODO +++ b/curses/TODO @@ -1,6 +1,5 @@ Things to do (in no particular order): -* Implement a keyhandler function for the overall frame - * Make keystrokes customizable +* Make keystrokes customizable (Probably not going to happen) * Make color schemes customizable * Perform a mass code cleanup diff --git a/curses/curses_misc.py b/curses/curses_misc.py index d213b72..22b5b12 100644 --- a/curses/curses_misc.py +++ b/curses/curses_misc.py @@ -128,6 +128,8 @@ class MaskingEdit(urwid.Edit): self.mask_char = mask_char self.__super.__init__(caption,edit_text,multiline,align,wrap,allow_tab,edit_pos,layout) + def get_caption(self): + return self.caption def get_mask_mode(self): return self.mask_mode def set_mask_mode(self,mode): diff --git a/curses/netentry_curses.py b/curses/netentry_curses.py index 4e6bf29..3abf5d7 100644 --- a/curses/netentry_curses.py +++ b/curses/netentry_curses.py @@ -208,10 +208,11 @@ class WiredSettingsDialog(AdvancedSettingsDialog): ######################################## class WirelessSettingsDialog(AdvancedSettingsDialog): - def __init__(self,networkID): + def __init__(self,networkID,parent): global wireless, daemon AdvancedSettingsDialog.__init__(self) self.networkid = networkID + self.parent = parent global_settings_t = language['global_settings'] encryption_t = language['use_encryption'] autoconnect_t = language['automatic_connect'] @@ -307,9 +308,9 @@ class WirelessSettingsDialog(AdvancedSettingsDialog): for entry_info in encrypt_info.itervalues(): if entry_info[0].get_edit_text() == "" \ and entry_info[1] == 'required': - error(self.ui, self.overlay,"%s (%s)" \ + error(self.ui, self.parent,"%s (%s)" \ % (language['encrypt_info_missing'], - entry_info[0].get_captionabel() ) + entry_info[0].get_caption()[0:-2] ) ) return False @@ -319,7 +320,7 @@ class WirelessSettingsDialog(AdvancedSettingsDialog): elif not self.encryption_chkbox.get_state() and \ wireless.GetWirelessProperty(self.networkid, "encryption"): # Encrypt checkbox is off, but the network needs it. - error(self.ui, self.overlay, language['enable_encryption']) + error(self.ui, self.parent, language['enable_encryption']) return False else: self.set_net_prop("enctype", "None") diff --git a/curses/wicd-curses.py b/curses/wicd-curses.py index b2b0251..c4e8274 100755 --- a/curses/wicd-curses.py +++ b/curses/wicd-curses.py @@ -197,7 +197,7 @@ def about_dialog(body): # Modeled after htop's help def help_dialog(body): - textT = urwid.Text(('header','Wicd-curses help'),'right') + textT = urwid.Text(('header','wicd-curses help'),'right') textSH = urwid.Text(['This is ',('blue','wicd-curses-'+CURSES_REVNO),' using wicd ',unicode(daemon.Hello()),'\n']) textH = urwid.Text([ @@ -849,7 +849,7 @@ class appGUI(): else: # wireless list only other option wid,pos = self.thePile.get_focus().get_focus() - self.diag = WirelessSettingsDialog(pos) + self.diag = WirelessSettingsDialog(pos,self.frame) self.diag.ready_widgets(ui,self.frame) self.frame.set_body(self.diag) # Guess what! I actually need to put this here, else I'll have From b79151ef07b55ab43ef3a310b41788324967c3d2 Mon Sep 17 00:00:00 2001 From: Dan O'Reilly Date: Fri, 3 Apr 2009 19:07:00 -0400 Subject: [PATCH 034/186] Always use the "C" local when running external commands. --- wicd/misc.py | 18 ++---------------- 1 file changed, 2 insertions(+), 16 deletions(-) diff --git a/wicd/misc.py b/wicd/misc.py index f380794..3b66f2f 100644 --- a/wicd/misc.py +++ b/wicd/misc.py @@ -73,7 +73,6 @@ class WicdError(Exception): pass -__LANG = None def Run(cmd, include_stderr=False, return_pipe=False, return_obj=False, return_retcode=True): """ Run a command. @@ -93,7 +92,6 @@ def Run(cmd, include_stderr=False, return_pipe=False, for the command that was run. """ - global __LANG if not isinstance(cmd, list): cmd = to_unicode(str(cmd)) cmd = cmd.split() @@ -110,11 +108,9 @@ def Run(cmd, include_stderr=False, return_pipe=False, # We need to make sure that the results of the command we run # are in English, so we set up a temporary environment. - if not __LANG: - __LANG = get_good_lang() tmpenv = os.environ.copy() - tmpenv["LC_ALL"] = __LANG - tmpenv["LANG"] = __LANG + tmpenv["LC_ALL"] = "C" + tmpenv["LANG"] = "C" try: f = Popen(cmd, shell=False, stdout=PIPE, stdin=std_in, stderr=err, @@ -123,7 +119,6 @@ def Run(cmd, include_stderr=False, return_pipe=False, print "Running command %s failed: %s" % (str(cmd), str(e)) return "" - if return_obj: return f if return_pipe: @@ -131,14 +126,6 @@ def Run(cmd, include_stderr=False, return_pipe=False, else: return f.communicate()[0] -def get_good_lang(): - """ Check if en_US.utf8 is an available locale, if not use C. """ - output = Popen(["locale", "-a"], shell=False, stdout=PIPE).communicate()[0] - if "en_US.utf8" in output: - return "en_US.utf8" - else: - return "C" - def LaunchAndWait(cmd): """ Launches the given program with the given arguments, then blocks. @@ -553,4 +540,3 @@ def grouper(n, iterable, fillvalue=None): """ args = [iter(iterable)] * n return izip_longest(fillvalue=fillvalue, *args) - From 665fe76885d192c886a27c498176f2843cd75ea5 Mon Sep 17 00:00:00 2001 From: Dan O'Reilly Date: Sat, 4 Apr 2009 13:43:29 -0400 Subject: [PATCH 035/186] Fix crash with hidden essids if it was stored in wireless-settings.conf as None. Only trigger a wpa_supplicant rescan once when connecting. --- wicd/wicd-daemon.py | 11 +++++------ wicd/wnettools.py | 7 +++++-- 2 files changed, 10 insertions(+), 8 deletions(-) diff --git a/wicd/wicd-daemon.py b/wicd/wicd-daemon.py index 1daa5be..e4e26fc 100644 --- a/wicd/wicd-daemon.py +++ b/wicd/wicd-daemon.py @@ -1170,18 +1170,17 @@ class WirelessDaemon(dbus.service.Object): cur_network["has_profile"] = True - # Read the essid because we need to name those hidden - # wireless networks now - but only read it if it is hidden. - if cur_network["hidden"]: - cur_network["essid"] = self.config.get(section, "essid") - if cur_network["essid"] in ["", "Hidden", ""]: - cur_network["essid"] = "" for x in self.config.options(section): if not cur_network.has_key(x) or x.endswith("script"): cur_network[x] = misc.Noneify(self.config.get(section, x)) for option in ['use_static_dns', 'use_global_dns', 'encryption', 'use_settings_globally']: cur_network[option] = bool(cur_network.get(option)) + # Read the essid because we need to name those hidden + # wireless networks now - but only read it if it is hidden. + if cur_network["hidden"]: + if cur_network.get("essid") in ["", "Hidden", "", None]: + cur_network["essid"] = "" return "100: Loaded Profile" @dbus.service.method('org.wicd.daemon.wireless') diff --git a/wicd/wnettools.py b/wicd/wnettools.py index a0eae85..62cf751 100644 --- a/wicd/wnettools.py +++ b/wicd/wnettools.py @@ -1094,7 +1094,8 @@ class BaseWirelessInterface(BaseInterface): except (UnicodeDecodeError, UnicodeEncodeError): print 'Unicode problem with current network essid, ignoring!!' return None - if ap['essid'] in ['', ""]: + if ap['essid'] in ['', "", None]: + print 'hidden' ap['hidden'] = True ap['essid'] = "" else: @@ -1176,6 +1177,7 @@ class BaseWirelessInterface(BaseInterface): MAX_TIME = 35 MAX_DISCONNECTED_TIME = 3 disconnected_time = 0 + forced_rescan = False while (time.time() - auth_time) < MAX_TIME: cmd = '%s -i %s status' % (self.wpa_cli_cmd, self.iface) output = misc.Run(cmd) @@ -1187,11 +1189,12 @@ class BaseWirelessInterface(BaseInterface): return False if result == "COMPLETED": return True - elif result == "DISCONNECTED": + elif result == "DISCONNECTED" and not forced_rescan: disconnected_time += 1 if disconnected_time > MAX_DISCONNECTED_TIME: disconnected_time = 0 # Force a rescan to get wpa_supplicant moving again. + forced_rescan = True self._ForceSupplicantScan() MAX_TIME += 5 else: From ebf188acadb14b1b2e9a49fda6cf425730a823f7 Mon Sep 17 00:00:00 2001 From: Andrew Psaltis Date: Fri, 10 Apr 2009 22:07:14 -0400 Subject: [PATCH 036/186] Fixed network DNS input bug found by Brandon Hartshorn. --- curses/netentry_curses.py | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/curses/netentry_curses.py b/curses/netentry_curses.py index 3abf5d7..5bcf2f8 100644 --- a/curses/netentry_curses.py +++ b/curses/netentry_curses.py @@ -133,11 +133,11 @@ class AdvancedSettingsDialog(urwid.WidgetWrap): not self.global_dns_cb.get_state(): self.set_net_prop('use_static_dns', True) self.set_net_prop('use_global_dns', False) - self.set_net_prop('dns_domain', noneToString(self.dns_dom_edit.get_text())) - self.set_net_prop("search_domain", noneToString(self.search_dom_edit.get_text())) - self.set_net_prop("dns1", noneToString(self.dns1.get_text())) - self.set_net_prop("dns2", noneToString(self.dns2.get_text())) - self.set_net_prop("dns3", noneToString(self.dns3.get_text())) + self.set_net_prop('dns_domain', noneToString(self.dns_dom_edit.get_edit_text())) + self.set_net_prop("search_domain", noneToString(self.search_dom_edit.get_edit_text())) + self.set_net_prop("dns1", noneToString(self.dns1.get_edit_text())) + self.set_net_prop("dns2", noneToString(self.dns2.get_edit_text())) + self.set_net_prop("dns3", noneToString(self.dns3.get_edit_text())) elif self.static_dns_cb.get_state() and \ self.global_dns_cb.get_state(): self.set_net_prop('use_static_dns', True) From b5f7584c2b9155721916de1cfd78d6806e5d0fe3 Mon Sep 17 00:00:00 2001 From: Andrew Psaltis Date: Fri, 10 Apr 2009 22:33:40 -0400 Subject: [PATCH 037/186] Made it possible to enter 'q' and 'Q' into dialog edit fields. --- curses/wicd-curses.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/curses/wicd-curses.py b/curses/wicd-curses.py index c4e8274..a8ce2dfb 100755 --- a/curses/wicd-curses.py +++ b/curses/wicd-curses.py @@ -927,6 +927,7 @@ class appGUI(): event, button, col, row, focus=True) continue + k = self.frame.keypress(self.size,k) if self.diag: if k == 'esc' or k == 'q' or k == 'Q': self.restore_primary() @@ -935,7 +936,6 @@ class appGUI(): self.diag.save_settings() self.restore_primary() break - self.frame.keypress(self.size,k) if k == "window resize": self.size = ui.get_cols_rows() continue From 8ecd9ec029ade308e8695ba19f8a75e5f6b49612 Mon Sep 17 00:00:00 2001 From: Dan O'Reilly Date: Sat, 11 Apr 2009 18:04:22 -0400 Subject: [PATCH 038/186] Don't build C extensions modules in main setup.py Give WirelessInformationDialog a parent. --- setup.py | 15 ++++++--------- wicd/netentry.py | 6 +++--- 2 files changed, 9 insertions(+), 12 deletions(-) diff --git a/setup.py b/setup.py index e9eeeed..2971fec 100755 --- a/setup.py +++ b/setup.py @@ -20,7 +20,6 @@ from distutils.core import setup, Command from distutils.extension import Extension import os import shutil -import sys import subprocess # Be sure to keep this updated! @@ -383,7 +382,6 @@ class uninstall(Command): def run(self): os.system("./uninstall.sh") - try: import wpath except ImportError: @@ -477,13 +475,13 @@ except Exception, e: python setup.py configure has not yet been run.''' -wpactrl_ext = Extension(name = 'wpactrl', - sources = ['depends/python-wpactrl/wpa_ctrl.c', - 'depends/python-wpactrl/wpactrl.c'], - extra_compile_args = ["-fno-strict-aliasing"]) +wpactrl_ext = Extension(name='wpactrl', + sources=['depends/python-wpactrl/wpa_ctrl.c', + 'depends/python-wpactrl/wpactrl.c'], + extra_compile_args=["-fno-strict-aliasing"]) -iwscan_ext = Extension(name = 'iwscan', libraries = ['iw'], - sources = ['depends/python-iwscan/pyiwscan.c']) +iwscan_ext = Extension(name='iwscan', libraries=['iw'], + sources=['depends/python-iwscan/pyiwscan.c']) setup(cmdclass={'configure' : configure, 'get_translations' : get_translations, 'uninstall' : uninstall, 'test' : test, 'clear_generated' : clear_generated}, @@ -506,6 +504,5 @@ connect at startup to any preferred network within range. 'wicd.wpath','wicd.prefs','wicd.netentry','wicd.dbusmanager', 'wicd.logfile','wicd.backend','wicd.configmanager', 'wicd.guiutil','wicd.translations'], - ext_modules=[iwscan_ext, wpactrl_ext], data_files=data ) diff --git a/wicd/netentry.py b/wicd/netentry.py index 6ccd36c..28722ab 100644 --- a/wicd/netentry.py +++ b/wicd/netentry.py @@ -309,7 +309,7 @@ class WirelessSettingsDialog(AdvancedSettingsDialog): information_button = gtk.Button(stock=gtk.STOCK_INFO) self.button_hbox.pack_start(information_button, False, False) - information_button.connect('clicked', lambda *a, **k: WirelessInformationDialog(networkID)) + information_button.connect('clicked', lambda *a, **k: WirelessInformationDialog(networkID, self)) information_button.show() # Build the encryption menu @@ -879,8 +879,8 @@ class WirelessNetworkEntry(NetworkEntry): class WirelessInformationDialog(gtk.Dialog): - def __init__(self, networkID): - gtk.Dialog.__init__(self) + def __init__(self, networkID, parent): + gtk.Dialog.__init__(self,parent=parent) # Make the combo box. self.lbl_strength = gtk.Label() From 0aaba8c4390d092c5704b6c2a4a0c6dc9dfddb65 Mon Sep 17 00:00:00 2001 From: Dan O'Reilly Date: Sat, 11 Apr 2009 18:37:51 -0400 Subject: [PATCH 039/186] Make sure we check for wirelesstools in the ioctl backend. --- wicd/backends/be-ioctl.py | 1 + 1 file changed, 1 insertion(+) diff --git a/wicd/backends/be-ioctl.py b/wicd/backends/be-ioctl.py index ee7f95b..1a1c1e4 100644 --- a/wicd/backends/be-ioctl.py +++ b/wicd/backends/be-ioctl.py @@ -264,6 +264,7 @@ class WirelessInterface(Interface, BaseWirelessInterface): wpa_driver) Interface.__init__(self, iface, verbose) self.scan_iface = None + self.CheckWirelessTools() @neediface([]) def GetNetworks(self): From 0a007d0f449016676faf8f01081327f3c31ba5d2 Mon Sep 17 00:00:00 2001 From: Dan O'Reilly Date: Sat, 11 Apr 2009 18:53:30 -0400 Subject: [PATCH 040/186] Only check for wireless tools in the ioctl backend if wpactrl isn't available. Fix up error handling when there is no graphical sudo program installed. --- wicd/backends/be-ioctl.py | 4 ++-- wicd/gui.py | 4 +++- wicd/misc.py | 6 ++++-- 3 files changed, 9 insertions(+), 5 deletions(-) diff --git a/wicd/backends/be-ioctl.py b/wicd/backends/be-ioctl.py index 1a1c1e4..4314054 100644 --- a/wicd/backends/be-ioctl.py +++ b/wicd/backends/be-ioctl.py @@ -131,8 +131,8 @@ class Interface(BaseInterface): def CheckWirelessTools(self): """ Check for the existence needed wireless tools """ - # We don't need any external apps so just return - pass + if not WPACTRL_AVAIL: + BaseInterface.CheckWirelessTools(self) @neediface("") def GetIP(self, ifconfig=""): diff --git a/wicd/gui.py b/wicd/gui.py index 61b0b5b..2a2e174 100644 --- a/wicd/gui.py +++ b/wicd/gui.py @@ -57,7 +57,9 @@ def setup_dbus(force=True): except DBusException: if force: print "Can't connect to the daemon, trying to start it automatically..." - misc.PromptToStartDaemon() + if not misc.PromptToStartDaemon(): + print "Failed to find a graphical sudo program, cannot continue." + return False try: dbusmanager.connect_to_dbus() except DBusException: diff --git a/wicd/misc.py b/wicd/misc.py index 3b66f2f..202c9a4 100644 --- a/wicd/misc.py +++ b/wicd/misc.py @@ -155,6 +155,8 @@ def PromptToStartDaemon(): """ Prompt the user to start the daemon """ daemonloc = wpath.sbin + 'wicd' sudo_prog = choose_sudo_prog() + if not sudo_prog: + return False if "gksu" in sudo_prog or "ktsuss" in sudo_prog: msg = '--message' else: @@ -163,6 +165,7 @@ def PromptToStartDaemon(): 'Wicd needs to access your computer\'s network cards.', daemonloc] os.spawnvpe(os.P_WAIT, sudo_prog, sudo_args, os.environ) + return True def RunRegex(regex, string): """ runs a regex search on a string """ @@ -453,8 +456,7 @@ def choose_sudo_prog(prog_num=0): for path in paths: if os.path.exists(path): return path - - return None + return "" def find_path(cmd): """ Try to find a full path for a given file name. From 3a4ea9a0b5ad29934a9d845dfac3b78ef7e748bf Mon Sep 17 00:00:00 2001 From: Dan O'Reilly Date: Sat, 11 Apr 2009 19:57:02 -0400 Subject: [PATCH 041/186] Make sure we fall back to wpa_cli if wpactrl isn't available when stopping wpa_supplicant. --- wicd/backends/be-ioctl.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/wicd/backends/be-ioctl.py b/wicd/backends/be-ioctl.py index 4314054..ed7dc3f 100644 --- a/wicd/backends/be-ioctl.py +++ b/wicd/backends/be-ioctl.py @@ -426,6 +426,8 @@ class WirelessInterface(Interface, BaseWirelessInterface): @neediface(False) def StopWPA(self): """ Terminates wpa_supplicant using its ctrl interface. """ + if not WPACTRL_AVAIL: + return BaseWirelessInterface.StopWPA(self) wpa = self._connect_to_wpa_ctrl_iface() if not wpa: return From e12b29072dd825b2b0f4e1da35e4af8794147f41 Mon Sep 17 00:00:00 2001 From: Dan O'Reilly Date: Sat, 11 Apr 2009 22:41:34 -0400 Subject: [PATCH 042/186] Add missing print statement to ExecuteScripts() --- wicd/misc.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/wicd/misc.py b/wicd/misc.py index 202c9a4..b5600b2 100644 --- a/wicd/misc.py +++ b/wicd/misc.py @@ -192,7 +192,7 @@ def ExecuteScript(script, verbose=False): print "Executing %s" % script ret = call("%s > /dev/null 2>&1" % script, shell=True) if verbose: - "%s returned %s" % (script, ret) + print "%s returned %s" % (script, ret) def ReadFile(filename): """ read in a file and return it's contents as a string """ From 0a35f0989dbc2192d67924e09eda3707ebea2949 Mon Sep 17 00:00:00 2001 From: Dan O'Reilly Date: Sat, 11 Apr 2009 22:45:13 -0400 Subject: [PATCH 043/186] Fix duplicate GetOperationalMode() methods. Switch misc.get_gettext() to translations.get_gettext() in configscript.py --- wicd/configscript.py | 4 ++-- wicd/wicd-daemon.py | 6 ------ 2 files changed, 2 insertions(+), 8 deletions(-) diff --git a/wicd/configscript.py b/wicd/configscript.py index bb6fa28..b574d04 100755 --- a/wicd/configscript.py +++ b/wicd/configscript.py @@ -33,10 +33,10 @@ import ConfigParser import gtk.glade from wicd import wpath -from wicd import misc +from wicd import translations from wicd import dbusmanager -_ = misc.get_gettext() +_ = translations.get_gettext() language = {} language['configure_scripts'] = _("Configure Scripts") diff --git a/wicd/wicd-daemon.py b/wicd/wicd-daemon.py index e4e26fc..513716b 100644 --- a/wicd/wicd-daemon.py +++ b/wicd/wicd-daemon.py @@ -1138,12 +1138,6 @@ class WirelessDaemon(dbus.service.Object): ip = self.wifi.GetIP(ifconfig) return ip - @dbus.service.method('org.wicd.daemon.wireless') - def GetOperationalMode(self, ifconfig=""): - """ Returns the IP associated with the wireless interface. """ - ip = self.wifi.GetOperationalMode(ifconfig) - return ip - @dbus.service.method('org.wicd.daemon.wireless') def CheckWirelessConnectingMessage(self): """ Returns the wireless interface's status message. """ From 0c7c4e86dd9fc83d5d882f30ea363daa894d4804 Mon Sep 17 00:00:00 2001 From: Adam Blackburn Date: Sun, 12 Apr 2009 14:48:52 +0800 Subject: [PATCH 044/186] vcsinfo.py is regenerated when setup.py is run --- setup.py | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/setup.py b/setup.py index 2971fec..1dde53a 100755 --- a/setup.py +++ b/setup.py @@ -30,11 +30,10 @@ REVISION_NUM = 'unknown' CURSES_REVNO = 'uimod' try: - if not os.path.exists('vcsinfo.py'): - try: - os.system('bzr version-info --python > vcsinfo.py') - except: - pass + try: + os.system('bzr version-info --python > vcsinfo.py') + except: + pass import vcsinfo REVISION_NUM = vcsinfo.version_info['revno'] except Exception, e: From 72c5507232c65943bfcacf9f7587a63006cf4a91 Mon Sep 17 00:00:00 2001 From: Andrew Psaltis Date: Sun, 12 Apr 2009 02:50:57 -0400 Subject: [PATCH 045/186] Added my name to setup.py. --- setup.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/setup.py b/setup.py index 1dde53a..d95153d 100755 --- a/setup.py +++ b/setup.py @@ -495,8 +495,8 @@ to easily add encryption methods used. It ships with some common encryption types, such as WPA and WEP. Wicdl will automatically connect at startup to any preferred network within range. """, - author="Adam Blackburn, Dan O'Reilly", - author_email="compwiz18@gmail.com, oreilldf@gmail.com", + author="Adam Blackburn, Dan O'Reilly, Andrew Psaltis", + author_email="compwiz18@gmail.com, oreilldf@gmail.com, ampsaltis@gmail.com", url="http://wicd.net", license="http://www.gnu.org/licenses/old-licenses/gpl-2.0.html", py_modules=['wicd.networking','wicd.misc','wicd.gui','wicd.wnettools', From 5e5f73dd3ed200d374e8253332017ee6d62baa4d Mon Sep 17 00:00:00 2001 From: Andrew Psaltis Date: Tue, 14 Apr 2009 01:06:36 -0400 Subject: [PATCH 046/186] Updated wicd-curses.8.in, made the date in wicd-client.1 accurate, fixed a typo in setup.py, and added a bdist_rpm option in setup.cfg. --- in/man=wicd-curses.8.in | 6 +++--- man/wicd-client.1 | 2 +- setup.cfg | 2 ++ setup.py | 2 +- 4 files changed, 7 insertions(+), 5 deletions(-) diff --git a/in/man=wicd-curses.8.in b/in/man=wicd-curses.8.in index 603b057..7381627 100644 --- a/in/man=wicd-curses.8.in +++ b/in/man=wicd-curses.8.in @@ -1,5 +1,5 @@ .\" First revision was r203 -.TH WICD-CURSES "8" "February 2009" "wicd-curses-%CURSES_REVNO%" +.TH WICD-CURSES "8" "April 2009" "wicd-curses-%CURSES_REVNO%" .SH NAME .B wicd-curses \- curses-based wicd(8) controller @@ -23,7 +23,7 @@ language of choice only uses Latin characters. .SH CONTROLS All of these are case sensitive. .TP -.BR enter +.BR "C " or " enter" Connect to selected network .TP .BR "F8 " or " Q " or " q" @@ -52,7 +52,7 @@ Raise the "About wicd-curses" dialog .\".PP .\"The following is a work in progress and might not be fully functional as of yet. .TP -.BR "C " or "enter" +.BR "right-arrow" Bring up network configuration controller for the selected network .TP .BR delete diff --git a/man/wicd-client.1 b/man/wicd-client.1 index 9925b0c..6d86469 100644 --- a/man/wicd-client.1 +++ b/man/wicd-client.1 @@ -1,4 +1,4 @@ -.TH WICD-CLIENT "1" "September 2008" "wicd-client " "User Commands" +.TH WICD-CLIENT "1" "February 2009" "wicd-client " "User Commands" .SH NAME wicd-client \- manual page for wicd-client .SH DESCRIPTION diff --git a/setup.cfg b/setup.cfg index 4bd9609..d57f647 100644 --- a/setup.cfg +++ b/setup.cfg @@ -1,2 +1,4 @@ [install] record = install.log +[bdist_rpm] +group = Productivity/Networking/System diff --git a/setup.py b/setup.py index d95153d..35df602 100755 --- a/setup.py +++ b/setup.py @@ -492,7 +492,7 @@ Wicd supports wired and wireless networks, and capable of creating and tracking profiles for both. It has a template-based wireless encryption system, which allows the user to easily add encryption methods used. It ships with some common -encryption types, such as WPA and WEP. Wicdl will automatically +encryption types, such as WPA and WEP. Wicd will automatically connect at startup to any preferred network within range. """, author="Adam Blackburn, Dan O'Reilly, Andrew Psaltis", From b82212e9a6b84c5f0b61e032b70a7e0d0083aada Mon Sep 17 00:00:00 2001 From: Dan O'Reilly Date: Thu, 16 Apr 2009 21:49:42 -0400 Subject: [PATCH 047/186] Remove pointless assignment in be-ioctl Set wireless mode before putting interface up. Put wireless interfaces up before trying to authenticate. --- wicd/backends/be-ioctl.py | 1 - wicd/networking.py | 10 +++++----- 2 files changed, 5 insertions(+), 6 deletions(-) diff --git a/wicd/backends/be-ioctl.py b/wicd/backends/be-ioctl.py index ed7dc3f..3d16486 100644 --- a/wicd/backends/be-ioctl.py +++ b/wicd/backends/be-ioctl.py @@ -407,7 +407,6 @@ class WirelessInterface(Interface, BaseWirelessInterface): except ValueError: return False - result = result if result.endswith("COMPLETED"): return True elif result.endswith("DISCONNECTED"): diff --git a/wicd/networking.py b/wicd/networking.py index 084b8e3..1260505 100644 --- a/wicd/networking.py +++ b/wicd/networking.py @@ -831,17 +831,17 @@ class WirelessConnectThread(ConnectThread): self.reset_ip_addresses(wiface) self.stop_wpa(wiface) self.flush_routes(wiface) - - # Generate PSK and authenticate if needed. - if self.wpa_driver != 'ralink legacy': - self.generate_psk_and_authenticate(wiface) + wiface.SetMode(self.network['mode']) # Put interface up. self.SetStatus('configuring_interface') self.put_iface_up(wiface) + # Generate PSK and authenticate if needed. + if self.wpa_driver != 'ralink legacy': + self.generate_psk_and_authenticate(wiface) + # Associate. - wiface.SetMode(self.network['mode']) wiface.Associate(self.network['essid'], self.network['channel'], self.network['bssid']) From 242b740a9a509f27cf18c78e7ec54ac56726a960 Mon Sep 17 00:00:00 2001 From: Adam Blackburn Date: Fri, 17 Apr 2009 14:38:12 +0900 Subject: [PATCH 048/186] Made wicd-daemon.py executable --- wicd/wicd-daemon.py | 0 1 file changed, 0 insertions(+), 0 deletions(-) mode change 100644 => 100755 wicd/wicd-daemon.py diff --git a/wicd/wicd-daemon.py b/wicd/wicd-daemon.py old mode 100644 new mode 100755 From 2f14b3d5f0a69a4562721887b632263c6b02edb9 Mon Sep 17 00:00:00 2001 From: Dan O'Reilly Date: Sun, 19 Apr 2009 21:13:58 -0400 Subject: [PATCH 049/186] Use the -v option if dhclient is 4.x Simplify sorting method for WAPs. --- wicd/networking.py | 24 ++++++++---------------- wicd/wnettools.py | 7 +++++++ 2 files changed, 15 insertions(+), 16 deletions(-) diff --git a/wicd/networking.py b/wicd/networking.py index 1260505..6d439d8 100644 --- a/wicd/networking.py +++ b/wicd/networking.py @@ -116,7 +116,9 @@ def expand_script_macros(script, msg, bssid, essid): script -- the script to execute. msg -- the name of the script, %{script} will be expanded to this. bssid -- the bssid of the network we connect to, defaults to 'wired'. - essid -- the essid of the network we connect to, defaults to 'wired'.""" + essid -- the essid of the network we connect to, defaults to 'wired'. + + """ def repl(match): macro = match.group(1).lower() if macro_dict.has_key(macro): @@ -564,23 +566,13 @@ class Wireless(Controller): """ def comp(x, y): - if x.has_key('quality'): - if x['quality'] > y['quality']: - return 1 - elif x['quality'] < y['quality']: - return -1 - else: - return 0 + if 'quality' in x: + key = 'quality' else: - if x['strength'] < y['strength']: - return 1 - elif x['strength'] > y['strength']: - return -1 - else: - return 0 + key = 'strength' + return cmp(x[key], y[key]) if not self.wiface: return [] - wiface = self.wiface # Prepare the interface for scanning @@ -771,6 +763,7 @@ class Wireless(Controller): """ Sets the wpa_supplicant driver associated with the interface. """ self.wiface.SetWpaDriver(driver) + class WirelessConnectThread(ConnectThread): """ A thread class to perform the connection to a wireless network. @@ -1063,4 +1056,3 @@ class WiredConnectThread(ConnectThread): self.connect_result = "Success" self.is_connecting = False - diff --git a/wicd/wnettools.py b/wicd/wnettools.py index 62cf751..243fbff 100644 --- a/wicd/wnettools.py +++ b/wicd/wnettools.py @@ -220,6 +220,8 @@ class BaseInterface(object): if self.dhclient_cmd and cl in [misc.DHCLIENT, misc.AUTO]: client = "dhclient" cmd = self.dhclient_cmd + if self.dhclient_needs_verbose: + cmd += ' -v' elif self.dhcpcd_cmd and cl in [misc.DHCPCD, misc.AUTO]: client = "dhcpcd" cmd = self.dhcpcd_cmd @@ -294,6 +296,11 @@ class BaseInterface(object): """ self.dhclient_cmd = self._find_program_path("dhclient") + output = misc.Run(self.dhclient_cmd + " --version", include_stderr=True) + if '4.' in output: + self.dhclient_needs_verbose = True + else: + self.dhclient_needs_verbose = False self.dhcpcd_cmd = self._find_program_path("dhcpcd") self.pump_cmd = self._find_program_path("pump") From 62a6bb6748f2ace0cf77f51671330f25077294c5 Mon Sep 17 00:00:00 2001 From: Andrew Psaltis Date: Mon, 20 Apr 2009 01:02:20 -0400 Subject: [PATCH 050/186] Set the "Required-Stop" field in the openSUSE initscript to $null to get the OBS to stop complaining. --- in/init=suse=wicd.in | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/in/init=suse=wicd.in b/in/init=suse=wicd.in index 2dec20d..96e4934 100755 --- a/in/init=suse=wicd.in +++ b/in/init=suse=wicd.in @@ -3,7 +3,7 @@ ### BEGIN INIT INFO # Provides: wicd-daemon # Required-Start: dbus -# Required-Stop: +# Required-Stop: $null # Default-Start: 3 4 5 # Default-Stop: # Description: wicd, a wired and wireless connection manager. From 708f1d576da1ecc9b06ebd2e94376565e016e54d Mon Sep 17 00:00:00 2001 From: Adam Blackburn Date: Tue, 21 Apr 2009 22:33:29 +0800 Subject: [PATCH 051/186] Updated CHANGES --- CHANGES | 5536 ++++++++++++++++++++++++++++++++++++++++++++++++++++++- 1 file changed, 5501 insertions(+), 35 deletions(-) diff --git a/CHANGES b/CHANGES index f40c805..7cf7a3f 100644 --- a/CHANGES +++ b/CHANGES @@ -1,35 +1,5501 @@ -1.5.0 - * Added support for pump and dhcpcd - * Added wep-hex, wep-passphrase, eap-tls, and wep-shared encryption templates - * Autoconnect falls back to wireless if wired connection fails for any reason - * Fixed a memory leak - * Added ability to put interfaces up/down via the GUI - * Reduced number of external program calls for improved memory usage - * Added support for using one set of settings for all networks with an ESSID - * Made debugging output less spammy and more helpful - * Made GUI more responsive - * Added README and INSTALL - * Added setup.py install script - * Improved automatic reconnection - * Added option to disable tray animations - * Added distro-specific init scripts when installed from source - * Added PID file that is created on daemon start and destroyed on SIGTERM - * Allow resizing of Preference window and main window - * Added support for getting interface names from /proc/net/wireless - * Added a Disconnect button - * Added MAC address to network information that is always visible - * Requires root permissions to edit pre/post/disconnection scripts - * Daemon process is now renamed "wicd" and GUI is renamed "wicd-client" - * Added support for kdesu and ktsuss as well as gksudo - * Added ability to restart and print usage to init file - * Renamed desktop file "wicd.desktop" - * Change directory structure to be FHS compliant and customizable - * Added desktop file for autostarting - * Rewrote init file for Debian from /etc/init.d/skeleton - * Added manpages for the configuration files and daemon - * Added INSTALL, LICENSE, AUTHORS, README, and CHANGELOG - * Created new SVG icon and updated PNG icons accordingly - * Added --no-poll option to daemon which prevents polling of data - * Fixed various permissions issues - * Added wired-default profile for automatic DHCP on ethernet by default - * Changed log file permissions to 0600 +MAJOR CHANGES FROM 1.5: + * Enhanced GUI + * Console client (wicd-curses) + * Support for multiple backends + * Enhanced network setting properties + * Bug fixes + +CHANGELOG: +------------------------------------------------------------ +revno: 357 +committer: Andrew Psaltis +branch nick: 1.6 +timestamp: Mon 2009-04-20 01:02:20 -0400 +message: + Set the "Required-Stop" field in the openSUSE initscript to $null to get the OBS to stop complaining. +------------------------------------------------------------ +revno: 356 +committer: Dan O'Reilly +branch nick: hiddenfixes +timestamp: Sun 2009-04-19 21:13:58 -0400 +message: + Use the -v option if dhclient is 4.x + Simplify sorting method for WAPs. +------------------------------------------------------------ +revno: 355 +committer: Adam Blackburn +branch nick: 1.6 +timestamp: Fri 2009-04-17 14:38:12 +0900 +message: + Made wicd-daemon.py executable +------------------------------------------------------------ +revno: 354 +committer: Dan O'Reilly +branch nick: experimental +timestamp: Thu 2009-04-16 21:49:42 -0400 +message: + Remove pointless assignment in be-ioctl + Set wireless mode before putting interface up. + Put wireless interfaces up before trying to authenticate. +------------------------------------------------------------ +revno: 353 +committer: Andrew Psaltis +branch nick: 1.6 +timestamp: Tue 2009-04-14 01:06:36 -0400 +message: + Updated wicd-curses.8.in, made the date in wicd-client.1 accurate, fixed a typo in setup.py, and added a bdist_rpm option in setup.cfg. +------------------------------------------------------------ +revno: 352 +committer: Andrew Psaltis +branch nick: 1.6 +timestamp: Sun 2009-04-12 02:50:57 -0400 +message: + Added my name to setup.py. +------------------------------------------------------------ +revno: 351 +committer: Adam Blackburn +branch nick: 1.6 +timestamp: Sun 2009-04-12 14:48:52 +0800 +message: + vcsinfo.py is regenerated when setup.py is run +------------------------------------------------------------ +revno: 350 +committer: Dan O'Reilly +branch nick: experimental +timestamp: Sat 2009-04-11 22:45:13 -0400 +message: + Fix duplicate GetOperationalMode() methods. + Switch misc.get_gettext() to translations.get_gettext() in configscript.py +------------------------------------------------------------ +revno: 349 +committer: Dan O'Reilly +branch nick: experimental +timestamp: Sat 2009-04-11 22:41:34 -0400 +message: + Add missing print statement to ExecuteScripts() +------------------------------------------------------------ +revno: 348 +committer: Dan O'Reilly +branch nick: experimental +timestamp: Sat 2009-04-11 19:57:02 -0400 +message: + Make sure we fall back to wpa_cli if wpactrl isn't available when stopping wpa_supplicant. +------------------------------------------------------------ +revno: 347 +committer: Dan O'Reilly +branch nick: experimental +timestamp: Sat 2009-04-11 18:53:30 -0400 +message: + Only check for wireless tools in the ioctl backend if wpactrl isn't available. + Fix up error handling when there is no graphical sudo program installed. +------------------------------------------------------------ +revno: 346 +committer: Dan O'Reilly +branch nick: experimental +timestamp: Sat 2009-04-11 18:37:51 -0400 +message: + Make sure we check for wirelesstools in the ioctl backend. +------------------------------------------------------------ +revno: 345 +committer: Dan O'Reilly +branch nick: experimental +timestamp: Sat 2009-04-11 18:04:22 -0400 +message: + Don't build C extensions modules in main setup.py + Give WirelessInformationDialog a parent. +------------------------------------------------------------ +revno: 344 +committer: Andrew Psaltis +branch nick: 1.6 +timestamp: Fri 2009-04-10 22:46:57 -0400 +message: + Merged some more wicd-curses changes, experimental-nacl r310. + ------------------------------------------------------------ + revno: 202.2.19 + committer: Andrew Psaltis + branch nick: experimental-nacl + timestamp: Fri 2009-04-10 22:33:40 -0400 + message: + Made it possible to enter 'q' and 'Q' into dialog edit fields. +------------------------------------------------------------ +revno: 343 +committer: Andrew Psaltis +branch nick: 1.6 +timestamp: Fri 2009-04-10 22:13:48 -0400 +message: + Merged wicd-curses changes from r309 of experimental-nacl. + ------------------------------------------------------------ + revno: 202.2.18 + committer: Andrew Psaltis + branch nick: experimental-nacl + timestamp: Fri 2009-04-10 22:07:14 -0400 + message: + Fixed network DNS input bug found by Brandon Hartshorn. + ------------------------------------------------------------ + revno: 202.2.17 + committer: Andrew Psaltis + branch nick: experimental-nacl + timestamp: Sun 2009-04-05 11:35:36 -0400 + message: + Merged with r342 of mainline 1.6. + ------------------------------------------------------------ + revno: 202.2.16 + committer: Andrew Psaltis + branch nick: experimental-nacl + timestamp: Wed 2009-04-01 19:01:00 -0400 + message: + Generic updates and a bugfix. + curses/README,curses/TODO: Cleaned up and updated respectively + curses/curses_misc.py: added a get_caption() method to MaskingEdit + curses/netentry_curses.py: Actually made the error dialogs work instead of crashing the program. + curses/wicd-curses.py: Changed some capitalization in the help. + ------------------------------------------------------------ + revno: 202.2.15 + committer: Andrew Psaltis + branch nick: experimental-nacl + timestamp: Mon 2009-03-30 15:41:37 -0400 + message: + Merge r340 of mainline 1.6. +------------------------------------------------------------ +revno: 342 +committer: Dan O'Reilly +branch nick: experimental +timestamp: Sat 2009-04-04 13:43:29 -0400 +message: + Fix crash with hidden essids if it was stored in wireless-settings.conf as None. + Only trigger a wpa_supplicant rescan once when connecting. +------------------------------------------------------------ +revno: 341 +committer: Dan O'Reilly +branch nick: experimental +timestamp: Fri 2009-04-03 19:07:00 -0400 +message: + Always use the "C" local when running external commands. +------------------------------------------------------------ +revno: 340 +committer: Dan O'Reilly +branch nick: experimental +timestamp: Fri 2009-03-27 23:14:19 -0400 +message: + Merge. + ------------------------------------------------------------ + revno: 338.1.1 + committer: Andrew Psaltis + branch nick: 1.6 + timestamp: Fri 2009-03-27 10:24:59 -0400 + message: + Merged r305 of experimental-nacl. + ------------------------------------------------------------ + revno: 202.2.14 + committer: Andrew Psaltis + branch nick: experimental-nacl + timestamp: Fri 2009-03-27 00:25:59 -0400 + message: + Changed some of the colors in wicd-curses.py and added the About to the OptCols on the main screen. + ------------------------------------------------------------ + revno: 202.2.13 + committer: Andrew Psaltis + branch nick: experimental-nacl + timestamp: Wed 2009-03-25 12:36:57 -0400 + message: + Various fixes. + curses/curses_misc.py: + Simplified changing the "arrow" on the ComboBox, if I decide to do so. + curses/prefs_curses.py: Added a docstring + curses/wicd-curses.py: + 'q' or 'Q' quits a dialog without saving now. + Fixed a bug where a scan run while a dialog is up would lock the screen and + half-close the dialog when it is done. +------------------------------------------------------------ +revno: 339 +committer: Dan O'Reilly +branch nick: experimental +timestamp: Fri 2009-03-27 23:13:16 -0400 +message: + Fix another issue with integer keys. +------------------------------------------------------------ +revno: 338 +committer: Dan O'Reilly +branch nick: experimental +timestamp: Wed 2009-03-25 20:19:11 -0400 +message: + Add a workaround for an issue where large integers got mishandled by python-dbus on 64-bit systems. + Fix potential issue if encryption key is a number + Close all open fd's in the daemonize code. +------------------------------------------------------------ +revno: 337 +committer: Andrew Psaltis +branch nick: 1.6 +timestamp: Tue 2009-03-24 12:30:25 -0400 +message: + Merged in curses-uimod changes from experimental-nacl. + ------------------------------------------------------------ + revno: 202.2.12 + committer: Andrew Psaltis + branch nick: experimental-nacl + timestamp: Tue 2009-03-24 09:01:02 -0400 + message: + Merge 336 of mainline 1.6. + ------------------------------------------------------------ + revno: 202.2.11 + committer: Andrew Psaltis + branch nick: experimental-nacl + timestamp: Tue 2009-03-24 08:12:07 -0400 + message: + Made the help in wicd-curses.py all read out on one line. per entry + ------------------------------------------------------------ + revno: 202.2.10 + committer: Andrew Psaltis + branch nick: experimental-nacl + timestamp: Mon 2009-03-23 12:32:03 -0400 + message: + Merged r335 of mainline 1.6. + ------------------------------------------------------------ + revno: 202.2.9 + committer: Andrew Psaltis + branch nick: experimental-nacl + timestamp: Sun 2009-03-22 21:00:40 -0400 + message: + Improved the timing in general. + Decreased the clock update time to 500 ms. + Ensured that the wheel when connecting doesn't alternate weirdly. + Fixing this may also improve performance. + ------------------------------------------------------------ + revno: 202.2.8 + committer: Andrew Psaltis + branch nick: experimental-nacl + timestamp: Sun 2009-03-22 19:25:19 -0400 + message: + Changed the clock in wicd-curses.py to update every 0.9 seconds. + ------------------------------------------------------------ + revno: 202.2.7 + committer: Andrew Psaltis + branch nick: experimental-nacl + timestamp: Sun 2009-03-22 00:22:07 -0400 + message: + Merged in r331 of mainline 1.6. + ------------------------------------------------------------ + revno: 202.2.6 + committer: Andrew Psaltis + branch nick: experimental-nacl + timestamp: Sat 2009-03-21 23:21:31 -0400 + message: + Merged curses-uimod. It works well enough for me at the moment. + ------------------------------------------------------------ + revno: 202.3.26 + committer: Andrew Psaltis + branch nick: curses-uimod + timestamp: Sat 2009-03-21 23:18:03 -0400 + message: + Updated docs to note that enter results in connecting. + ------------------------------------------------------------ + revno: 202.3.25 + committer: Andrew Psaltis + branch nick: curses-uimod + timestamp: Sat 2009-03-21 17:33:41 -0400 + message: + Merged in enctemplates error handling fixes. + ------------------------------------------------------------ + revno: 202.3.24 + committer: Andrew Psaltis + branch nick: curses-uimod + timestamp: Thu 2009-03-19 12:48:28 -0400 + message: + Re-enabled "enter" in wicd-curses.py. + ------------------------------------------------------------ + revno: 202.3.23 + committer: Andrew Psaltis + branch nick: curses-uimod + timestamp: Wed 2009-03-18 23:37:28 -0400 + message: + Merged in Dan's enctemplates branch, and repaired two code merge conflicts. + ------------------------------------------------------------ + revno: 202.3.22 + committer: Andrew Psaltis + branch nick: curses-uimod-old + timestamp: Wed 2009-03-18 23:00:32 -0400 + message: + Merged r295 of experimental-nacl + ------------------------------------------------------------ + revno: 202.3.21 + committer: Andrew Psaltis + branch nick: curses-uimod + timestamp: Sat 2009-03-14 20:54:45 -0400 + message: + Fixed some keypress shenanigans + curses/wicd-curses.py: Fixed mouse events being passed to keypress functions (again) + curses/prefs_curses.py: Fixed some translations + curses/curses_misc.py: + Fixed mouse handling in TabColumns + Fixed callbacks to non-global keypresses in OptCols + ------------------------------------------------------------ + revno: 202.3.20 + committer: Andrew Psaltis + branch nick: curses-uimod + timestamp: Sat 2009-03-14 16:56:06 -0400 + message: + Merged setup.py changes from experimental-nacl, r293. + ------------------------------------------------------------ + revno: 202.3.19 + committer: Andrew Psaltis + branch nick: curses-uimod + timestamp: Wed 2009-03-11 20:34:52 -0400 + message: + Merged with experimental-nacl, r292 + ------------------------------------------------------------ + revno: 202.3.18 + committer: Andrew Psaltis + branch nick: curses-uimod + timestamp: Wed 2009-03-11 10:21:20 -0400 + message: + Fixed some bugs/usability issues + Enter is no longer mapped to anything + Arrow left is no longer mapped to anything + Edit text when it is unfocusable is now brown. + Fixed problem where scrolling up on the Preferences Dialog would somehow shift the dab over one. + ------------------------------------------------------------ + revno: 202.3.17 + committer: Andrew Psaltis + branch nick: curses-uimod + timestamp: Sat 2009-03-07 19:53:10 -0500 + message: + Fixed most keypresses not working. + ------------------------------------------------------------ + revno: 202.3.16 + committer: Andrew Psaltis + branch nick: curses-uimod + timestamp: Sat 2009-03-07 16:26:41 -0500 + message: + Added mouse support to OptCols. Everything works :-). + + This branch will be merged into experimental-nacl once I'm sure that everything works, and I update the documentation. + ------------------------------------------------------------ + revno: 202.3.15 + committer: Andrew Psaltis + branch nick: curses-uimod + timestamp: Sat 2009-03-07 14:49:51 -0500 + message: + Merged r294 of experimental-nacl + ------------------------------------------------------------ + revno: 202.3.14 + committer: Andrew Psaltis + branch nick: curses-uimod + timestamp: Fri 2009-03-06 15:41:19 -0500 + message: + Fixed the "left does not quit the preferences dialog" problem in wicd-curses. + ------------------------------------------------------------ + revno: 202.3.13 + committer: Andrew Psaltis + branch nick: curses-uimod + timestamp: Fri 2009-03-06 12:49:27 -0500 + message: + curses/prefs_curses.py: Adapted widgets for integration into the main UI + curses/curses_misc.py: + Removed the "bottom_part" from the TabColumns + curses/wicd-curses.py: + Added support for editing preferences directly in the main UI w/o a dialog + 'left' now only quits with saving for the NetworkSettingsDialogs + (suggestions as for what to do here would be appreciated) + ------------------------------------------------------------ + revno: 202.3.12 + committer: Andrew Psaltis + branch nick: curses-uimod + timestamp: Thu 2009-03-05 23:13:29 -0500 + message: + Made the keymappings displayed in the OptCols actually do what they say they're suppoed to do. + Updated the README + ------------------------------------------------------------ + revno: 202.3.11 + committer: Andrew Psaltis + branch nick: curses-uimod + timestamp: Thu 2009-03-05 23:09:17 -0500 + message: + More htoppish ui changes + curses/prefs_curses.py: changed save_results to save_settings + curses/curses_misc.py: + M^[ and M^] shift the tabs left and right respectively. The curses module + has trouble picking up M^left and M^right + curses/netentry_curses.py: + Removed the buttons and button-related code from the interface. + Removed the overlay code. + Adapted the code for direct insertion into the wicd-curses interface + curses/wicd-curses.py: + Teaked the wireless header. + Added support for sticking the network config dialog into the interface, and + changing the current OptCols when it is activated. + Added new OptCols for other large dialogs + ------------------------------------------------------------ + revno: 202.3.10 + committer: Andrew Psaltis + branch nick: curses-uimod + timestamp: Thu 2009-03-05 11:20:43 -0500 + message: + Actually made window resizing not drop the help screen. + ------------------------------------------------------------ + revno: 202.3.9 + committer: Andrew Psaltis + branch nick: curses-uimod + timestamp: Thu 2009-03-05 10:09:23 -0500 + message: + Modified the help dialog in wicd-curses so that it fills up the entire screen. + There may still a formatting issue, will wait on user opinion before changing. + ------------------------------------------------------------ + revno: 202.3.8 + committer: Andrew Psaltis + branch nick: curses-uimod + timestamp: Wed 2009-03-04 17:01:00 -0500 + message: + Fixed the wireless network header when we are only seeing wireless networks. + ------------------------------------------------------------ + revno: 202.3.7 + committer: Andrew Psaltis + branch nick: curses-uimod + timestamp: Wed 2009-03-04 16:54:26 -0500 + message: + curses/curses_misc.py: + Added a non-selectable listbox for the wireless network header + curses/wicd-curses.py: + Updated the wireless list-header generating function and activated it. + Removed/deactivated some unused code. + ------------------------------------------------------------ + revno: 202.3.6 + committer: Andrew Psaltis + branch nick: curses-uimod + timestamp: Wed 2009-03-04 00:56:17 -0500 + message: + curses/curses_misc.py: + added support for Meta and Ctrl being applied to keys in OptCols + curses/wicd-curses.py + Changed the colors slightly, colorized the clock. + ------------------------------------------------------------ + revno: 202.3.5 + committer: Andrew Psaltis + branch nick: curses-uimod + timestamp: Mon 2009-03-02 14:05:25 -0500 + message: + curses/wicd-curses.py: + Replaced idle_incr with a clock that counts seconds. + Streamlined some of the footer functions + The connecting progress-wheel now updates independently of any other counter. + Increased status updating time to 2 seconds (from 1.5) + ------------------------------------------------------------ + revno: 202.3.4 + committer: Andrew Psaltis + branch nick: curses-uimod + timestamp: Sun 2009-03-01 23:53:59 -0500 + message: + curses/curses_misc.py: Added a colon to each entry in OptCols + curses/wicd-curses.py: + Removed the 'print ""' from the end of the main entry point + Changed the infobar colors to grey on dark blue + ------------------------------------------------------------ + revno: 202.3.3 + committer: Andrew Psaltis + branch nick: curses-uimod + timestamp: Sun 2009-03-01 20:47:08 -0500 + message: + Things are coming along... + curses/netentry_curses.py: Realigned some text + curses/curses_misc.py: + Added support for clicking stuff (doesn't do anything except change a label + for now) + The keys 'left' and 'right' now accepted, and translated into fake arrows + Added a debug mode for the OptCols + curses/wicd-curses.py: + Removed if loop in locals() from the exception wrapper, this was causing bugs + in OptCols to spam my console + Debug mode on the optcols is set to default (for now) + Cleaned up idle_incr + Removed some of the exception wrappers + ------------------------------------------------------------ + revno: 202.3.2 + committer: Andrew Psaltis + branch nick: curses-uimod + timestamp: Sat 2009-02-28 18:58:12 -0500 + message: + curses/curses_misc.py: Added a htop-like OptCols + curses/wicd-curses.py: + Added support for OptCols. Some of the keys in there are not valid as of yet. + ------------------------------------------------------------ + revno: 202.3.1 + committer: Andrew Psaltis + branch nick: curses-uimod + timestamp: Sat 2009-02-28 11:32:29 -0500 + message: + Merged with r291 of experimental-nacl + ------------------------------------------------------------ + revno: 202.2.5 + committer: Andrew Psaltis + branch nick: experimental-nacl + timestamp: Sat 2009-03-21 22:28:05 -0400 + message: + Merged r329 of mainline 1.6. + ------------------------------------------------------------ + revno: 202.2.4 + committer: Andrew Psaltis + branch nick: experimental-nacl + timestamp: Mon 2009-03-16 21:12:36 -0400 + message: + Dump descriptions of error messages to stderr instead of stdout. + ------------------------------------------------------------ + revno: 202.2.3 + committer: Andrew Psaltis + branch nick: experimental-nacl + timestamp: Mon 2009-03-16 20:59:06 -0400 + message: + Merged in resolvconf support from mainline 1.6, r325. + ------------------------------------------------------------ + revno: 202.2.2 + committer: Andrew Psaltis + branch nick: experimental-nacl + timestamp: Thu 2009-03-12 14:40:58 -0400 + message: + Merged r324 of mainline 1.6. + ------------------------------------------------------------ + revno: 202.2.1 + committer: Andrew Psaltis + branch nick: experimental-nacl + timestamp: Wed 2009-03-11 20:32:36 -0400 + message: + Merge with mainline 1,6, r323. +------------------------------------------------------------ +revno: 336 +committer: Dan O'Reilly +branch nick: experimental +timestamp: Mon 2009-03-23 17:53:59 -0400 +message: + Remove some unneeded imports. + Remove unused variable. +------------------------------------------------------------ +revno: 335 +committer: Dan O'Reilly +branch nick: experimental +timestamp: Mon 2009-03-23 01:30:16 -0400 +message: + Merge to import lines. +------------------------------------------------------------ +revno: 334 +committer: Dan O'Reilly +branch nick: experimental +timestamp: Mon 2009-03-23 01:28:50 -0400 +message: + Make the ioctl backends use of python-iwscan and python-wpactrl optional. + Don't use __all__ in wnettools.py, and make the backends explicitly import the methods/classes they need from wnettools.py. +------------------------------------------------------------ +revno: 333 +committer: Dan O'Reilly +branch nick: experimental +timestamp: Sun 2009-03-22 18:39:44 -0400 +message: + Update docstrings. +------------------------------------------------------------ +revno: 332 +committer: Dan O'Reilly +branch nick: experimental +timestamp: Sun 2009-03-22 17:36:55 -0400 +message: + Update copyrights and some docstrings. + Make trayicon network menu scan-triggering behave better. +------------------------------------------------------------ +revno: 331 +committer: Dan O'Reilly +branch nick: experimental +timestamp: Sun 2009-03-22 00:13:42 -0400 +message: + Fix decorators. +------------------------------------------------------------ +revno: 330 +committer: Dan O'Reilly +branch nick: experimental +timestamp: Sat 2009-03-21 22:38:33 -0400 +message: + Merge enctemplates branch. + ------------------------------------------------------------ + revno: 312.3.7 + committer: Dan O'Reilly + branch nick: enctemplates + timestamp: Sat 2009-03-21 16:37:21 -0400 + message: + Merge 1.6 branch. + ------------------------------------------------------------ + revno: 312.3.6 + committer: Dan O'Reilly + branch nick: enctemplates + timestamp: Sat 2009-03-21 15:30:26 -0400 + message: + Fix some issues in the template error handling code. + ------------------------------------------------------------ + revno: 312.3.5 + committer: Dan O'Reilly + branch nick: enctemplates + timestamp: Mon 2009-03-16 23:19:06 -0400 + message: + Merge from 1.6 branch. + ------------------------------------------------------------ + revno: 312.3.4 + committer: Dan O'Reilly + branch nick: enctemplates + timestamp: Fri 2009-03-13 18:55:18 -0400 + message: + Merge + ------------------------------------------------------------ + revno: 312.3.3 + committer: Dan O'Reilly + branch nick: enctemplates + timestamp: Sun 2009-03-08 18:38:16 -0400 + message: + Merge encryption template changes for curses. + ------------------------------------------------------------ + revno: 312.4.1 + committer: Andrew Psaltis + branch nick: enctemplates + timestamp: Sun 2009-03-08 17:45:38 -0400 + message: + Fixed wicd-curses to support the new template backend. + Made the cacert and clcert fields optional in the eap-tls template. + ------------------------------------------------------------ + revno: 312.3.2 + committer: Dan O'Reilly + branch nick: enctemplates + timestamp: Sun 2009-03-08 18:32:48 -0400 + message: + Merge. + ------------------------------------------------------------ + revno: 312.3.1 + committer: Dan O'Reilly + branch nick: enctemplates + timestamp: Sat 2009-02-28 21:52:27 -0500 + message: + Tweak encryption template code so that optional parameters can be supplied. Tweak UI code to reflect that new functionality. + Allow for slightly more variation in template formatting. +------------------------------------------------------------ +revno: 329 +committer: Dan O'Reilly +branch nick: experimental +timestamp: Sat 2009-03-21 22:22:04 -0400 +message: + Added a neediface decorator to replace using "if not self.iface return..." in every method that needs it. +------------------------------------------------------------ +revno: 328 +committer: Dan O'Reilly +branch nick: experimental +timestamp: Sat 2009-03-21 19:41:13 -0400 +message: + Add missing check for no interface to GetIP. +------------------------------------------------------------ +revno: 327 +committer: Dan O'Reilly +branch nick: experimental +timestamp: Sat 2009-03-21 16:28:40 -0400 +message: + - Replace some tabs that snuck in with spaces. + - Try to validate successful association with static IPs by pinging the gateway specified. +------------------------------------------------------------ +revno: 326 +committer: Dan O'Reilly +branch nick: experimental +timestamp: Sun 2009-03-15 20:54:16 -0400 +message: + Apply Debian initscript patch from David Paleino. +------------------------------------------------------------ +revno: 325 +committer: Dan O'Reilly +branch nick: experimental +timestamp: Sun 2009-03-15 15:54:14 -0400 +message: + Merge in resolvconf support. + ------------------------------------------------------------ + revno: 322.1.5 + committer: Dan O'Reilly + branch nick: resolvconf2 + timestamp: Sun 2009-03-15 13:47:55 -0400 + message: + Only print "Setting DNS" message if debug mode is on. + ------------------------------------------------------------ + revno: 322.1.4 + committer: Dan O'Reilly + branch nick: resolvconf2 + timestamp: Sat 2009-03-14 17:41:51 -0400 + message: + Fix how we set nameserver entries after code review. + ------------------------------------------------------------ + revno: 322.1.3 + committer: Dan O'Reilly + branch nick: resolvconf2 + timestamp: Thu 2009-03-12 20:54:33 -0400 + message: + Merge. + ------------------------------------------------------------ + revno: 322.1.2 + committer: Dan O'Reilly + branch nick: resolvconf2 + timestamp: Mon 2009-03-09 01:49:33 -0400 + message: + Merge. + ------------------------------------------------------------ + revno: 322.1.1 + committer: Dan O'Reilly + branch nick: resolvconf2 + timestamp: Mon 2009-03-09 00:07:39 -0400 + message: + Add support for using resolvconf instead of directly editing resolv.conf if possible. +------------------------------------------------------------ +revno: 324 +committer: Adam Blackburn +branch nick: 1.6 +timestamp: Thu 2009-03-12 17:55:16 +0800 +message: + Fixed get_translations and renamed cleargenerated to clear_generated +------------------------------------------------------------ +revno: 323 +committer: Dan O'Reilly +branch nick: experimental +timestamp: Mon 2009-03-09 01:46:31 -0400 +message: + Add lunar init directory. +------------------------------------------------------------ +revno: 322 +committer: Dan O'Reilly +branch nick: experimental +timestamp: Sun 2009-03-08 23:39:41 -0400 +message: + Still trying to fix this... + ------------------------------------------------------------ + revno: 298.3.7 + committer: Dan O'Reilly + branch nick: global-scripts + timestamp: Sun 2009-03-08 23:14:35 -0400 + message: + Merge. + ------------------------------------------------------------ + revno: 321.1.1 + committer: Dan O'Reilly + branch nick: experimental + timestamp: Sun 2009-03-08 23:09:12 -0400 + message: + Merge. + ------------------------------------------------------------ + revno: 312.1.2 + committer: Dan O'Reilly + branch nick: 1.6 + timestamp: Sun 2009-03-08 23:07:38 -0400 + message: + Merging/removing accidently commit. + ------------------------------------------------------------ + revno: 312.2.2 + committer: Dan O'Reilly + branch nick: resolvconf + timestamp: Sun 2009-03-08 22:45:24 -0400 + message: + Merge. + ------------------------------------------------------------ + revno: 319.1.3 + committer: Andrew Psaltis + branch nick: 1.6 + timestamp: Sun 2009-03-08 18:31:36 -0400 + message: + Fixed the fix. + ------------------------------------------------------------ + revno: 319.1.2 + committer: Andrew Psaltis + branch nick: 1.6 + timestamp: Sun 2009-03-08 18:02:44 -0400 + message: + Fixed the Lunar init script. + ------------------------------------------------------------ + revno: 319.1.1 + committer: Andrew Psaltis + branch nick: 1.6 + timestamp: Sun 2009-03-08 17:38:47 -0400 + message: + Added an init script for Lunar Linux. + ------------------------------------------------------------ + revno: 312.2.1 + committer: Dan O'Reilly + branch nick: resolvconf + timestamp: Sat 2009-02-28 16:01:26 -0500 + message: + Add support for using resolvconf instead of directly editing /etc/resolv.conf if it's available. + ------------------------------------------------------------ + revno: 312.1.1 + committer: Dan O'Reilly + branch nick: 1.6 + timestamp: Sun 2009-03-08 23:03:04 -0400 + message: + Undoing accidental commit. +------------------------------------------------------------ +revno: 321 +committer: Dan O'Reilly +branch nick: experimental +timestamp: Sun 2009-03-08 22:49:24 -0400 +message: + Merge in Dario Freddi's additions, with some modifications. + ------------------------------------------------------------ + revno: 311.1.10 + committer: Dario Freddi + branch nick: wicd + timestamp: Sat 2009-03-07 12:51:11 +0100 + message: + Merges + ------------------------------------------------------------ + revno: 311.1.9 + committer: Dario Freddi + branch nick: wicd + timestamp: Sat 2009-03-07 12:16:45 +0100 + message: + Forgot to add a definition + ------------------------------------------------------------ + revno: 311.1.8 + committer: Dario Freddi + branch nick: wicd + timestamp: Fri 2009-03-06 23:53:09 +0100 + message: + Merging last changes + ------------------------------------------------------------ + revno: 311.1.7 + committer: Dario Freddi + branch nick: wicd + timestamp: Tue 2009-03-03 11:40:34 +0100 + message: + Removing placeholders, and fixing issues pointed out by Dan + ------------------------------------------------------------ + revno: 311.1.6 + committer: Dario Freddi + branch nick: wicd + timestamp: Mon 2009-03-02 11:44:57 +0100 + message: + Fixing implementation in ioctl + ------------------------------------------------------------ + revno: 311.1.5 + committer: Dario Freddi + branch nick: wicd + timestamp: Sun 2009-03-01 20:19:16 +0100 + message: + Adding available auth methods + ------------------------------------------------------------ + revno: 311.1.4 + committer: Dario Freddi + branch nick: wicd + timestamp: Sun 2009-03-01 19:31:34 +0100 + message: + Adding GetOperationalMode() to determine op mode of an interface + ------------------------------------------------------------ + revno: 311.1.3 + committer: Dario Freddi + branch nick: wicd + timestamp: Sun 2009-03-01 19:22:30 +0100 + message: + Adding the possibility of a custom iwconfig + ------------------------------------------------------------ + revno: 311.1.2 + committer: Dario Freddi + branch nick: wicd + timestamp: Sun 2009-03-01 16:46:58 +0100 + message: + Adding per-channel bitrate information as a string + ------------------------------------------------------------ + revno: 311.1.1 + committer: drf + branch nick: wicd + timestamp: Sun 2009-03-01 16:01:21 +0100 + message: + Starting implementation of current bitrate retrieval +------------------------------------------------------------ +revno: 320 +committer: Dan O'Reilly +branch nick: experimental +timestamp: Sun 2009-03-08 20:38:54 -0400 +message: + Create an error dialog when we get a DBus access denied error. +------------------------------------------------------------ +revno: 319 +committer: Dan O'Reilly +branch nick: experimental +timestamp: Sun 2009-03-08 15:58:44 -0400 +message: + Fix suse init script. +------------------------------------------------------------ +revno: 318 +committer: Andrew Psaltis +branch nick: 1.6 +timestamp: Sat 2009-03-07 11:38:37 -0500 +message: + Merged wicd-curses changes from experimental-nacl, r294 + ------------------------------------------------------------ + revno: 202.1.92 + committer: Andrew Psaltis + branch nick: experimental-nacl + timestamp: Sat 2009-03-07 11:34:22 -0500 + message: + Fixed translations.py support in wicd-curses. + ------------------------------------------------------------ + revno: 202.1.91 + committer: Andrew Psaltis + branch nick: experimental-nacl + timestamp: Fri 2009-03-06 19:40:10 -0500 + message: + Merged r317 of mainline 1.6 + ------------------------------------------------------------ + revno: 202.1.90 + committer: Andrew Psaltis + branch nick: experimental-nacl + timestamp: Wed 2009-03-04 00:41:28 -0500 + message: + Merged in translations.py changes (r315) from mainline 1.6. + ------------------------------------------------------------ + revno: 202.1.89 + committer: Andrew Psaltis + branch nick: experimental-nacl + timestamp: Sat 2009-02-28 08:48:21 -0500 + message: + Merge r311 of mainline 1.6 + ------------------------------------------------------------ + revno: 202.1.88 + committer: Andrew Psaltis + branch nick: experimental-nacl + timestamp: Sat 2009-02-28 08:40:02 -0500 + message: + curses/netentry_curses.py: + Made the password field actually keep its "passwordiness" when we go to the + buttons. + in/scripts=wicd-client.in: + Added support for X being off and wicd-curses not being there + ------------------------------------------------------------ + revno: 202.1.87 + committer: Andrew Psaltis + branch nick: experimental-nacl + timestamp: Sat 2009-02-21 19:36:57 -0500 + message: + curses/wicd-curses.py: + Console display defaults to raw_display now, added -c argument to select curses_display + curses/README,in/man=wicd-curses.8.in: + Updated stuff done in wicd-curses.py +------------------------------------------------------------ +revno: 317 +committer: Andrew Psaltis +branch nick: 1.6 +timestamp: Fri 2009-03-06 19:28:09 -0500 +message: + Made the wicd-curses script add WHEREAREMYFILES + Moved WHEREAREMYFILES to /var/lib/wicd, and adapted setup.py, wpath.py, and + the wicd-client script to support it + Fixed a typo in setup.py +------------------------------------------------------------ +revno: 316 +committer: Dan O'Reilly +branch nick: experimental +timestamp: Wed 2009-03-04 18:34:35 -0500 +message: + Merge + ------------------------------------------------------------ + revno: 314.1.2 + committer: Adam Blackburn + branch nick: 1.6 + timestamp: Wed 2009-03-04 19:44:55 +0800 + message: + Removed old images + ------------------------------------------------------------ + revno: 314.1.1 + committer: Andrew Psaltis + branch nick: 1.6 + timestamp: Wed 2009-03-04 00:02:14 -0500 + message: + Added translations.py, and adapted all gtk and curses ui files to use it. + Moved the language dict functions and get_gettext to translations.py. Also + killed the functions and laid the dict bare in the file + Removed all instances of language[number] from wicd. +------------------------------------------------------------ +revno: 315 +committer: Dan O'Reilly +branch nick: experimental +timestamp: Wed 2009-03-04 18:32:15 -0500 +message: + Fix setup.py bug where - was getting turned into _ in paths. +------------------------------------------------------------ +revno: 314 +committer: Dan O'Reilly +branch nick: experimental +timestamp: Sun 2009-03-01 23:15:34 -0500 +message: + Apply lang patch from David Paleino +------------------------------------------------------------ +revno: 313 +committer: Dan O'Reilly +branch nick: experimental +timestamp: Sun 2009-03-01 23:00:22 -0500 +message: + Merge in global script support. + ------------------------------------------------------------ + revno: 298.3.6 + committer: Dan O'Reilly + branch nick: global-scripts + timestamp: Sun 2009-03-01 22:43:28 -0500 + message: + Don't provide separate options for pre/post/disconnect scripts. Just a parent scripts directory. + ------------------------------------------------------------ + revno: 298.3.5 + committer: Dan O'Reilly + branch nick: global-scripts + timestamp: Sun 2009-03-01 21:50:18 -0500 + message: + Merge. + ------------------------------------------------------------ + revno: 298.3.4 + committer: Dan O'Reilly + branch nick: global-scripts + timestamp: Sat 2009-02-28 15:16:45 -0500 + message: + Merge + ------------------------------------------------------------ + revno: 298.3.3 + committer: Dan O'Reilly + branch nick: global-scripts + timestamp: Fri 2009-02-27 00:40:19 -0500 + message: + Initial crack at global scripts support. Also includes some setup.py tweaks. + ------------------------------------------------------------ + revno: 298.3.2 + committer: Dan O'Reilly + branch nick: global-scripts + timestamp: Fri 2009-02-27 00:20:37 -0500 + message: + Merge. + ------------------------------------------------------------ + revno: 298.3.1 + committer: Dan O'Reilly + branch nick: global-scripts + timestamp: Fri 2009-02-27 00:13:00 -0500 + message: + Get rid of unneeded "use_tray" variable being passed around in wicd-client. + Add some methods for executing multiple scripts to be use for global scripts later. + Remove some rogue extra whitespace in networking.py +------------------------------------------------------------ +revno: 312 +committer: Dan O'Reilly +branch nick: experimental +timestamp: Sat 2009-02-28 15:34:34 -0500 +message: + Don't use the thread module in networking.py. +------------------------------------------------------------ +revno: 311 +committer: Dan O'Reilly +branch nick: experimental +timestamp: Fri 2009-02-27 00:38:09 -0500 +message: + Merge. + ------------------------------------------------------------ + revno: 203.1.87 + committer: Robby Workman + branch nick: experimental-rworkman + timestamp: Fri 2009-02-13 10:07:40 -0600 + message: + Merged mainline r297. + ------------------------------------------------------------ + revno: 203.1.86 + committer: Robby Workman + branch nick: experimental-rworkman + timestamp: Thu 2009-02-12 18:41:12 -0600 + message: + Merged r295 of mainline. + ------------------------------------------------------------ + revno: 308.1.1 + committer: Andrew Psaltis + branch nick: 1.6 + timestamp: Tue 2009-02-24 10:28:03 -0500 + message: + Made the Slackware init script look more like the rest of the Slackware init scripts. +------------------------------------------------------------ +revno: 310 +committer: Dan O'Reilly +branch nick: experimental +timestamp: Fri 2009-02-27 00:35:53 -0500 +message: + Get rid of unneeded "use_tray" variable being passed around in wicd-client. + Remove some extra whitespace in networking.py +------------------------------------------------------------ +revno: 309 +committer: Dan O'Reilly +branch nick: experimental +timestamp: Fri 2009-02-27 00:08:31 -0500 +message: + Fix issue where signal strength wouldn't be reported correctly if the first link quality regex didn't match. + Add some helper methods that will eventually be used for encryption template parsing. + Use more specific exception checking in a few places. +------------------------------------------------------------ +revno: 308 +committer: Dan O'Reilly +branch nick: experimental +timestamp: Sat 2009-02-21 13:11:55 -0500 +message: + Fix typo +------------------------------------------------------------ +revno: 307 +committer: Andrew Psaltis +branch nick: 1.6 +timestamp: Sat 2009-02-21 01:37:38 -0500 +message: + Merged experimental-nacl r288, and updated wicd-curses revno. + ------------------------------------------------------------ + revno: 202.1.86 + committer: Andrew Psaltis + branch nick: experimental-nacl + timestamp: Sat 2009-02-21 01:23:29 -0500 + message: + Added the translations to .bzrignore (hopefully that is all of it). + ------------------------------------------------------------ + revno: 202.1.85 + committer: Andrew Psaltis + branch nick: experimental-nacl + timestamp: Sat 2009-02-21 01:17:59 -0500 + message: + Force utf8 encoding in wicd-curses.py. Hopefully this won't break compat on non-utf8 consoles. + ------------------------------------------------------------ + revno: 202.1.84 + committer: Andrew Psaltis + branch nick: experimental-nacl + timestamp: Sat 2009-02-21 01:17:22 -0500 + message: + Merged r306 of mainline 1.6 +------------------------------------------------------------ +revno: 306 +committer: Dan O'Reilly +branch nick: experimental +timestamp: Sat 2009-02-21 01:00:40 -0500 +message: + merge + ------------------------------------------------------------ + revno: 304.1.1 + committer: Andrew Psaltis + branch nick: 1.6 + timestamp: Fri 2009-02-20 22:06:59 -0500 + message: + Merged misc.py and .bzrignore changes from experimental-nacl r285. + ------------------------------------------------------------ + revno: 202.1.83 + committer: Andrew Psaltis + branch nick: experimental-nacl + timestamp: Fri 2009-02-20 21:54:30 -0500 + message: + .bzrignore: Added some stuff that I missed. + ------------------------------------------------------------ + revno: 202.1.82 + committer: Andrew Psaltis + branch nick: experimental-nacl + timestamp: Fri 2009-02-20 21:44:16 -0500 + message: + .bzrignore: Added files generated from the build to .bzrignore + wicd/misc.py: + Decode all unicode fonts before a client handles them. Prevents wicd-curses + from dying due to having to display non-latin characters. + ------------------------------------------------------------ + revno: 202.1.81 + committer: Andrew Psaltis + branch nick: experimental-nacl + timestamp: Fri 2009-02-20 00:36:51 -0500 + message: + Merged with r304 of mainline 1.6. +------------------------------------------------------------ +revno: 305 +committer: Dan O'Reilly +branch nick: experimental +timestamp: Sat 2009-02-21 00:57:40 -0500 +message: + Create the wpactrl interface connection in a less bizarre way. +------------------------------------------------------------ +revno: 304 +committer: Andrew Psaltis +branch nick: 1.6 +timestamp: Thu 2009-02-19 18:14:40 -0500 +message: + Fixed regex problem in wicd/misc.py. +------------------------------------------------------------ +revno: 303 +committer: Adam Blackburn +branch nick: 1.6 +timestamp: Thu 2009-02-19 22:59:40 -0600 +message: + Added check for loop before exiting loop +------------------------------------------------------------ +revno: 302 +committer: Adam Blackburn +branch nick: 1.6 +timestamp: Thu 2009-02-19 22:22:12 -0600 +message: + Fixed the dhcp_object error. +------------------------------------------------------------ +revno: 301 +committer: Andrew Psaltis +branch nick: 1.6 +timestamp: Wed 2009-02-18 07:42:48 -0500 +message: + Merged with experimental-nacl, r282. + ------------------------------------------------------------ + revno: 202.1.80 + committer: Andrew Psaltis + branch nick: experimental-nacl + timestamp: Tue 2009-02-17 20:04:50 -0500 + message: + 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 +------------------------------------------------------------ +revno: 300 +committer: Adam Blackburn +branch nick: 1.6 +timestamp: Wed 2009-02-18 16:15:50 +0800 +message: + Merge + ------------------------------------------------------------ + revno: 298.1.2 + committer: Dan O'Reilly + branch nick: experimental + timestamp: Tue 2009-02-17 23:44:25 -0500 + message: + Merge. + ------------------------------------------------------------ + revno: 298.2.1 + committer: Andrew Psaltis + branch nick: 1.6 + timestamp: Mon 2009-02-16 10:46:54 -0500 + message: + Merged with experimental-nacl, r281. + ------------------------------------------------------------ + revno: 202.1.79 + committer: Andrew Psaltis + branch nick: experimental-nacl + timestamp: Mon 2009-02-16 10:43:57 -0500 + message: + curses/wicd-curses.py: Removed the redraw_tag, since I discovered that I don't need it. + ------------------------------------------------------------ + revno: 202.1.78 + committer: Andrew Psaltis + branch nick: experimental-nacl + timestamp: Mon 2009-02-16 10:39:19 -0500 + message: + Merged r298 of mainline 1.6. + ------------------------------------------------------------ + revno: 202.1.77 + committer: Andrew Psaltis + branch nick: experimental-nacl + timestamp: Fri 2009-02-13 13:27:38 -0500 + message: + Merged mainline r297 of 1.6. + ------------------------------------------------------------ + revno: 298.1.1 + committer: Dan O'Reilly + branch nick: experimental + timestamp: Tue 2009-02-17 23:29:14 -0500 + message: + Refactor wnettools/backend code so that most external tool functionality exists in wnettools, and it just inherited by the external backends. This simplifies creating new backends that just override selected methods. + Rewrite encryption template parsing code to allow blank entries (though the GUI still doesn't), and be more permissive of slightly incorrect formatting. + Fix bug in wicd-monitor error handling code. +------------------------------------------------------------ +revno: 299 +committer: Adam Blackburn +branch nick: 1.6 +timestamp: Wed 2009-02-18 16:13:31 +0800 +message: + Updated copyright, setup.py version number, and AUTHORS +------------------------------------------------------------ +revno: 298 +committer: Dan O'Reilly +branch nick: experimental +timestamp: Fri 2009-02-13 18:54:27 -0500 +message: + Fix bug where GUI could get stuck in the connecting state if the GUI was first opened while a connection was in progress. +------------------------------------------------------------ +revno: 297 +committer: Dan O'Reilly +branch nick: experimental +timestamp: Thu 2009-02-12 20:07:12 -0500 +message: + Merge experimental-rworkman + ------------------------------------------------------------ + revno: 203.1.85 + committer: Robby Workman + branch nick: experimental-rworkman + timestamp: Wed 2009-02-11 22:04:44 -0600 + message: + Removed a relic from 1.4.x :) + ------------------------------------------------------------ + revno: 203.1.84 + committer: Robby Workman + branch nick: experimental-rworkman + timestamp: Wed 2009-02-11 22:03:24 -0600 + message: + Removed date ; added reference to wicd-curses(8). + Minor formatting fixes. + Documented the backend=, prefer_wired=, and global_dns_dom= parameters + in manager-settings.conf + ------------------------------------------------------------ + revno: 203.1.83 + committer: Robby Workman + branch nick: experimental-rworkman + timestamp: Wed 2009-02-11 22:01:58 -0600 + message: + Removed date ; added references to wicd-curses(8). + ------------------------------------------------------------ + revno: 203.1.82 + committer: Robby Workman + branch nick: experimental-rworkman + timestamp: Wed 2009-02-11 22:01:24 -0600 + message: + Removed date ; added references to wicd-curses(8). + ------------------------------------------------------------ + revno: 203.1.81 + committer: Robby Workman + branch nick: experimental-rworkman + timestamp: Wed 2009-02-11 22:00:10 -0600 + message: + Removed the date, as it's pointless. + Added NaCl to the AUTHORS list (still needs email addy). + Something else minor that I forgot :/ + ------------------------------------------------------------ + revno: 203.1.80 + committer: Robby Workman + branch nick: experimental-rworkman + timestamp: Wed 2009-02-11 21:38:38 -0600 + message: + Merged mainline. + ------------------------------------------------------------ + revno: 203.1.79 + committer: Robby Workman + branch nick: experimental-rworkman + timestamp: Mon 2009-02-09 20:40:35 -0600 + message: + Merged mainline. + ------------------------------------------------------------ + revno: 203.1.78 + committer: Robby Workman + branch nick: experimental-rworkman + timestamp: Sat 2009-02-07 16:51:03 -0600 + message: + Merged r285 upstream + ------------------------------------------------------------ + revno: 203.1.77 + committer: Robby Workman + branch nick: experimental-rworkman + timestamp: Wed 2009-02-04 15:00:40 -0600 + message: + Merged mainline. + ------------------------------------------------------------ + revno: 203.1.76 + committer: Robby Workman + branch nick: experimental-rworkman + timestamp: Tue 2009-02-03 21:18:35 -0600 + message: + Merged back with mainline. +------------------------------------------------------------ +revno: 296 +committer: Dan O'Reilly +branch nick: experimental +timestamp: Thu 2009-02-12 18:48:10 -0500 +message: + Merged curses changes. + ------------------------------------------------------------ + revno: 202.1.76 + committer: Andrew Psaltis + branch nick: experimental-nacl + timestamp: Thu 2009-02-12 00:38:24 -0500 + message: + Merged with r294 of mainline 1.6. + ------------------------------------------------------------ + revno: 202.1.75 + committer: Andrew Psaltis + branch nick: experimental-nacl + timestamp: Wed 2009-02-11 10:44:57 -0500 + message: + Some minor code cleanup and fixes + curses/wicd-curses.py: Fixed lag upon completing connections + curses/wicd-curses.py,curses/prefs_curses.py,curses/curses_misc.py: + Cleaned up some code, removed/reformatted some comments + ------------------------------------------------------------ + revno: 202.1.74 + committer: Andrew Psaltis + branch nick: experimental-nacl + timestamp: Tue 2009-02-10 20:55:11 -0500 + message: + Merged with r291 of mainline 1.6. + ------------------------------------------------------------ + revno: 202.1.73 + committer: Andrew Psaltis + branch nick: experimental-nacl + timestamp: Sun 2009-02-08 12:26:50 -0500 + message: + curses/wicd-curses.py: + Added a mention of the About dialog in the help + curses/prefs_curses.py: + Fixed mouse support + in/man=wicd-curses.8.in + Added a mention of the about dialog + ------------------------------------------------------------ + revno: 202.1.72 + committer: Andrew Psaltis + branch nick: experimental-nacl + timestamp: Sat 2009-02-07 23:24:08 -0500 + message: + Merged r285 of mainline 1.6 + The last commit should have read: + curses/netentry_curses.py: + Fixed a bug where we are unable to save any individual network information. + curses/wicd-curses.py + Added information to the uppermost footer text telling how the user can + display the help dialog. + The last commit fixed the removal of a blank string in prefs_curses from the + backends list, that no longer has a blank string in it any more. + ------------------------------------------------------------ + revno: 202.1.71 + committer: Andrew Psaltis + branch nick: experimental-nacl + timestamp: Thu 2009-02-05 16:33:45 -0500 + message: + curses/wicd-curses.py: ListBox focus-maintaining code completely debugged +------------------------------------------------------------ +revno: 295 +committer: Dan O'Reilly +branch nick: experimental +timestamp: Thu 2009-02-12 18:38:40 -0500 +message: + Fix issue where GetForcedDisconnect was returning True when we had just connected. + Fix issues with auto-switch to wired. + Change to how the gui handles changing state from connecting to not-connecting to be nicer. + Make the gui trigger monitor state updates while in the connecting state. + Make sure the monitor logs a warning when it catches a D-Bus exception. + Make sure cancelling a wired connection attempt kills DHCP. + Fix issue where DHCP wouldn't get run if automatic dhcp tool was enabled. +------------------------------------------------------------ +revno: 294 +committer: Dan O'Reilly +branch nick: experimental +timestamp: Wed 2009-02-11 22:44:38 -0500 +message: + Make default init script executable. +------------------------------------------------------------ +revno: 293 +committer: Dan O'Reilly +branch nick: experimental +timestamp: Wed 2009-02-11 21:01:12 -0500 +message: + Fix possible crash when handling D-Bus exceptions in monitor.py +------------------------------------------------------------ +revno: 292 +committer: Dan O'Reilly +branch nick: experimental +timestamp: Wed 2009-02-11 20:55:02 -0500 +message: + Make sure it's possible to stop a dhcp client that's in the process of getting a lease. + Have gui.py trigger connection status updates every .5 seconds if in a connecting state. + Fix typo in wicd-client.py +------------------------------------------------------------ +revno: 291 +committer: Dan O'Reilly +branch nick: experimental +timestamp: Tue 2009-02-10 01:08:12 -0500 +message: + Don't convert to milliseconds in misc.timeout_add if milli is True. +------------------------------------------------------------ +revno: 290 +committer: Dan O'Reilly +branch nick: experimental +timestamp: Tue 2009-02-10 00:58:11 -0500 +message: + Change "Advanced Settings" to "Properties" + Remove some unneeded debugging output. + Replace gobject.timeout_add_seconds / gobject.timeout_add if/else logic with calls to a misc.timeout_add method that does it internally. + Only display the dbus lost error message if dbus has been gone for 5 seconds without coming back. +------------------------------------------------------------ +revno: 289 +committer: Dan O'Reilly +branch nick: experimental +timestamp: Sun 2009-02-08 19:59:53 -0500 +message: + Tweak algorithm for searching for sudo progs so we search every directory in $PATH for a particular app before moving on to the next one. +------------------------------------------------------------ +revno: 288 +committer: Dan O'Reilly +branch nick: experimental +timestamp: Sun 2009-02-08 18:42:05 -0500 +message: + Fix crashing bug in daemon. + Dont have wicd-monitor inherit stdin from the daemon. +------------------------------------------------------------ +revno: 287 +committer: Dan O'Reilly +branch nick: experimental +timestamp: Sun 2009-02-08 16:14:17 -0500 +message: + Applied LC_MESSAGES patch from David Paleino +------------------------------------------------------------ +revno: 286 +committer: Dan O'Reilly +branch nick: experimental +timestamp: Sun 2009-02-08 16:09:55 -0500 +message: + Enforce only one scan being allowed to happen at a time in the daemon. +------------------------------------------------------------ +revno: 285 +committer: Dan O'Reilly +branch nick: experimental +timestamp: Sat 2009-02-07 01:50:49 -0500 +message: + Always updated the network list if we get a scan finished signal. +------------------------------------------------------------ +revno: 284 +committer: Dan O'Reilly +branch nick: experimental +timestamp: Sat 2009-02-07 01:22:42 -0500 +message: + Fix some issues with the GUI statusbar being incorrect. + Make wicd-client more tolerant of dbus exceptions. + Disconnect from both managed interfaces before making a connection. +------------------------------------------------------------ +revno: 283 +committer: Dan O'Reilly +branch nick: experimental +timestamp: Fri 2009-02-06 19:26:09 -0500 +message: + Fix bug where interface name was being passed to the dhcp client executable twice. + Tweak connect/disconnect to not kill any processes. Instead it releases leases and terminates the wpa_supplicant instance through its ctrl interface. This should make wicd handle multiple connections better. +------------------------------------------------------------ +revno: 282 +committer: Dan O'Reilly +branch nick: experimental +timestamp: Wed 2009-02-04 23:05:05 -0500 +message: + If the monitor loses contact with the daemon for an extended period, die instead of ignoring the errors. +------------------------------------------------------------ +revno: 281 +committer: Dan O'Reilly +branch nick: experimental +timestamp: Wed 2009-02-04 19:13:06 -0500 +message: + More tweaking of how the GUI updates the status bar. Should be more efficient now. +------------------------------------------------------------ +revno: 280 +committer: Dan O'Reilly +branch nick: experimental +timestamp: Wed 2009-02-04 18:32:58 -0500 +message: + Merge experimental-nacl. + ------------------------------------------------------------ + revno: 202.1.70 + committer: Andrew Psaltis + branch nick: experimental-nacl + timestamp: Wed 2009-02-04 17:28:43 -0500 + message: + curses/prefs_curses.py: + Removed the external entry point + Removed the removing of a blank string that caused + wicd/misc.py: + Made sure that "advanced_settings" in get_language_list_gui() actually is + "Advanced Settings" + ------------------------------------------------------------ + revno: 202.1.69 + committer: Andrew Psaltis + branch nick: experimental-nacl + timestamp: Wed 2009-02-04 17:13:04 -0500 + message: + Merged with mainline 1.6, r279 +------------------------------------------------------------ +revno: 279 +committer: Dan O'Reilly +branch nick: experimental +timestamp: Wed 2009-02-04 00:26:13 -0500 +message: + Rather than polling for network status in the GUI, just have the monitor run an on-demand pull and get the results from the daemon. Should reduce iwconfig/ifconfig calls while the GUI is open and make for nicer looking code. +------------------------------------------------------------ +revno: 278 +committer: Dan O'Reilly +branch nick: experimental +timestamp: Tue 2009-02-03 23:48:58 -0500 +message: + Fix bug where link detection tool value wasn't get propogated down the stack. +------------------------------------------------------------ +revno: 277 +committer: Dan O'Reilly +branch nick: experimental +timestamp: Tue 2009-02-03 21:21:40 -0500 +message: + Merge experimental-rworkman + ------------------------------------------------------------ + revno: 203.1.75 + committer: Robby Workman + branch nick: experimental-rworkman + timestamp: Tue 2009-02-03 10:14:34 -0600 + message: + Bugfix to prevent creation of $HOME/~/ directory + ------------------------------------------------------------ + revno: 203.1.74 + committer: Robby Workman + branch nick: experimental-rworkman + timestamp: Tue 2009-02-03 00:26:28 -0600 + message: + More INSTALL tweaks. + ------------------------------------------------------------ + revno: 203.1.73 + committer: Robby Workman + branch nick: experimental-rworkman + timestamp: Tue 2009-02-03 00:12:39 -0600 + message: + Tweaked INSTALL to note dbus and friends deps. + ------------------------------------------------------------ + revno: 203.1.72 + committer: Robby Workman + branch nick: experimental-rworkman + timestamp: Tue 2009-02-03 00:08:42 -0600 + message: + Merged mainline, which includes NaCl's curses stuff and all fixes and + such from this branch. + ------------------------------------------------------------ + revno: 203.1.71 + committer: Robby Workman + branch nick: experimental-rworkman + timestamp: Sun 2009-02-01 21:05:04 -0600 + message: + Merged r265..r266 from mainline. +------------------------------------------------------------ +revno: 276 +committer: Dan O'Reilly +branch nick: experimental +timestamp: Tue 2009-02-03 19:59:53 -0500 +message: + Add a .bzrignore file. +------------------------------------------------------------ +revno: 275 +committer: Dan O'Reilly +branch nick: experimental +timestamp: Tue 2009-02-03 19:38:07 -0500 +message: + Remove unneeded parameter from PreferencesDialog constructor. +------------------------------------------------------------ +revno: 274 +committer: Dan O'Reilly +branch nick: experimental +timestamp: Tue 2009-02-03 19:35:57 -0500 +message: + Make sure we try each external app in order if selection is set to be automatic. +------------------------------------------------------------ +revno: 273 +committer: Dan O'Reilly +branch nick: experimental +timestamp: Tue 2009-02-03 00:05:11 -0500 +message: + Make sure debug settings are propogated down the stack as soon a the daemon loads. +------------------------------------------------------------ +revno: 272 +committer: Dan O'Reilly +branch nick: experimental +timestamp: Mon 2009-02-02 23:47:54 -0500 +message: + Make GetWirelessInterfaces() return a list instead of the first interface. Also make the networking.py layer pull the first entry from the list. + Some documentation cleanup. +------------------------------------------------------------ +revno: 271 +committer: Dan O'Reilly +branch nick: experimental +timestamp: Mon 2009-02-02 23:39:52 -0500 +message: + Minor formatting tweak +------------------------------------------------------------ +revno: 270 +committer: Dan O'Reilly +branch nick: experimental +timestamp: Mon 2009-02-02 23:05:29 -0500 +message: + Simplify the inheritance of static wnettools functions in the backends. + Make sure we select a default route flushing tool. +------------------------------------------------------------ +revno: 269 +committer: Dan O'Reilly +branch nick: experimental +timestamp: Sun 2009-02-01 23:32:55 -0500 +message: + Merge NaCl's curses frontend and rworkman's experimental branch. + ------------------------------------------------------------ + revno: 265.1.2 + committer: Adam Blackburn + branch nick: 1.6-clean + timestamp: Sat 2009-01-31 15:58:28 +0800 + message: + Merged rworkman's experimental branch + ------------------------------------------------------------ + revno: 203.1.70 + committer: Robby Workman + branch nick: experimental-rworkman + timestamp: Sat 2009-01-31 01:16:34 -0600 + message: + Merged latest from NaCl. + ------------------------------------------------------------ + revno: 203.1.69 + committer: Robby Workman + branch nick: experimental-rworkman + timestamp: Sat 2009-01-31 01:00:03 -0600 + message: + Merged mainline r265 + ------------------------------------------------------------ + revno: 203.1.68 + committer: Robby Workman + branch nick: experimental-rworkman + timestamp: Sat 2009-01-31 00:38:59 -0600 + message: + Added some more salinity here... + ------------------------------------------------------------ + revno: 203.1.67 + committer: Robby Workman + branch nick: experimental-rworkman + timestamp: Fri 2009-01-30 22:48:56 -0600 + message: + Merged some salty stuff... + ------------------------------------------------------------ + revno: 203.1.66 + committer: Robby Workman + branch nick: experimental-rworkman + timestamp: Fri 2009-01-30 21:48:59 -0600 + message: + Fix a harmless typo. + ------------------------------------------------------------ + revno: 203.1.65 + committer: Robby Workman + branch nick: experimental-rworkman + timestamp: Fri 2009-01-30 20:22:38 -0600 + message: + Merged mainline for a bugfix. + ------------------------------------------------------------ + revno: 203.1.64 + committer: Robby Workman + branch nick: experimental-rworkman + timestamp: Fri 2009-01-30 07:58:37 -0600 + message: + Merged latest salty branch. + ------------------------------------------------------------ + revno: 203.1.63 + committer: Robby Workman + branch nick: experimental-rworkman + timestamp: Thu 2009-01-29 22:37:58 -0600 + message: + Merged NaCl's branch. + ------------------------------------------------------------ + revno: 203.1.62 + committer: Robby Workman + branch nick: experimental-rworkman + timestamp: Thu 2009-01-29 11:33:40 -0600 + message: + This merges from the selinux branch (I accidentally edited the wrong + branch) with a note in INSTALL about pm-utils optional dep. + ------------------------------------------------------------ + revno: 203.1.61 + committer: Robby Workman + branch nick: experimental-rworkman + timestamp: Thu 2009-01-29 11:12:32 -0600 + message: + Removed references to "Tray" from other/wicd.desktop + ------------------------------------------------------------ + revno: 203.1.60 + committer: Robby Workman + branch nick: experimental-rworkman + timestamp: Thu 2009-01-29 11:06:27 -0600 + message: + Removed an unneeded wicd.png from other/ and fixed up the wicd.desktop + file in there (for users who want to just start the client without + the tray icon, and have a menu entry to do so). + ------------------------------------------------------------ + revno: 203.1.59 + committer: Robby Workman + branch nick: experimental-rworkman + timestamp: Thu 2009-01-29 10:55:57 -0600 + message: + Merge mainline with some removals and bugfixes. + ------------------------------------------------------------ + revno: 203.1.58 + committer: Robby Workman + branch nick: experimental-rworkman + timestamp: Wed 2009-01-28 21:40:40 -0600 + message: + Quote some values in the wicd-client.in script, in case some insane + person passes a VERSION string with spaces in it. I can't imagine + who would have done such a thing ;-) + ------------------------------------------------------------ + revno: 203.1.57 + committer: Robby Workman + branch nick: experimental-rworkman + timestamp: Wed 2009-01-28 20:54:31 -0600 + message: + Updated Gentoo's init script from portage. + Thanks to Jeremy Olexa (darkside_). + ------------------------------------------------------------ + revno: 203.1.56 + committer: Robby Workman + branch nick: experimental-rworkman + timestamp: Wed 2009-01-28 19:28:05 -0600 + message: + Merged changes from svenstaro to the Arch init script, and then + did some cleanup edits in this tree. + ------------------------------------------------------------ + revno: 203.1.55 + committer: Robby Workman + branch nick: experimental-rworkman + timestamp: Wed 2009-01-28 15:49:30 -0600 + message: + Merged latest from NaCl's branch. + ------------------------------------------------------------ + revno: 203.1.54 + committer: Robby Workman + branch nick: experimental-rworkman + timestamp: Tue 2009-01-27 15:59:41 -0600 + message: + Merged mainline fixes. + ------------------------------------------------------------ + revno: 203.1.53 + committer: Robby Workman + branch nick: experimental-rworkman + timestamp: Mon 2009-01-26 18:49:43 -0600 + message: + Merge mainline with some bugfixes. + ------------------------------------------------------------ + revno: 203.1.52 + committer: Robby Workman + branch nick: experimental-rworkman + timestamp: Mon 2009-01-26 10:37:06 -0600 + message: + Updated INSTALL with some dependency information. + ------------------------------------------------------------ + revno: 203.1.51 + committer: Robby Workman + branch nick: experimental-rworkman + timestamp: Mon 2009-01-26 09:02:43 -0600 + message: + Merged latest changes in NaCl's branch. + ------------------------------------------------------------ + revno: 203.1.50 + committer: Robby Workman + branch nick: experimental-rworkman + timestamp: Sun 2009-01-25 21:55:12 -0600 + message: + Merged latest mainline with several bugfixes. + ------------------------------------------------------------ + revno: 203.1.49 + committer: Robby Workman + branch nick: experimental-rworkman + timestamp: Sun 2009-01-25 18:00:08 -0600 + message: + Merged NaCl's branch, which resulted in no changes. :) + ------------------------------------------------------------ + revno: 203.1.48 + committer: Robby Workman + branch nick: experimental-rworkman + timestamp: Sun 2009-01-25 15:25:58 -0600 + message: + Merged mainline experimental changes. + ------------------------------------------------------------ + revno: 203.1.47 + committer: Robby Workman + branch nick: experimental-rworkman + timestamp: Sat 2009-01-24 22:11:33 -0600 + message: + Merged bugfix from mainline experimental. + ------------------------------------------------------------ + revno: 203.1.46 + committer: Robby Workman + branch nick: experimental-rworkman + timestamp: Sat 2009-01-24 20:36:55 -0600 + message: + s/subversion/bzr/ in INSTALL file. Possibly more changes coming... + ------------------------------------------------------------ + revno: 203.1.45 + committer: Robby Workman + branch nick: experimental-rworkman + timestamp: Sat 2009-01-24 11:27:41 -0600 + message: + Merged latest changes from NaCl's branch. + ------------------------------------------------------------ + revno: 265.1.1 + committer: Adam Blackburn + branch nick: 1.6-clean + timestamp: Sat 2009-01-31 15:58:07 +0800 + message: + Merged NaCl's curses branch + ------------------------------------------------------------ + revno: 202.1.68 + committer: Andrew Psaltis + branch nick: experimental-nacl + timestamp: Sat 2009-01-31 02:13:18 -0500 + message: + Merged with r265 of mainline 1.6, providing PyLintish fixes + ------------------------------------------------------------ + revno: 202.1.67 + committer: Andrew Psaltis + branch nick: experimental-nacl + timestamp: Sat 2009-01-31 02:07:50 -0500 + message: + curses/wicd-curses.py: + Made the tagged wireless network actually show the network we're connected to, + or not, as the case may be. + Added ' -- ' to the upper statusbar + + Also, in the last commit, configscript_curses should be netentry_curses + ------------------------------------------------------------ + revno: 202.1.66 + committer: Andrew Psaltis + branch nick: experimental-nacl + timestamp: Sat 2009-01-31 01:33:11 -0500 + message: + curses/configscript_curses.py: + Added translations + Removed the redundant run() function in WirelessSettingsDialog + curses/wicd-curses.py: + Added translations, some still missing. + wicd/misc.py: + Added some translations that are not in the database, but are in the translator + ------------------------------------------------------------ + revno: 202.1.65 + committer: Andrew Psaltis + branch nick: experimental-nacl + timestamp: Fri 2009-01-30 23:48:44 -0500 + message: + Merged with r264 of the mainline, providing a bugfix. + ------------------------------------------------------------ + revno: 202.1.64 + committer: Andrew Psaltis + branch nick: experimental-nacl + timestamp: Fri 2009-01-30 23:46:07 -0500 + message: + curses/configscript_curses.py: + Fixed the typo that rworkman noticed. + curses/wicd-curses.py: + Ensured that the upper status bar updates itself immediately after a + connection is made, as opposed to a second or two after the fact + curses/README: Added a FAQ and added the new keybindings + in/man=wicd-curses.8.in: Added the new keybindings + ------------------------------------------------------------ + revno: 202.1.63 + committer: Andrew Psaltis + branch nick: experimental-nacl + timestamp: Fri 2009-01-30 00:30:33 -0500 + message: + curses/wicd-curses.py: + Added some stuff to the help dialog. + '?' and 'h' now raise the help dialog + 'q' now quits the client. + Keymaps are now colored white in the help dialog. + ------------------------------------------------------------ + revno: 202.1.62 + committer: Andrew Psaltis + branch nick: experimental-nacl + timestamp: Thu 2009-01-29 23:29:58 -0500 + message: + Merged with r263 of the mainline 1.6 branch, which (somehow) contains more changes than what I originally had in "r265". + ------------------------------------------------------------ + revno: 202.1.61 + committer: Andrew Psaltis + branch nick: experimental-nacl + timestamp: Thu 2009-01-29 23:25:02 -0500 + message: + curses/wicd-curses.py: + Applied some typographical changes from rworkman + Fixed the script showing dialog for wireless networks. + ------------------------------------------------------------ + revno: 202.1.60 + committer: Andrew Psaltis + branch nick: experimental-nacl + timestamp: Thu 2009-01-29 15:55:32 -0500 + message: + Merged in (only) r261 of rworkman's branch, which quotes the strings in the wicd-client script. + + Also, the revision numbers of the mainline have changed on me. r263 contained all of the translations that I requested. + ------------------------------------------------------------ + revno: 202.1.59 + committer: Andrew Psaltis + branch nick: experimental-nacl + timestamp: Tue 2009-01-27 21:50:24 -0500 + message: + Merged with r265 of mainline 1.6, giving me most of the remaining translations that I need. + ------------------------------------------------------------ + revno: 202.1.58 + committer: Andrew Psaltis + branch nick: experimental-nacl + timestamp: Tue 2009-01-27 21:46:52 -0500 + message: + wicd/misc.py: + Fixed a typo in get_language_list_gui + (%CURSES_REVNO%) + curses/wicd-curses.py: + Added in some translations (not done yet) + curses/prefs_curses.py: + Added all of the translations + Removed the warning about changing the backends (since it is useless) + ------------------------------------------------------------ + revno: 202.1.57 + committer: Andrew Psaltis + branch nick: experimental-nacl + timestamp: Mon 2009-01-26 23:43:40 -0500 + message: + Merged with r262 of mainline 1.6, which adds some bugfixes and the translations I need for my next commit. + ------------------------------------------------------------ + revno: 202.1.56 + committer: Andrew Psaltis + branch nick: experimental-nacl + timestamp: Sun 2009-01-25 23:07:47 -0500 + message: + Merged with r260 of the mainline 1.6 branch. + ------------------------------------------------------------ + revno: 202.1.55 + committer: Andrew Psaltis + branch nick: experimental-nacl + timestamp: Sun 2009-01-25 23:05:46 -0500 + message: + curses/prefs_curses.py: Added support for the "Prefer Wired Networks" function. + ------------------------------------------------------------ + revno: 202.1.54 + committer: Andrew Psaltis + branch nick: experimental-nacl + timestamp: Sun 2009-01-25 17:37:23 -0500 + message: + Merged with r254 of mainline 1.6 branch. + ------------------------------------------------------------ + revno: 202.1.53 + committer: Andrew Psaltis + branch nick: experimental-nacl + timestamp: Fri 2009-01-23 22:18:18 -0500 + message: + Merged with r247 of rworkman's branch, which: + Adds ~crux support to setup.py + Slightly reformats the wicd-client.1 man page, and fixes a spelling error + Fixes some stuff in the wicd-client script. I just accepted the other "nitpicks", too. + + I do not know why the wicd.glade file was changed. + There were conflicts in merging of the wicd-client script and man page. + ------------------------------------------------------------ + revno: 203.1.44 + committer: Robby Workman + branch nick: experimental-rworkman + timestamp: Fri 2009-01-23 16:06:53 -0600 + message: + Fix a misspelling in wicd-client.1, and add linewraps at <80 chars + in the raw text. + ------------------------------------------------------------ + revno: 203.1.43 + committer: Robby Workman + branch nick: experimental-rworkman + timestamp: Fri 2009-01-23 16:04:07 -0600 + message: + Some nitpick edits to wicd-client's section that checks for X and offers + to launch the curses client. This is largely personal preference, so + no offense will be taken by merge refusal, but I'm not convinced that + "friendliness" belongs in the file comments :-) + ------------------------------------------------------------ + revno: 203.1.42 + committer: Robby Workman + branch nick: experimental-rworkman + timestamp: Fri 2009-01-23 15:45:25 -0600 + message: + Merged r250 of mainline. + ------------------------------------------------------------ + revno: 203.1.41 + committer: Robby Workman + branch nick: experimental-rworkman + timestamp: Thu 2009-01-22 23:58:32 -0600 + message: + Merged Dan's latest commit to mainline. + ------------------------------------------------------------ + revno: 203.1.40 + committer: Robby Workman + branch nick: experimental-rworkman + timestamp: Wed 2009-01-21 22:35:46 -0600 + message: + Added crux support to setup.py + ------------------------------------------------------------ + revno: 203.1.39 + committer: Robby Workman + branch nick: experimental-rworkman + timestamp: Wed 2009-01-21 22:12:51 -0600 + message: + Merged latest changes from NaCl's branch. + ------------------------------------------------------------ + revno: 203.1.38 + committer: Robby Workman + branch nick: experimental-rworkman + timestamp: Thu 2009-01-15 00:14:24 -0600 + message: + Merged latest from NaCl's branch. + ------------------------------------------------------------ + revno: 203.1.37 + committer: Robby Workman + branch nick: experimental-rworkman + timestamp: Mon 2009-01-12 13:49:47 -0600 + message: + Merged networking.py patch from experimental to address bug 315238. + ------------------------------------------------------------ + revno: 203.1.36 + committer: Robby Workman + branch nick: experimental-rworkman + timestamp: Mon 2009-01-12 00:21:09 -0600 + message: + Merged NaCl's latest revision (used bzr merge --weave as it handled the + conflicts much better) (and no, I'm not even sure *why* there were + conflicts). + ------------------------------------------------------------ + revno: 203.1.35 + committer: Robby Workman + branch nick: experimental-rworkman + timestamp: Mon 2009-01-12 00:17:20 -0600 + message: + Merged Adam's latest 1.6-noexpander branch. There was a conflict in + data/wicd.glade around line 450-something -- the y_options flag was + removed in the noexpander branch. I wasn't sure whether that was + intentional or not, so I left it in to resolve the conflict. If that + was the wrong decision, it can be fixed later :) + ------------------------------------------------------------ + revno: 203.1.34 + committer: Robby Workman + branch nick: experimental-rworkman + timestamp: Mon 2009-01-12 00:16:34 -0600 + message: + Merged upstream experimental branch. + ------------------------------------------------------------ + revno: 203.1.33 + committer: Robby Workman + branch nick: experimental-rworkman + timestamp: Wed 2009-01-07 22:26:31 -0600 + message: + Merged r238 of NaCl's branch. + ------------------------------------------------------------ + revno: 202.1.52 + committer: Andrew Psaltis + branch nick: experimental-nacl + timestamp: Fri 2009-01-23 22:13:27 -0500 + message: + setup.py: + Added support for keeping track of the revisions of the curses client + (%CURSES_REVNO%) + curses/wicd-curses.py: + Added the ad-hoc controls to the Help dialog + Set wireless scans to be synchronous (True), to adapt to an API change in mainline + Added support for OptionParser, added and implemented the option that was + described in the man page (and -h (help) and --version) + in/wicd=wpath.py.in: Added a curses_revision flag + in/man=wicd-curses.8.in: + Option parsing has been implemented. Added the %CURSES_REVNO% flag to the man page. + Fixed an accidental " added to one of the headers + ------------------------------------------------------------ + revno: 202.1.51 + committer: Andrew Psaltis + branch nick: experimental-nacl + timestamp: Fri 2009-01-23 21:13:36 -0500 + message: + Ad-hoc network support is added ("O"). + This commit is should be the last one containing new interface elements. :-D + This also may not work directly from the install. I need to change some stuff + first. + curses/curses_misc.py: + Fixed bug in Dialog2 where mouse clicks would cause the program to crash + Added DynEdit and DynIntEdit, Simple DynWrapped widgets, nothing special + about them + curses/wicd-curses.py: + Added support for Ad-Hoc network controls (I don't know exactly how this + works) + curses/README,TODO,in/man=wicd-curses.8.in: + Ad-Hoc network support has been added + ------------------------------------------------------------ + revno: 202.1.50 + committer: Andrew Psaltis + branch nick: experimental-nacl + timestamp: Fri 2009-01-23 09:30:39 -0500 + message: + Merged with r250 of the mainline experimental branch. + ------------------------------------------------------------ + revno: 202.1.49 + committer: Andrew Psaltis + branch nick: experimental-nacl + timestamp: Wed 2009-01-21 00:09:45 -0500 + message: + Merged with r247 of mainline experimental (1.6) branch. + + -------------- This line and the following will be ignored --------- + added: + wicd/guiutil.py + modified: + encryption/templates/ttls + setup.py + wicd/configmanager.py + wicd/dbusmanager.py + wicd/gui.py + wicd/misc.py + wicd/monitor.py + wicd/netentry.py + wicd/networking.py + wicd/prefs.py + wicd/wicd-client.py + wicd/wicd-daemon.py + wicd/wnettools.py + unknown: + build/ + install.log + uninstall.log + vcsinfo.py + wpath.py + curses/bzr_commit + curses/configscript.py + curses/current.diff + init/arch/wicd + init/debian/wicd + init/default/wicd + init/gentoo/wicd + init/pld/wicd + init/redhat/wicd + init/slackware/rc.wicd + init/suse/wicd + man/wicd-curses.8 + man/wicd-manager-settings.conf.5 + man/wicd-wired-settings.conf.5 + man/wicd-wireless-settings.conf.5 + man/wicd.8 + other/50-wicd-suspend.sh + other/55wicd + other/80-wicd-connect.sh + other/WHEREAREMYFILES + other/postinst + other/wicd.conf + scripts/wicd + scripts/wicd-client + scripts/wicd-curses + wicd/wpath.py + pending merges: + Dan O'Reilly 2009-01-20 Add missing guiutil module + Dan O'Reilly 2009-01-20 Add support for writing config data with whitespace kep... + Dan O'Reilly 2009-01-19 Fix a few typos in the option gateway code. + Dan O'Reilly 2009-01-19 Fix bug that was keeping DHCP release from working. + Dan O'Reilly 2009-01-19 Fix ttls template + ------------------------------------------------------------ + revno: 202.1.48 + committer: Andrew Psaltis + branch nick: experimental-nacl + timestamp: Tue 2009-01-20 23:41:44 -0500 + message: + curses/curses_misc.py: + Added support for setting the text in the input dialog + Changed "body" to "parent" in ComboBox. + set_focus() unconditionally sets the focus now + Moved error() to this file. It fits better here, anyway. + Reverted TextDialog to its previous state + curses/netentry_curses.py: + Moved error() to curses_misc.py + curses/wicd-curses.py: + "Deimplemented" the script configurator, at the suggestion of various folks + #wicd, and replaced it with a simple instructions dialog. My original code + is still there, just commented out. + Added support for renaming wired network profiles (F2 when over the combo box) + Fixed various issues caused when deleting wired network profiles. + Refactored the help/about dialogs to support the old TextDialog + curses/README, in/man=wicd-curses.8.in: + Script configurator has been "changed" + ------------------------------------------------------------ + revno: 202.1.47 + committer: Andrew Psaltis + branch nick: experimental-nacl + timestamp: Sat 2009-01-17 20:10:10 -0500 + message: + curses/configscript_curses.py: ADDED. Script configurator. More or less done. + curses/wicd-curses.py: + Added suport for the script configurator + curses/README, in/man=wicd-curses.8.in: + Script configurator now active + setup.py: Install configscript_curses.py with the rest of the stuff + ------------------------------------------------------------ + revno: 202.1.46 + committer: Andrew Psaltis + branch nick: experimental-nacl + timestamp: Sat 2009-01-17 15:15:14 -0500 + message: + Merged with r242 of mainline experimental (1.6) branch. + ------------------------------------------------------------ + revno: 202.1.45 + committer: Andrew Psaltis + branch nick: experimental-nacl + timestamp: Sat 2009-01-17 15:13:53 -0500 + message: + Wired network control support is now more-or-less complete + curses/curses_misc.py: + Made set_focus() actually set the focus + Added ability for combobox to rebuild itself + curses/netentry_curses: + Added WiredSettingsDialog. Sometimes, the "Defaultness" of the network + takes a little while to show up in the dialog. Don't know why yet. + Reorganized some of the AdvancedSettingsDialog code + curses/wicd-curses.py: + Reactivated WiredComboBox + Added support for WiredSettingsDialog + Added ability to create and delete wired network profiles + Fixed bug where the program could crash on the end of scanning networks if + timing is slightly off + Display the screen locker immediately after initiating a scan + curses/README,TODO: Wired network support is complete + in/man=wicd-curses.8.in: + Wired network support is now complete + Added revision information to the bottom of the man page + ------------------------------------------------------------ + revno: 202.1.44 + committer: Andrew Psaltis + branch nick: experimental-nacl + timestamp: Fri 2009-01-16 12:09:20 -0500 + message: + Merged with mainline 1.6 branch, r241, adding in the noexpander stuff + ------------------------------------------------------------ + revno: 202.1.43 + committer: Andrew Psaltis + branch nick: experimental-nacl + timestamp: Thu 2009-01-15 21:46:35 -0500 + message: + curses/wicd-curses.py: ListBox focus-maintaining code completely debugged + ------------------------------------------------------------ + revno: 202.1.42 + committer: Andrew Psaltis + branch nick: experimental-nacl + timestamp: Tue 2009-01-13 18:13:24 -0500 + message: + curses/curses_misc.py: + Modified TextDialog to use a listbox as opposed to one long text box + Aligned the header on the right in Dialog2 by default + curses/wicd-curses.py: + Removed the traceback if the user presses ctrl+c + Refactored about_dialog to support the modified TextDialog + Added a help dialog. Raise it with "H" + Refactored some code in the appGUI constructor so that I can recycle update_netlist() + curses/TODO, curses/README, in/man=wicd-curses.8.in: + Help dialog now active + in/man=wicd-curses.8.in: Removed redundant scipt selector command + ------------------------------------------------------------ + revno: 202.1.41 + committer: Andrew Psaltis + branch nick: experimental-nacl + timestamp: Tue 2009-01-13 15:53:10 -0500 + message: + Merged with r239 of mainline experimental. + ------------------------------------------------------------ + revno: 202.1.40 + committer: Andrew Psaltis + branch nick: experimental-nacl + timestamp: Sun 2009-01-11 19:40:29 -0500 + message: + Progress is being made, apparently + curses/curses_misc.py: + Made Dialog a bit more generic with the new Dialog2, also supports mouse events. + Included TextDialog and InputDialog as subclasses of Dialog2 + curses/netentry_curses.py: + Changed error() to support Dialog2 + Added support for mouse events + curses/prefs_curses.py: + Added support for mouse events + curses/wicd-curses.py: + Added support for wicd's hidden wireless-network functionality + (Really) finished refactoring for the changes in ComboBox + Made some transitions a bit more immediate by calling update_ui() manually + Refactored to about_dialog to support Dialog2 + Added support for mouse events (clicking to select, mostly) + Added support for retaining current list netlist focus throughout screen updates + (Hopefully) Added support for handling an instance of 0 available wireless + networks + in/man=wicd-curses.8.in: Hidden network support is fully functional + man/wicd-client.1: Added a word. (You'll live.) + setup.py: From last commit: Added the python "shebang" to the top of the file + ------------------------------------------------------------ + revno: 202.1.39 + committer: Andrew Psaltis + branch nick: experimental-nacl + timestamp: Sun 2009-01-11 13:05:01 -0500 + message: + curses/prefs_curses.py: + Finished refactoring to accommodate the ComboBox changes + curses/wicd-curses.py: + Moved some of the keybinding code around + in/other=WHEREAREMYFILES.in: ADDED. + File telling the user where the wicd config files are. Usually symlinked to + ~/.wicd/WHEREAREMYFILES and installed to the documentation directory + in/scripts=wicd-client.in: + Make ~/.wicd and link WHEREAREMYFILES if it has not been done so already. + Start wicd-curses if there is no X server on this console + (determined by the presence of $DISPLAY), and add a file detailing this + man/wicd-client.1: Added note about wicd-client starting wicd-curses + setup.py: Install WHEREAREMYFILES along with the rest of the documentation + ------------------------------------------------------------ + revno: 202.1.38 + committer: Andrew Psaltis + branch nick: experimental-nacl + timestamp: Fri 2009-01-09 20:43:18 -0500 + message: + Forgot to mention something in the last commit: + in/wicd-curses.8.in: added more unimplemented keystrokes + Merged with r238 of the main experimental (1.6) branch. + ------------------------------------------------------------ + revno: 202.1.37 + committer: Andrew Psaltis + branch nick: experimental-nacl + timestamp: Fri 2009-01-09 20:42:12 -0500 + message: + curses/curses_misc.py: + Refactored some ComboBox internals + Renamed show_first to focus in ComboBox + Added callback support + curses/netentry_curses.py: + Renamed NetEntryBase to AdvancedSettingsDialog, and WirelessNetEntry to + WirelessSettingsDialog + The "WirelessSettingsDialog" is complete. :-) Raise it by pressing "C" on a wireless + network. Much of the code was taken from netentry.py. The buttons aren't pretty + like they are in the Preferences Dialog, but they are fully functional. + curses/prefs_curses.py: + Refactored to accommodate the ComboBox changes + Added a warning about changing backends + curses/wicd-curses.py: + Refactored to accommodate changes to the rest of the program + Added a constantly displayed message saying how to exit the program, other than + ctrl+c + curses/TODO: Removed a bunch of stuff that is already implemented, added some stuff that + needs to be implemented + curses/README: Added/clearified some things + ------------------------------------------------------------ + revno: 202.1.36 + committer: Andrew Psaltis + branch nick: experimental-nacl + timestamp: Tue 2009-01-06 19:04:12 -0500 + message: + Merged with r235 of experimental-rworkman. + ------------------------------------------------------------ + revno: 203.1.32 + committer: Robby Workman + branch nick: experimental-rworkman + timestamp: Mon 2009-01-05 23:12:49 -0600 + message: + Added logic for kde4-config (kde4's equivalent to kde-config) + ------------------------------------------------------------ + revno: 203.1.31 + committer: Robby Workman + branch nick: experimental-rworkman + timestamp: Mon 2009-01-05 10:25:59 -0600 + message: + Merged latest changes from NaCl. + ------------------------------------------------------------ + revno: 203.1.30 + committer: Robby Workman + branch nick: experimental-rworkman + timestamp: Sun 2009-01-04 02:31:01 -0600 + message: + s/Tenative/Tentative/g in wicd-curses(8) + ------------------------------------------------------------ + revno: 203.1.29 + committer: Robby Workman + branch nick: experimental-rworkman + timestamp: Sun 2009-01-04 02:27:44 -0600 + message: + Merged latest nacl branch. + ------------------------------------------------------------ + revno: 203.1.28 + committer: Robby Workman + branch nick: experimental-rworkman + timestamp: Sat 2009-01-03 00:08:53 -0600 + message: + Removed a blank line from the end of the slackware init script. + Trivial, but annoying on upgrades for the config() .new stuff. + ------------------------------------------------------------ + revno: 203.1.27 + committer: Robby Workman + branch nick: experimental-rworkman + timestamp: Fri 2009-01-02 21:43:55 -0600 + message: + Merged in the frankencurses branch, which is basically NaCl's branch + plus integration with setup.py and related files. + ------------------------------------------------------------ + revno: 203.1.26 + committer: Robby Workman + branch nick: experimental-rworkman + timestamp: Fri 2009-01-02 20:54:12 -0600 + message: + Merged mainline r237 (which includes the changes from here). + ------------------------------------------------------------ + revno: 202.1.35 + committer: Andrew Psaltis + branch nick: experimental-nacl + timestamp: Tue 2009-01-06 19:02:27 -0500 + message: + Checkpoint in WirelessNetEntry development + curses/curses_misc.py: + Refactored some DynWrap internals + Added MaskingEdit, a password edit + Modified ComboBox to use a DynWrap internally instead of an AttrWrap + curses/netentry_curses.py: + Added most of the WirelessNetEntry. It doesn't save information yet, but it does + load most of it. Support for viewing the templated network settings is not + implemented yet. + curses/wicd-curses.py: + Activated support for the WirelessNetEntry configurator. The wired one is not + implemented yet. + ------------------------------------------------------------ + revno: 202.1.34 + committer: Andrew Psaltis + branch nick: experimental-nacl + timestamp: Sun 2009-01-04 20:36:12 -0500 + message: + in/man=wicd-curses.8.in: Apparently I can't spell "tentative" properly. Thanks to rworkman. + ------------------------------------------------------------ + revno: 202.1.33 + committer: Andrew Psaltis + branch nick: experimental-nacl + timestamp: Sun 2009-01-04 20:33:31 -0500 + message: + curses/curses_misc.py: + Added DynWrapper, a wrapper class with which we can dynamically change the + selectability of a widget. + Removed ToggleEdit, replaced by DynWrapper. + curses/netentry_curses.py: ADDED. Network entry configurator dialog. + Has a base class for the common elements of the wired/wireless NetEntries. + curses/prefs_curses.py: Replaced ToggleEdits with DynWrapped Edits. + curses/wicd-curses.py: + Rebuilt the connect function into the main keyhandler. I discovered that + implementing that the way I had previously done it would have made + displaying the dialogs a bit more difficult + Added support for running the NetEntry selector + in/man=wicd-curses.8.in, curses/README: + Modified to say that the NetEntry dialog is now a WIP (Raise it with 'C') + setup.py: + Install netentry_curses.py if we are installing the rest of the curses client + Install the man page only if we want to install the rest of the man pages and + the curses client + ------------------------------------------------------------ + revno: 202.1.32 + committer: Andrew Psaltis + branch nick: experimental-nacl + timestamp: Sat 2009-01-03 22:57:41 -0500 + message: + curses/curses_misc.py: + meta+left/right now sets focus back to whereever you were in the list. + curses/wicd-curses.py: + Made a custom combobox for the wired networks. The one during the last commit was actually the wireless list. + (Hopefully) made the wired network show up when it is actually active. + Removed appGUI.call_connect and appGUI.connect. They are no longer needed. + in/man=wicd-curses.8.in: ADDED. wicd-curses(8) man page + setup.py: Install the above man page if we are installing the rest of the curses client + ------------------------------------------------------------ + revno: 202.1.31 + committer: Andrew Psaltis + branch nick: experimental-nacl + timestamp: Fri 2009-01-02 22:47:06 -0500 + message: + Merged from rworkman's frankencurses branch. + Includes features from experimental-rworkman + Curses client installs now. :-) + Includes r237 of experimental (1.6) + ------------------------------------------------------------ + revno: 234.1.6 + committer: Robby Workman + branch nick: frankencurses + timestamp: Fri 2009-01-02 21:22:17 -0600 + message: + Merged in latest from NaCl's branch. + ------------------------------------------------------------ + revno: 234.1.5 + committer: Robby Workman + branch nick: frankencurses + timestamp: Fri 2009-01-02 20:57:47 -0600 + message: + Merged r237 of mainline. + ------------------------------------------------------------ + revno: 234.1.4 + committer: Robby Workman + branch nick: frankencurses + timestamp: Fri 2009-01-02 20:25:16 -0600 + message: + Removed "in keys" from line 415 per NaCl's suggestion. + ------------------------------------------------------------ + revno: 234.1.3 + committer: Robby Workman + branch nick: experimental-curses + timestamp: Thu 2009-01-01 02:02:26 -0600 + message: + Fixed up setup.py and wpath.py to install the curses client. + Added a wicd-curses wrapper script to /usr/bin + Made curses *.py files executable + All of this passes the build test, but not the "WFM" test. :) + ------------------------------------------------------------ + revno: 234.1.2 + committer: Robby Workman + branch nick: experimental-curses + timestamp: Thu 2009-01-01 01:43:00 -0600 + message: + Merged my experimental branch into this. + ------------------------------------------------------------ + revno: 234.1.1 + committer: Robby Workman + branch nick: experimental-curses + timestamp: Thu 2009-01-01 01:42:20 -0600 + message: + Merged NaCl's curses branch into this. + ------------------------------------------------------------ + revno: 202.1.30 + committer: Andrew Psaltis + branch nick: experimental-nacl + timestamp: Fri 2009-01-02 22:12:58 -0500 + message: + curses/curses_misc.py: + meta+right or meta+left now move the selected tab right and left respectively. Focus goes back to the tabs, though. + Fixed a bug in ComboBox where show_first does nothing + Restored get_selected to its original state + curses/prefs_curses.py: + Moved the automatic reconnect category to "General Settings" + Made the backend selector actually select the selected backend at first + Reset the button statuses each time we load the settings + meta+enter now saves+closes the preferences dialog + curses/wicd-curses.py: + Turned the wired list into a list of custom SelTexts, so that they can do the connecting/script-choosing/configuring/etc, instead of the dialog itself + Offset the version in the about dialog a little less + Recycle the old preferences dialog instead of making a new one if we run it more than once + ------------------------------------------------------------ + revno: 202.1.29 + committer: Andrew Psaltis + branch nick: experimental-nacl + timestamp: Thu 2009-01-01 00:36:08 -0500 + message: + curses/*.py: updated copyrights to include 2009 + curses/wicd-curses.py: Fixed missing comma in the About Dialog text + ------------------------------------------------------------ + revno: 202.1.28 + committer: Andrew Psaltis + branch nick: experimental-nacl + timestamp: Thu 2009-01-01 00:30:53 -0500 + message: + curses/curses_misc.py: + Added a Dialog class, mostly borrowed from a urwid example + curses/prefs_curses.py: + Added the DNS domain to the dialog, as was done in the GTK UI + curses/wicd-curses.py: + Added a semi-pretty about dialog. + curses/README: Activating about dialog is done by "A" + ------------------------------------------------------------ + revno: 202.1.27 + committer: Andrew Psaltis + branch nick: experimental-nacl + timestamp: Wed 2008-12-31 18:43:15 -0500 + message: + Merged with experimental (1.6) branch, r234. + ------------------------------------------------------------ + revno: 202.1.26 + committer: Andrew Psaltis + branch nick: experimental-nacl + timestamp: Tue 2008-12-30 23:12:42 -0500 + message: + curses/README: Actually changed the text in the file. + Merged with experimental (1.6) branch, r233. Mmmm... wpathenhancements + ------------------------------------------------------------ + revno: 202.1.25 + committer: Andrew Psaltis + branch nick: experimental-nacl + timestamp: Tue 2008-12-30 23:10:18 -0500 + message: + curses/curses_misc.py: + Added a get_edit_text function to ToggleEdit. + Changed the get_selected function in ComboBox to return the index only. + curses/prefs_curses.py: + Completed the load+save functions of the UI + Buttons are now functional. Only selecting the OK button will save the data for now. + curses/wicd-curses.py: + Added support for the "Always Show Wired Interface" config option + Completed support for the preferences dialog + curses/TODO,README: Preferences dialog is done. :-) + ------------------------------------------------------------ + revno: 202.1.24 + committer: Andrew Psaltis + branch nick: experimental-nacl + timestamp: Tue 2008-12-30 21:27:41 -0500 + message: + Yet another checkpoint in building the Preferences Dialog up to completion. Some of the code isn't used yet, but this should all be done relatively soon. + curses/curses_misc.py: + Added a function in the ToggleEdit to set its text to something + Changed the name of ComboText to ComboBox + Provided the ability to generate the initial parts of a ComboBox w/o needing the screen. + Added ComboBoxException, a simple derived exception for the ComboBox. Used it to die of the user never called build_combobox() + curses/prefs_curses.py: + Changed the names of some of the widgets. + Adjusted the code to use the modified ComboBox widget + curses/wicd-curses.py: + Adjusted the code to use the modified ComboBox widget + ------------------------------------------------------------ + revno: 202.1.23 + committer: Andrew Psaltis + branch nick: experimental-nacl + timestamp: Mon 2008-12-29 22:05:48 -0500 + message: + Merged with experimental (1.6) branch (r232). + ------------------------------------------------------------ + revno: 202.1.22 + committer: Andrew Psaltis + branch nick: experimental-nacl + timestamp: Mon 2008-12-29 22:04:40 -0500 + message: + Checkpoint in getting the Preferences dialog functional. There's still some tweaking left to do. + curses/curses_misc.py: Changed the internal layout of the widgets to allow me to stick buttons on the bottom. + curses/prefs_curses.py: Added rudimentary Dbus support to the dialog. + Started getting the config settings to save to wicd. + Added buttons (which don't do anything yet). + The PrefOverlay has been renamed to PrefsDialog. The PrefsDialog widget is wrapped around a TabColumns widget. + Added a main entry point into the file to allow for somewhat easier testing. It can now be called indepentently of wicd-curses, if needed. + curses/wicd-curses.py: Undid a change that caused the ESC key to disconnect from the current network, in addition to its current function. + ------------------------------------------------------------ + revno: 202.1.21 + committer: Andrew Psaltis + branch nick: experimental-nacl + timestamp: Sun 2008-12-28 12:26:21 -0500 + message: + Merged with experimental (1.6) branch (r231). + ------------------------------------------------------------ + revno: 202.1.20 + committer: Andrew Psaltis + branch nick: experimental-nacl + timestamp: Sun 2008-12-28 11:36:41 -0500 + message: + curses/wicd-curses.py: Fixed a problem where any use of the wired network combo box would prevent connecting to wired networks. + Added some semblance of a "working" indicator while connecting, a simple |,/,-,\,|,/,... + ------------------------------------------------------------ + revno: 202.1.19 + committer: Andrew Psaltis + branch nick: experimental-nacl + timestamp: Sat 2008-12-27 22:35:58 -0500 + message: + curses/curses_misc.py: Added a tabbed interface widget for use in the preferences dialog. + curses/prefs_curses.py: Converted the code to use the tabbed interface found in curses_misc.py. The dialog now fills up the terminal, but it still does nothing. + curses/wicd-curses.py: Turned the "list" wired section of the interface to a combo box. + ------------------------------------------------------------ + revno: 202.1.18 + committer: Andrew Psaltis + branch nick: experimental-nacl + timestamp: Sat 2008-12-27 00:18:03 -0500 + message: + curses/curses_misc.py: ADDED. Various urwid classes that I use throughout the program. + curses/prefs_curses.py: Frontend is complete. However, it is still missing buttons and the ability to save information. Removed code that is now in curses_misc.py. + curses/wicd-curses.py: Removed code that is now in curses_misc.py. Tweaked the visuals a little bit. + curses/README: Preferences configuration is a WIP now. + curses/TODO: A combo box has been implemented in curses_misc.py, so that part has been removed. Also added a part about making a man page. + ------------------------------------------------------------ + revno: 202.1.17 + committer: Andrew Psaltis + branch nick: experimental-nacl + timestamp: Fri 2008-12-26 14:18:40 -0500 + message: + curses/prefs_curses.py: Forgot the license. ^_^ + ------------------------------------------------------------ + revno: 202.1.16 + committer: Andrew Psaltis + branch nick: experimental-nacl + timestamp: Fri 2008-12-26 13:53:25 -0500 + message: + Merged with experimental (1.6) branch (r229). + ------------------------------------------------------------ + revno: 202.1.15 + committer: Andrew Psaltis + branch nick: experimental-nacl + timestamp: Fri 2008-12-26 13:48:26 -0500 + message: + curses/prefs_curses.py: ADDED. A basic global preferences dialog. Has a tabbed interface. It is missing things such as buttons, external program controls, advanced settings, and the ability to save information. :-) + curses/wicd-curses.py: Some code cleanup, replaced the language mess with the GUI list in misc, and added support for running the Preferences dialog with 'P'. + curses/README: Added the keybindings to bring up the preferences dialog. + ------------------------------------------------------------ + revno: 202.1.14 + committer: Andrew Psaltis + branch nick: experimental-nacl + timestamp: Tue 2008-12-23 21:24:49 -0500 + message: + Merged with the 1.6 sources (r227), and + curses/wicd-curses.py: modified the program so that it can run off of the experimental API. + Cleaned up some of the code. + ------------------------------------------------------------ + revno: 202.1.13 + committer: Andrew Psaltis + branch nick: experimental-nacl + timestamp: Mon 2008-12-22 18:27:05 -0500 + message: + Merged with experimental (r219). + ------------------------------------------------------------ + revno: 202.1.12 + committer: Andrew Psaltis + branch nick: experimental-nacl + timestamp: Sat 2008-12-20 16:32:19 -0500 + message: + Big one this time. Hopefully I got everything. + curses/wicd.curses.py: + Added the full language component from wicd.misc into the file. + Added support for connecting to networks :-). + Added statusbar-updating support during connections. + Fixed a problem where an exception found before the UI is on-screen will cause another exception in wrap_exceptions. + Turned the footer into a ListBox, so that I can add more than more stuff to it more easily. + Rearranged the order of strings in the wireless connection part of the UI. + Added a bunch of keymappings to support all of the new functionality. + Made the UI updating function into an idle function, to better support the new functionality (and it eats up less CPU, too). + Some minor code cleanup throughout. + curses/README: Updated to correspond with new features + curses/TODO: Removed connection support from the TODO, added a few other things. + ------------------------------------------------------------ + revno: 202.1.11 + committer: Andrew Psaltis + branch nick: experimental-nacl + timestamp: Fri 2008-12-19 12:34:03 -0500 + message: + curses/wicd-curses.py: Redesigned the internal list so that the wired network information is always at the top, no matter the number of wireless networks present. + ------------------------------------------------------------ + revno: 202.1.10 + committer: Andrew Psaltis + branch nick: experimental-nacl + timestamp: Thu 2008-12-18 22:55:20 -0500 + message: + curses/wicd-curses.py: Moved the primary entry point to outside of the appGUI class, added some comments to improve code readability + ------------------------------------------------------------ + revno: 202.1.9 + committer: Andrew Psaltis + branch nick: experimental-nacl + timestamp: Thu 2008-12-18 16:39:24 -0500 + message: + curses/wicd-curses.py: Removed a lot of redundant code related to focus on the main ListBox widget. Set focus=True in the frame's rendering function + made everything so much easier. + ------------------------------------------------------------ + revno: 202.1.8 + committer: Andrew Psaltis + branch nick: experimental-nacl + timestamp: Thu 2008-12-18 00:07:00 -0500 + message: + curses/wicd-curses.py: fixed a bug (missing 'self.') in dbus_scan_finished + ------------------------------------------------------------ + revno: 202.1.7 + committer: Andrew Psaltis + branch nick: experimental-nacl + timestamp: Wed 2008-12-17 11:27:09 -0500 + message: + curses/wicd-curses.py: Added code to restore the console on all errors, and then print them, including KeyboardInterrupts. + curses/TODO: Removed the above from TODO + ------------------------------------------------------------ + revno: 202.1.6 + committer: Andrew Psaltis + branch nick: experimental-nacl + timestamp: Wed 2008-12-17 10:30:55 -0500 + message: + Merged with experimental (r216) + ------------------------------------------------------------ + revno: 202.1.5 + committer: Andrew Psaltis + branch nick: experimental-nacl + timestamp: Mon 2008-12-15 17:50:00 -0500 + message: + curses/wicd-curses.py: Colorized the network we're currently connected to. + That network is now updated every time that wicd tells us that the "status" has changed. + Network connection status is now updated every 2 seconds, instead of every 0.5. + ------------------------------------------------------------ + revno: 202.1.4 + committer: Andrew Psaltis + branch nick: experimental-nacl + timestamp: Sun 2008-12-14 01:04:23 -0500 + message: + curses/wicd-curses.py: Cleaned up code for the Net/ListElements. Added '>' to mark to currently selected network. Set gen_network_list() to output signal quality in units specified in the config. + ------------------------------------------------------------ + revno: 202.1.3 + committer: Andrew Psaltis + branch nick: experimental-nacl + timestamp: Sat 2008-12-13 16:06:11 -0500 + message: + curses/wicd-curses.py: Add gobject.MainLoop support, and enable the D-Bus function connections (It works!). Various comments/code cleanup done. + curses/README: f5 refreshes the netlist now + curses/TODO: Added a bunch of features to implement, and removed one of them. + ------------------------------------------------------------ + revno: 202.1.2 + committer: Andrew Psaltis + branch nick: experimental + timestamp: Sat 2008-12-13 13:32:50 -0500 + message: + Merged with experimental (r207) + ------------------------------------------------------------ + revno: 202.1.1 + committer: Andrew Psaltis + branch nick: experimental + timestamp: Sat 2008-12-13 13:29:07 -0500 + message: + Let there be light! + curses/wicd-curses.py: ADDED (new (very incomplete) curses UI) + curses/README: ADDED (Simple README. Hope it says enough for the moment) + curses/TODO: ADDED (Simple, incomplete, TODO list) +------------------------------------------------------------ +revno: 268 +committer: Dan O'Reilly +branch nick: experimental +timestamp: Sun 2009-02-01 23:32:28 -0500 +message: + Remove some comments. +------------------------------------------------------------ +revno: 267 +committer: Dan O'Reilly +branch nick: experimental +timestamp: Sun 2009-02-01 23:10:11 -0500 +message: + Make it possible for the user to select which graphical sudo application to use. + Make any external apps not installed on the system unselectable in the GUI. + Rework the app selection code in the backend to fall back to auto-selection if a requested app isn't installed. + Tweak the autoconnect attempt throttle in wicd-monitor to not be as aggressive. + Made sure the preferences dialog would reconnect to dbus when a DaemonStarting signal was sent. +------------------------------------------------------------ +revno: 266 +committer: Dan O'Reilly +branch nick: experimental +timestamp: Sat 2009-01-31 20:22:15 -0500 +message: + Fix broken Scan() call in wicd-client +------------------------------------------------------------ +revno: 265 +committer: Dan O'Reilly +branch nick: experimental +timestamp: Sat 2009-01-31 00:31:50 -0500 +message: + A bunch of small fixes for errors/warnings reported by Pylint. +------------------------------------------------------------ +revno: 264 +committer: Dan O'Reilly +branch nick: experimental +timestamp: Fri 2009-01-30 21:20:43 -0500 +message: + Fix crash if essid is None +------------------------------------------------------------ +revno: 263 +committer: Dan O'Reilly +branch nick: experimental +timestamp: Wed 2009-01-28 19:54:17 -0500 +message: + Merge translations updates. + ------------------------------------------------------------ + revno: 260.1.5 + committer: Adam Blackburn + branch nick: 1.6 + timestamp: Tue 2009-01-27 14:22:10 +0800 + message: + Fixed another typo + ------------------------------------------------------------ + revno: 260.1.4 + committer: Adam Blackburn + branch nick: 1.6 + timestamp: Tue 2009-01-27 14:17:11 +0800 + message: + Fixed a typo + ------------------------------------------------------------ + revno: 260.1.3 + committer: Adam Blackburn + branch nick: 1.6 + timestamp: Tue 2009-01-27 14:15:30 +0800 + message: + Added a bunch more translations + ------------------------------------------------------------ + revno: 260.1.2 + committer: Adam Blackburn + branch nick: 1.6 + timestamp: Tue 2009-01-27 10:37:42 +0800 + message: + Merged to latest 1.6 + ------------------------------------------------------------ + revno: 260.1.1 + committer: Adam Blackburn + branch nick: 1.6 + timestamp: Tue 2009-01-27 10:35:08 +0800 + message: + Fixed a typo and added more translations +------------------------------------------------------------ +revno: 262 +committer: Dan O'Reilly +branch nick: experimental +timestamp: Wed 2009-01-28 19:52:51 -0500 +message: + Always scan when the daemon starts. + Remove old init scripts. +------------------------------------------------------------ +revno: 261 +committer: Dan O'Reilly +branch nick: experimental +timestamp: Mon 2009-01-26 18:46:57 -0500 +message: + Fix issues with the way disconnect scripts work. + Make flushing the route table more likely to work. +------------------------------------------------------------ +revno: 260 +committer: Adam Blackburn +branch nick: 1.6 +timestamp: Mon 2009-01-26 11:51:09 +0800 +message: + Added three new translations +------------------------------------------------------------ +revno: 259 +committer: Adam Blackburn +branch nick: 1.6 +timestamp: Mon 2009-01-26 11:15:35 +0800 +message: + Fixed some typos in the hidden network code and fix a bug if you try to start the tray icon without the daemon +------------------------------------------------------------ +revno: 258 +committer: Adam Blackburn +branch nick: 1.6 +timestamp: Mon 2009-01-26 10:54:38 +0800 +message: + Fixed a spacing issue in the preferences dialog +------------------------------------------------------------ +revno: 257 +committer: Dan O'Reilly +branch nick: experimental +timestamp: Sun 2009-01-25 16:43:45 -0500 +message: + Fixing the fix... +------------------------------------------------------------ +revno: 256 +committer: Dan O'Reilly +branch nick: experimental +timestamp: Sun 2009-01-25 16:40:26 -0500 +message: + Don't try to set properties in the advanced dialog before it exists. +------------------------------------------------------------ +revno: 255 +committer: Dan O'Reilly +branch nick: experimental +timestamp: Sun 2009-01-25 16:34:32 -0500 +message: + Fix issue where toggling default wired profile could cause settings to get set for multiple profiles. + Remove some no longer needed checks in the daemon. +------------------------------------------------------------ +revno: 254 +committer: Dan O'Reilly +branch nick: experimental +timestamp: Sun 2009-01-25 15:15:49 -0500 +message: + Add UI portion of wired switch feature. +------------------------------------------------------------ +revno: 253 +committer: Dan O'Reilly +branch nick: experimental +timestamp: Sun 2009-01-25 00:44:51 -0500 +message: + Add new wired GUI icon. +------------------------------------------------------------ +revno: 252 +committer: Dan O'Reilly +branch nick: experimental +timestamp: Sat 2009-01-24 23:54:57 -0500 +message: + Merge in improved wired profile UI + Tweak how wired profile list is built to be simple/more efficent and not cause a dbus error. + ------------------------------------------------------------ + revno: 250.1.2 + committer: Adam Blackburn + branch nick: 1.6 + timestamp: Sun 2009-01-25 12:03:01 +0800 + message: + Updated the wired profile Add/Delete system as per https://bugs.launchpad.net/wicd/+bug/318645 + ------------------------------------------------------------ + revno: 250.1.1 + committer: Adam Blackburn + branch nick: 1.6 + timestamp: Sun 2009-01-25 12:02:10 +0800 + message: + Removed vertical space between the DNS entriesw +------------------------------------------------------------ +revno: 251 +committer: Dan O'Reilly +branch nick: experimental +timestamp: Sat 2009-01-24 23:31:24 -0500 +message: + Initial work on automatic switchover to wired networks (no UI work yet) + actually use "write=True" instead of just "True" everywhere we do config writes explicitly. + Fix the scripts dialog not working for wired connections. + Force the monitor to update state after triggering a disconnect or connect. + Remove an unneeded Scan call from autoconnect.py +------------------------------------------------------------ +revno: 250 +committer: Dan O'Reilly +branch nick: experimental +timestamp: Fri 2009-01-23 08:35:28 -0500 +message: + Fix broken Scan() call in autoconnect.py +------------------------------------------------------------ +revno: 249 +committer: Dan O'Reilly +branch nick: experimental +timestamp: Thu 2009-01-22 21:51:03 -0500 +message: + Tweak a comment +------------------------------------------------------------ +revno: 248 +committer: Dan O'Reilly +branch nick: experimental +timestamp: Thu 2009-01-22 21:26:05 -0500 +message: + Tweak autoconnect logic be more likely to work if initial scans don't give us good results. +------------------------------------------------------------ +revno: 247 +committer: Dan O'Reilly +branch nick: experimental +timestamp: Tue 2009-01-20 23:55:43 -0500 +message: + Add missing guiutil module +------------------------------------------------------------ +revno: 246 +committer: Dan O'Reilly +branch nick: experimental +timestamp: Tue 2009-01-20 00:32:56 -0500 +message: + Add support for writing config data with whitespace kept intact. + Propgate debug setting to the ConfigManager instances. + Don't write essid key sections to the config file if we're not actually using them. +------------------------------------------------------------ +revno: 245 +committer: Dan O'Reilly +branch nick: experimental +timestamp: Mon 2009-01-19 23:45:05 -0500 +message: + Fix a few typos in the option gateway code. +------------------------------------------------------------ +revno: 244 +committer: Dan O'Reilly +branch nick: experimental +timestamp: Mon 2009-01-19 23:37:35 -0500 +message: + Fix bug that was keeping DHCP release from working. +------------------------------------------------------------ +revno: 243 +committer: Dan O'Reilly +branch nick: experimental +timestamp: Mon 2009-01-19 01:06:57 -0500 +message: + Fix ttls template + Add a guiutils module for gui-related functions/classes that are used in multiple modules. + Replace os.access with os.path.exists + Make the static gateway entry optional. + Don't auto-connect/reconnect when the gui is open. + Fix bug that would keep the gui from working if the wired network entry was displayed. +------------------------------------------------------------ +revno: 242 +committer: Dan O'Reilly +branch nick: experimental +timestamp: Sat 2009-01-17 12:58:02 -0500 +message: + Fix bug where encryption keys with non-ascii characters caused crashes. + Only write settings being saved if debug mode is on. + Clear keys entered through the GUI when the encryption checkbox is disabled. +------------------------------------------------------------ +revno: 241 +committer: Dan O'Reilly +branch nick: experimental +timestamp: Thu 2009-01-15 01:25:24 -0500 +message: + Merging in noexpander branch. + ------------------------------------------------------------ + revno: 237.1.10 + committer: Dan O'Reilly + branch nick: 1.6-noexpander + timestamp: Thu 2009-01-15 01:21:54 -0500 + message: + Tweak default window sizes + ------------------------------------------------------------ + revno: 237.1.9 + committer: Dan O'Reilly + branch nick: 1.6-noexpander + timestamp: Thu 2009-01-15 00:59:52 -0500 + message: + merge in experimental branch + ------------------------------------------------------------ + revno: 237.1.8 + committer: Dan O'Reilly + branch nick: 1.6-noexpander + timestamp: Thu 2009-01-15 00:56:02 -0500 + message: + Fix bug where be-ioctl scans always reported channels as 1. + Tweak the UI a little bit. + Add debugging output when forced_disconnect gets enabled. + ------------------------------------------------------------ + revno: 237.1.7 + committer: Dan O'Reilly + branch nick: 1.6-noexpander + timestamp: Sun 2009-01-11 20:15:01 -0500 + message: + merge + ------------------------------------------------------------ + revno: 237.2.1 + committer: Adam Blackburn + branch nick: 1.6-revampedgui + timestamp: Sat 2009-01-10 11:03:41 +0800 + message: + A few minor cosmetic changes + Changed main GUI name from Wicd Manager to Wicd Network Manager + ------------------------------------------------------------ + revno: 237.1.6 + committer: Dan O'Reilly + branch nick: 1.6-noexpander + timestamp: Fri 2009-01-09 23:58:14 -0500 + message: + Initial crack at reworking GUI some more. + ------------------------------------------------------------ + revno: 237.1.5 + committer: Adam Blackburn + branch nick: 1.6-revampedgui + timestamp: Sat 2009-01-10 08:36:19 +0800 + message: + Made the information dialog look nicer -- added description labels and left aligned everything + ------------------------------------------------------------ + revno: 237.1.4 + committer: Adam Blackburn + branch nick: 1.6-revampedgui + timestamp: Fri 2009-01-09 22:54:24 +0800 + message: + Information dialog now uses real labels instead of grey labels + ------------------------------------------------------------ + revno: 237.1.3 + committer: Adam Blackburn + branch nick: experimental-revampedgui + timestamp: Fri 2009-01-09 21:53:59 +0800 + message: + Added an information button and a dialog + ------------------------------------------------------------ + revno: 237.1.2 + committer: Adam Blackburn + branch nick: experimental-revampedgui + timestamp: Fri 2009-01-09 21:12:48 +0800 + message: + Added a name label + ------------------------------------------------------------ + revno: 237.1.1 + committer: Adam Blackburn + branch nick: experimental-revampedgui + timestamp: Fri 2009-01-09 20:40:30 +0800 + message: + Removed network expanders +------------------------------------------------------------ +revno: 240 +committer: Dan O'Reilly +branch nick: experimental +timestamp: Thu 2009-01-15 01:22:40 -0500 +message: + Use dbusmanager in autoconnect.py +------------------------------------------------------------ +revno: 239 +committer: Adam Blackburn +branch nick: 1.6 +timestamp: Mon 2009-01-12 20:09:11 +0800 +message: + Applied patch from https://bugs.launchpad.net/wicd/+bug/315238 to add expandable values to the script parameters +------------------------------------------------------------ +revno: 238 +committer: Adam Blackburn +branch nick: 1.6 +timestamp: Sat 2009-01-10 08:53:55 +0800 +message: + Don't expand the DNS domain +------------------------------------------------------------ +revno: 237 +committer: Adam Blackburn +branch nick: experimental +timestamp: Sat 2009-01-03 10:35:28 +0800 +message: + Changed 25% signal icon to red and 50% signal icon to orange +------------------------------------------------------------ +revno: 236 +committer: Dan O'Reilly +branch nick: experimental +timestamp: Fri 2009-01-02 19:57:21 -0500 +message: + Merge in rworkman-experimental + ------------------------------------------------------------ + revno: 203.1.25 + committer: Robby Workman + branch nick: experimental-rworkman + timestamp: Wed 2008-12-31 23:53:30 -0600 + message: + If kde-config fails, then assume kde is not installed, and don't + install the autostart file for kde. + ------------------------------------------------------------ + revno: 203.1.24 + committer: Robby Workman + branch nick: experimental-rworkman + timestamp: Wed 2008-12-31 15:52:27 -0600 + message: + Merged r234 from mainline. + ------------------------------------------------------------ + revno: 203.1.23 + committer: Robby Workman + branch nick: experimental-rworkman + timestamp: Tue 2008-12-30 20:07:52 -0600 + message: + Merged r233 from mainline + ------------------------------------------------------------ + revno: 203.1.22 + committer: Robby Workman + branch nick: experimental-rworkman + timestamp: Sun 2008-12-28 19:24:37 -0600 + message: + Merged r232 from mainline. + ------------------------------------------------------------ + revno: 203.1.21 + committer: Robby Workman + branch nick: experimental-rworkman + timestamp: Sun 2008-12-28 19:22:15 -0600 + message: + Fix permissions on peap-tkip template. + ------------------------------------------------------------ + revno: 203.1.20 + committer: Robby Workman + branch nick: experimental-rworkman + timestamp: Sun 2008-12-28 00:19:25 -0600 + message: + Merged autoconnect.py and suspend.py changes from trunk (fixes for + the pm-utils sleep hook usage). + ------------------------------------------------------------ + revno: 203.1.19 + committer: Robby Workman + branch nick: experimental-rworkman + timestamp: Sat 2008-12-27 19:38:12 -0600 + message: + Merged latest changes from mainline experimental branch. + ------------------------------------------------------------ + revno: 203.1.18 + committer: Robby Workman + branch nick: experimental-rworkman + timestamp: Sat 2008-12-27 19:21:45 -0600 + message: + Merge in the changes to trunk's pm-utils sleep hook. + ------------------------------------------------------------ + revno: 203.1.17 + committer: Robby Workman + branch nick: experimental-rworkman + timestamp: Sat 2008-12-27 00:37:03 -0600 + message: + Fixup pm-utils hook to return proper exit codes and fix logging. + ------------------------------------------------------------ + revno: 203.1.16 + committer: Robby Workman + branch nick: experimental-rworkman + timestamp: Wed 2008-12-24 11:30:07 -0600 + message: + Merged r229 from mainline experimental. + ------------------------------------------------------------ + revno: 203.1.15 + committer: Robby Workman + branch nick: experimental-rworkman + timestamp: Tue 2008-12-23 01:50:16 -0600 + message: + Add "CHANGES" file to the list of documentation installed. + ------------------------------------------------------------ + revno: 203.1.14 + committer: Robby Workman + branch nick: experimental-rworkman + timestamp: Tue 2008-12-23 01:47:53 -0600 + message: + Add support for configurable Unix group to be used - basically, users + must be a member of this group in order to use Wicd. Note that this + does not apply on systems configured to use ConsoleKit/PAM/et al. + This defaults to use the "users" group so that it will work "out of the + box" for most people, but distributions are encouraged to edit it + as needed with the "--wicdgroup=whatever" configure argument. + ------------------------------------------------------------ + revno: 203.1.13 + committer: Robby Workman + branch nick: experimental-rworkman + timestamp: Tue 2008-12-23 01:20:48 -0600 + message: + Removed execute perms from other/wicd.conf + ------------------------------------------------------------ + revno: 203.1.12 + committer: Robby Workman + branch nick: experimental-rworkman + timestamp: Tue 2008-12-23 01:17:30 -0600 + message: + Fix (I think) dbus errors, or at least this is one way to fix them. + If this is the *right* way, then it still needs work to support it + in setup.py + ------------------------------------------------------------ + revno: 203.1.11 + committer: Robby Workman + branch nick: experimental-rworkman + timestamp: Mon 2008-12-22 23:34:47 -0600 + message: + Merged new prefs dialog from mainline experimental + ------------------------------------------------------------ + revno: 203.1.10 + committer: Robby Workman + branch nick: experimental-rworkman + timestamp: Tue 2008-12-23 04:40:47 +0000 + message: + Merge r220 upstream. + ------------------------------------------------------------ + revno: 203.1.9 + committer: Robby Workman + branch nick: experimental-rworkman + timestamp: Mon 2008-12-22 17:14:55 +0000 + message: + Merged r219 from main experimental branch. + ------------------------------------------------------------ + revno: 203.1.8 + committer: Robby Workman + branch nick: experimental-rworkman + timestamp: Mon 2008-12-15 17:40:07 +0000 + message: + Merged r213 of main experimental branch + ------------------------------------------------------------ + revno: 203.1.7 + committer: Robby Workman + branch nick: experimental-rworkman + timestamp: Sun 2008-12-14 07:58:58 +0000 + message: + Remove extraneous comments from setup.py and clean up a few of them. + This is definitely trivial crap... + ------------------------------------------------------------ + revno: 203.1.6 + committer: Robby Workman + branch nick: experimental-rworkman + timestamp: Sun 2008-12-14 07:43:44 +0000 + message: + Merged main experimental branch + Fixed kde autostart directory setting + ------------------------------------------------------------ + revno: 203.1.5 + committer: Robby Workman + branch nick: experimental-rworkman + timestamp: Sat 2008-12-13 22:11:56 +0000 + message: + Merged main experimental branch changes as of r208. + ------------------------------------------------------------ + revno: 203.1.4 + committer: Robby Workman + branch nick: experimental-rworkman + timestamp: Sat 2008-12-13 22:06:00 +0000 + message: + Fixed (I think) the pkg-config and kde-config tests. This needs more + testing though before I'm sure. Big thanks to "nanotube" for the + suggestions and code for this. + ------------------------------------------------------------ + revno: 203.1.3 + committer: Robby Workman + branch nick: experimental-rworkman + timestamp: Fri 2008-12-12 14:05:44 +0000 + message: + Merge changes from main experimental branch. + ------------------------------------------------------------ + revno: 203.1.2 + committer: Robby Workman + branch nick: experimental-rworkman + timestamp: Fri 2008-12-12 05:45:13 +0000 + message: + Fix icons (copied from wicd-1.5.6 source tarball) + ------------------------------------------------------------ + revno: 203.1.1 + committer: Robby Workman + branch nick: experimental-rworkman + timestamp: Fri 2008-12-12 04:28:18 +0000 + message: + Add support for checking pkg-config to see where pm-utils sleep hook + should go (supported in pm-utils >=1.2.3). + Add support for checking kde-config to get kde's prefix, and set the + kde autostart directory accordingly. +------------------------------------------------------------ +revno: 235 +committer: Dan O'Reilly +branch nick: experimental +timestamp: Fri 2009-01-02 19:52:28 -0500 +message: + Move logic that saves settings for network entries out of gui.py and into netentry.py. +------------------------------------------------------------ +revno: 234 +committer: Dan O'Reilly +branch nick: experimental +timestamp: Tue 2008-12-30 23:20:00 -0500 +message: + Add a domain entry for dns settings. + Display an error if global dns is enabled for a network, but global dns entries aren't entered in the general preferences window. +------------------------------------------------------------ +revno: 233 +committer: Adam Blackburn +branch nick: experimental +timestamp: Tue 2008-12-30 18:01:27 -0600 +message: + Merged with wpathenhancements + ------------------------------------------------------------ + revno: 232.1.4 + committer: Adam Blackburn + branch nick: experimental-oneversion + timestamp: Tue 2008-12-30 10:31:06 -0600 + message: + Removed files that are generated by python setup.py configure + Added command to setup.py to clean out generated files ('cleargenerated') + Added the revision number to wicd-daemon.py --help + ------------------------------------------------------------ + revno: 232.1.3 + committer: Adam Blackburn + branch nick: experimental-oneversion + timestamp: Tue 2008-12-30 10:17:07 -0600 + message: + Fixed a typo + ------------------------------------------------------------ + revno: 232.1.2 + committer: Adam Blackburn + branch nick: experimental-oneversion + timestamp: Tue 2008-12-30 10:16:09 -0600 + message: + Added support for storing the revision number in wpath.py + ------------------------------------------------------------ + revno: 232.1.1 + committer: Adam Blackburn + branch nick: experimental-oneversion + timestamp: Tue 2008-12-30 09:53:30 -0600 + message: + Centralized version number in setup.py +------------------------------------------------------------ +revno: 232 +committer: Dan O'Reilly +branch nick: experimental +timestamp: Sun 2008-12-28 16:19:18 -0500 +message: + Fix bug where the daemon could crash if an encryption key was entered for a network without encryption on. + Some minor code formatting changes + Replace "new" with "experimental" in description for ioctl backend. +------------------------------------------------------------ +revno: 231 +committer: Dan O'Reilly +branch nick: experimental +timestamp: Sat 2008-12-27 18:31:50 -0500 +message: + Fix prefs label +------------------------------------------------------------ +revno: 230 +committer: Dan O'Reilly +branch nick: experimental +timestamp: Sat 2008-12-27 18:23:15 -0500 +message: + Make backend combobox tooltip display the active backend's description. + Reverse the order of the OK/Cancel button in the Ad-Hoc connection dialog. + Use a new set of icons. + Extend the update invervals for all backends by 1 second. + Try to use en_US.utf8 instead of C as the LANG in misc.Run if it is available. + Add ability to force a network state update. (Currently not used). +------------------------------------------------------------ +revno: 229 +committer: Adam Blackburn +branch nick: experimental +timestamp: Wed 2008-12-24 00:24:26 -0600 +message: + Removed stringToBoolean +------------------------------------------------------------ +revno: 228 +committer: Adam Blackburn +branch nick: experimental +timestamp: Tue 2008-12-23 23:34:22 -0600 +message: + Added unit test for misc.py +------------------------------------------------------------ +revno: 227 +committer: Dan O'Reilly +branch nick: experimental +timestamp: Tue 2008-12-23 21:10:17 -0500 +message: + Tweak misc.to_unicode() so that it is more likely to encode to utf-8 correctly. +------------------------------------------------------------ +revno: 226 +committer: Dan O'Reilly +branch nick: experimental +timestamp: Tue 2008-12-23 18:23:38 -0500 +message: + Fix "_" getting stripped from interface names. +------------------------------------------------------------ +revno: 225 +committer: Adam Blackburn +branch nick: experimental +timestamp: Tue 2008-12-23 16:55:15 -0600 +message: + Added the wpa-psk template and change the wpa one to wpa passphrase +------------------------------------------------------------ +revno: 224 +committer: Adam Blackburn +branch nick: experimental +timestamp: Tue 2008-12-23 11:39:55 -0600 +message: + Updated Preferences dialog and added test cases for wnettools +------------------------------------------------------------ +revno: 223 +committer: Adam Blackburn +branch nick: experimental +timestamp: Mon 2008-12-22 23:30:52 -0600 +message: + Updated Preferences dialog more and commented out translations in prefs.py +------------------------------------------------------------ +revno: 222 +committer: Adam Blackburn +branch nick: experimental +timestamp: Mon 2008-12-22 23:08:12 -0600 +message: + Updated Preferences dialog to conform to the GNOME HIG better +------------------------------------------------------------ +revno: 221 +committer: Adam Blackburn +branch nick: experimental +timestamp: Mon 2008-12-22 21:25:51 -0600 +message: + Fixed hidden network icon +------------------------------------------------------------ +revno: 220 +committer: Dan O'Reilly +branch nick: experimental +timestamp: Mon 2008-12-22 21:28:31 -0500 +message: + Fix problem where combobox entries would get screwed up when the preferences window was opened more than once. +------------------------------------------------------------ +revno: 219 +committer: Dan O'Reilly +branch nick: experimental +timestamp: Mon 2008-12-22 00:20:42 -0500 +message: + Fix some issues with wired networks caused by refactoring. + Add missing return statement. +------------------------------------------------------------ +revno: 218 +committer: Dan O'Reilly +branch nick: experimental +timestamp: Mon 2008-12-22 00:05:19 -0500 +message: + More work on bubbling the reason for connection failures up to the UI. + Refactor Wireless/Wired classes in networking module and daemon so that they don't need to reference each other. Wired objects don't know about Wireless objects and vice versa. This also means connecting to a wired/wireless network will only clear the connection on whichever network type you're connecting to. +------------------------------------------------------------ +revno: 217 +committer: Dan O'Reilly +branch nick: experimental +timestamp: Sun 2008-12-21 00:19:18 -0500 +message: + Checkpoint for work on getting reasons for connection failure back up to the UI. +------------------------------------------------------------ +revno: 216 +committer: Dan O'Reilly +branch nick: experimental +timestamp: Tue 2008-12-16 01:30:46 -0500 +message: + Fix non-blocking error dialog. +------------------------------------------------------------ +revno: 215 +committer: Dan O'Reilly +branch nick: experimental +timestamp: Tue 2008-12-16 01:19:26 -0500 +message: + Make gui.error() calls optionally not block. + Make the lost dbus error message translatable. +------------------------------------------------------------ +revno: 214 +committer: Dan O'Reilly +branch nick: experimental +timestamp: Tue 2008-12-16 00:48:47 -0500 +message: + Only show valid wpa_supplicant drivers in the GUI. + Don't needlessly created PreferenceDialog objects. + Use dbus signals to alert the UI that the daemon is back up, instead of polling. +------------------------------------------------------------ +revno: 213 +committer: Dan O'Reilly +branch nick: experimental +timestamp: Mon 2008-12-15 00:31:35 -0500 +message: + Fix some gtk warnings that would pop up when the GUI was opened. + Fix broken Network menu entries. +------------------------------------------------------------ +revno: 212 +committer: Dan O'Reilly +branch nick: experimental +timestamp: Sun 2008-12-14 22:19:35 -0500 +message: + More work on making the client handle a daemon restart +------------------------------------------------------------ +revno: 211 +committer: Dan O'Reilly +branch nick: experimental +timestamp: Sun 2008-12-14 18:31:24 -0500 +message: + Make client survive the daemon going down. + Port a few fixes from trunk. +------------------------------------------------------------ +revno: 210 +committer: Dan O'Reilly +branch nick: experimental +timestamp: Sat 2008-12-13 19:39:15 -0500 +message: + Make sure autoconnect.py never blocks + Tweak configmanager to not write a default value unless one is specified in the get call. +------------------------------------------------------------ +revno: 209 +committer: Dan O'Reilly +branch nick: experimental +timestamp: Sat 2008-12-13 17:32:54 -0500 +message: + Use RawConfigParser instead of ConfigParser +------------------------------------------------------------ +revno: 208 +committer: Dan O'Reilly +branch nick: experimental +timestamp: Sat 2008-12-13 17:07:31 -0500 +message: + Pass lists instead of strings in GeneratePSK and Authenticate methods. +------------------------------------------------------------ +revno: 207 +committer: Dan O'Reilly +branch nick: experimental +timestamp: Sat 2008-12-13 13:28:05 -0500 +message: + Fix saving scripts not working correctly. +------------------------------------------------------------ +revno: 206 +committer: Dan O'Reilly +branch nick: experimental +timestamp: Sat 2008-12-13 01:49:15 -0500 +message: + merging + ------------------------------------------------------------ + revno: 204.1.1 + committer: Adam Blackburn + branch nick: experimental + timestamp: Fri 2008-12-12 17:23:35 +0800 + message: + Fixed the icons +------------------------------------------------------------ +revno: 205 +committer: Dan O'Reilly +branch nick: experimental +timestamp: Sat 2008-12-13 01:37:57 -0500 +message: + Fix some suspend/resume issues +------------------------------------------------------------ +revno: 204 +committer: Dan O'Reilly +branch nick: experimental +timestamp: Thu 2008-12-11 18:42:11 -0500 +message: + Fix dbus permissions problem. + Fix missing dbus import. +------------------------------------------------------------ +revno: 203 +committer: Dan O'Reilly +branch nick: experimental +timestamp: Thu 2008-12-11 00:56:12 -0500 +message: + Apply patch from rworkman + Update suspend/resume script +------------------------------------------------------------ +revno: 202 +committer: Dan O'Reilly +branch nick: experimental +timestamp: Thu 2008-12-11 00:37:07 -0500 +message: + More build fixes +------------------------------------------------------------ +revno: 201 +committer: Dan O'Reilly +branch nick: experimental +timestamp: Thu 2008-12-11 00:33:10 -0500 +message: + Add missing man file +------------------------------------------------------------ +revno: 200 +committer: Dan O'Reilly +branch nick: experimental +timestamp: Thu 2008-12-11 00:29:00 -0500 +message: + Fix running scripts + Fix broken symlink + Update slackware init script + Add new build options to wpath.py +------------------------------------------------------------ +revno: 199 +committer: Dan O'Reilly +branch nick: experimental +timestamp: Tue 2008-12-09 22:53:30 -0500 +message: + Make sure suspend script never fails +------------------------------------------------------------ +revno: 198 +committer: Dan O'Reilly +branch nick: experimental +timestamp: Sun 2008-12-07 21:15:29 -0500 +message: + merging in a bunch of trunk changes +------------------------------------------------------------ +revno: 197 +committer: imdano +branch nick: experimental +timestamp: Sat 2008-12-06 19:11:43 +0000 +message: + experimental branch: + - Tray icon fixes from trunk + - Handle possible failure in wpactrl + - Format some docstrings +------------------------------------------------------------ +revno: 196 +committer: imdano +branch nick: experimental +timestamp: Sun 2008-11-02 14:26:42 +0000 +message: + experimental branch: + - Enhance dbus manager to handle settings up mainloops, etc. + - Early work on getting wicd-client to recover from a daemon crash. + - Simply how the the scripts editor gets launched. + - Remove unneeded cleanup code from netentry.py + - More ralink legacy work. + - Run scans in a thread, this should make the UI more responsive while a scan is going on. Rework the UI code to never expect a scan to be blocking. + - Don't require the daemon to be restarted when we switch backends, just try to prevent any calls to the backend until the switch is made. +------------------------------------------------------------ +revno: 195 +committer: imdano +branch nick: experimental +timestamp: Sat 2008-10-18 17:37:42 +0000 +message: + experimental branch: + - Port a bunch of fixes from the trunk + - Use an actual Gtk.Menu in the toolbar for the "Network" widget +------------------------------------------------------------ +revno: 194 +committer: imdano +branch nick: experimental +timestamp: Sat 2008-10-11 12:36:49 +0000 +message: + experimental branch: + - Actually destroy the network entry objects that are supposed to get destroied + - Improve GUI behavior when initially opened. + - Use the python -O flag when launching the daemon/GUI. + - Favor gksudo over gksu. + - Remove broken interface enable/disable options. +------------------------------------------------------------ +revno: 193 +committer: imdano +branch nick: experimental +timestamp: Thu 2008-10-09 18:45:01 +0000 +message: + experimental: + - Add 3rd party python libraries used by ioctl backend to tree and to setup.py + - Port several bug fixes from the trunk (removing reliance on shell for running external commands, unicode fixes, gui crash fixes, authentication validation improvements, several others) + - Fix some crashes in ioctl backend. + - Change daemon/GUI launch scripts to use the -O flag. +------------------------------------------------------------ +revno: 192 +committer: imdano +branch nick: experimental +timestamp: Sat 2008-09-27 21:36:04 +0000 +message: + branches/experimental: + - Fix scripts dialog not appearing. +------------------------------------------------------------ +revno: 191 +committer: imdano +branch nick: experimental +timestamp: Thu 2008-09-25 20:17:35 +0000 +message: + branches/experimental: + - A bunch of documentation additions/updates. + - Minor refactoring. + - Fix catching wrong exception in netentry.py +------------------------------------------------------------ +revno: 190 +committer: imdano +branch nick: experimental +timestamp: Sun 2008-09-21 16:38:15 +0000 +message: + branches/experimental: + - Fix some wired method issues in the daemon. + - Make sure stringToBoolean always returns a boolean. +------------------------------------------------------------ +revno: 189 +committer: imdano +branch nick: experimental +timestamp: Sun 2008-09-21 13:26:46 +0000 +message: + trunk & experimental: + - Make sure all entries in the connection status info list are strings. +------------------------------------------------------------ +revno: 188 +committer: imdano +branch nick: experimental +timestamp: Sat 2008-09-20 19:13:34 +0000 +message: + trunk, experimental: + - Fix crash if default locale isn't supported. +------------------------------------------------------------ +revno: 187 +committer: imdano +branch nick: experimental +timestamp: Sat 2008-09-20 10:39:23 +0000 +message: + trunk/experimental: + - Fix use of subprocess.call method +------------------------------------------------------------ +revno: 186 +committer: imdano +branch nick: experimental +timestamp: Sat 2008-09-20 10:22:06 +0000 +message: + branches/experimental + - Add support for entering search domain into static DNS settings. + - Fix some errors in how static setting texboxes were getting set. + - Fixed a bunch of errors/warnings found by pylint. +------------------------------------------------------------ +revno: 185 +committer: imdano +branch nick: experimental +timestamp: Sat 2008-09-20 08:02:06 +0000 +message: + branches/experimental: + - Fix crash in configmanager. +------------------------------------------------------------ +revno: 184 +committer: imdano +branch nick: experimental +timestamp: Fri 2008-09-19 16:28:26 +0000 +message: + experimental: + - Fix potential deadlock in connection thread + - Make wireless interface blank string if set to None in config. +------------------------------------------------------------ +revno: 183 +committer: imdano +branch nick: experimental +timestamp: Thu 2008-09-18 21:18:40 +0000 +message: + experimental: + - Use the full path to wpa_passphrase. + - Fix some crashing bugs in the daemon and configscript.py + - Port a few changes/fixes from trunk. + - Some minor refactoring. +------------------------------------------------------------ +revno: 182 +committer: imdano +branch nick: experimental +timestamp: Thu 2008-09-18 16:07:49 +0000 +message: + trunk/experimental: + - Fix EAP-TLS template. Thanks to Andrew Psaltis for the fix. +------------------------------------------------------------ +revno: 181 +committer: imdano +branch nick: experimental +timestamp: Sat 2008-09-13 22:52:01 +0000 +message: + experimental: + - Add UPDATE_INTERVAL as a required attribute for backends, and used by monitor.py + - Update Copyright stuff in a few files + - Remove/update some scripts and configuration files. +------------------------------------------------------------ +revno: 180 +committer: imdano +branch nick: experimental +timestamp: Sat 2008-09-13 21:39:20 +0000 +message: + experimental: + - Merge missing dbusmanager changes from pluggablebackends + - Merge a change from trunk for --no-autoconnect mode + - Make monitor timeout_add_seconds time an integer +------------------------------------------------------------ +revno: 179 +committer: imdano +branch nick: experimental +timestamp: Sat 2008-09-13 11:28:36 +0000 +message: + experimental: + - Use gobject.timeout_add_seconds instead of gobject.timeout_add when possible + - Merge some fixes from pluggablebackends + - Replace os.system usage with subprocess.call. +------------------------------------------------------------ +revno: 178 +committer: imdano +branch nick: experimental +timestamp: Sat 2008-09-06 20:53:21 +0000 +message: + experimental: + - fix some autoconnect issues related to the splitting up of the daemon +------------------------------------------------------------ +revno: 177 +committer: compwiz18 +branch nick: experimental +timestamp: Sat 2008-09-06 20:35:53 +0000 +message: + Experimental: + * Fixed typo in setup.py +------------------------------------------------------------ +revno: 176 +committer: compwiz18 +branch nick: experimental +timestamp: Sat 2008-09-06 20:30:23 +0000 +message: + Experimental: + * Added wicd.configmanager to setup.py +------------------------------------------------------------ +revno: 175 +committer: imdano +branch nick: experimental +timestamp: Sat 2008-09-06 19:54:20 +0000 +message: + experimental: + - Add backends entry to wpath.py +------------------------------------------------------------ +revno: 174 +committer: imdano +branch nick: experimental +timestamp: Sat 2008-09-06 19:53:25 +0000 +message: + experimental: + - Fix some syntax/import problems created during the merge +------------------------------------------------------------ +revno: 173 +committer: imdano +branch nick: experimental +timestamp: Sat 2008-09-06 17:29:25 +0000 +message: + experimental: + - update glade file +------------------------------------------------------------ +revno: 172 +committer: imdano +branch nick: experimental +timestamp: Sat 2008-09-06 16:57:36 +0000 +message: + experimental: + - update setup.py +------------------------------------------------------------ +revno: 171 +committer: imdano +branch nick: experimental +timestamp: Sat 2008-09-06 16:54:53 +0000 +message: + experimental: + - Merge in changes from pluggablebackends. +------------------------------------------------------------ +revno: 170 +committer: imdano +branch nick: experimental +timestamp: Fri 2008-08-29 14:49:37 +0000 +message: + All braches/trunk: + - Force locale settings to C before running commands with piped output. +------------------------------------------------------------ +revno: 169 +committer: imdano +branch nick: experimental +timestamp: Fri 2008-08-29 12:22:34 +0000 +message: + All branches/trunk: + - Specify the device to use in SetDefaultRoute +------------------------------------------------------------ +revno: 168 +committer: imdano +branch nick: experimental +timestamp: Thu 2008-08-28 18:58:34 +0000 +message: + trunk/all branches: + make wicd launch scripts use "exec" so that the launch script exits after starting up the daemon/tray icon. +------------------------------------------------------------ +revno: 167 +committer: imdano +branch nick: experimental +timestamp: Sun 2008-08-24 08:36:07 +0000 +message: + experimental/pluggablebackends: + - Remove --scan-interval option from daemon since its no longer needed. +------------------------------------------------------------ +revno: 166 +committer: imdano +branch nick: experimental +timestamp: Sun 2008-08-24 08:15:24 +0000 +message: + experimental: + - Some minor cleanup/formatting fixes + - Add a missing DetectWiredInterfaces() method to networking.py +------------------------------------------------------------ +revno: 165 +committer: compwiz18 +branch nick: experimental +timestamp: Sat 2008-08-23 20:14:43 +0000 +message: + Experimental: Apply changes involving setup.py + * Added setup.py from trunk + * Updated various information files (AUTHORS, README, etc) + * Update the Wicd icon + * Move stuff around to match trunk's layout +------------------------------------------------------------ +revno: 164 +committer: imdano +branch nick: experimental +timestamp: Sat 2008-08-23 14:50:50 +0000 +message: + experimental: + - Merge in changes (prefs.py, dbusmanager.py, clean up in daemon.py) from pluggablebackends. + + pluggablebackends: + - Some minor cleanup. +------------------------------------------------------------ +revno: 163 +committer: imdano +branch nick: experimental +timestamp: Wed 2008-08-20 14:09:47 +0000 +message: + trunk/experiementa/pluggablebackends: + - Fix crash due to _sanitize_string getting None passed in. +------------------------------------------------------------ +revno: 162 +committer: imdano +branch nick: experimental +timestamp: Tue 2008-08-19 19:06:26 +0000 +message: + Experimental: + - Add new logging system which rotates the log file once it reaches a set size. + - Merge in fixes and new features from pluggablebackends and trunk + - Right click network menu in tray icon now bolds the active network. +------------------------------------------------------------ +revno: 161 +committer: imdano +branch nick: experimental +timestamp: Mon 2008-07-21 13:46:38 +0000 +message: + Testing: + - Fix typo in daemon +------------------------------------------------------------ +revno: 160 +committer: imdano +branch nick: experimental +timestamp: Sun 2008-07-20 16:34:45 +0000 +message: + Experimental: + - Port a ton of changes from the testing branch over. +------------------------------------------------------------ +revno: 159 +committer: imdano +branch nick: experimental +timestamp: Sun 2008-06-29 20:38:30 +0000 +message: + Testing: + - Fix bug in configscript.py that kept it from loading correctly. + - More manpage fixes/updates from rworkman. +------------------------------------------------------------ +revno: 158 +committer: imdano +branch nick: experimental +timestamp: Tue 2008-06-24 14:14:18 +0000 +message: + Experimental/Testing: + - Fix changes made to encryption settings not being reset if "cancel" is selected in the dialog box. + + Experimental: + - Fix bug where Static DNS checkbox would be disabled no matter what if Static IP was disabled. +------------------------------------------------------------ +revno: 157 +committer: imdano +branch nick: experimental +timestamp: Mon 2008-06-23 22:21:47 +0000 +message: + Experimental/Testing: + - Fix encryption combobox size sometimes getting distorted when switching between encryption types. +------------------------------------------------------------ +revno: 156 +committer: imdano +branch nick: experimental +timestamp: Mon 2008-06-23 08:08:53 +0000 +message: + Experimental/Testing: + - Fix dhcp not getting released if the disconnect button wasn't pressed explicitly, but a new connection is trying to be made. +------------------------------------------------------------ +revno: 155 +committer: imdano +branch nick: experimental +timestamp: Fri 2008-06-20 08:13:56 +0000 +message: + Experimental/Testing: + - Fix bug keeping wired networks from connecting + - Wicd will now try to release dhcp when disconnecting from a network. +------------------------------------------------------------ +revno: 154 +committer: imdano +branch nick: experimental +timestamp: Thu 2008-06-19 22:09:39 +0000 +message: + Experimental/Testing: + - Improved behavior in the networking backend. The wired/wireless wnettools instances now refer to each other, and get passed on to connection threads as well, which simplifies passing settings for external program usage. Also removed some unecessary creating of duplicate wnettools instances which ended up causing some issues. + - Fixed bug where dhclient was being used as the dhcp client even if it was selected in the options menu. + - Fixed a typo in the connection commands used for ralink cards. + - Fixed the wrong cli option for releasing a dhcpcd lease. + - Monitor.py no longer calls for an auto-rescan if the daemon is currently connecting to a network. + - Cleaned up some comments and simplified the logic in a few methods/functions. +------------------------------------------------------------ +revno: 153 +committer: imdano +branch nick: experimental +timestamp: Thu 2008-06-12 15:08:50 +0000 +message: + Experimental/Testing: + - Fixed typo in ttls template (Thanks to Nido Media for catching it) +------------------------------------------------------------ +revno: 152 +committer: imdano +branch nick: experimental +timestamp: Wed 2008-06-11 20:13:32 +0000 +message: + Experimental/Testing: + - Added support for using kdesu instead of gksu where it makes sense. + - Improved code used to sanitize network keys used with wpa_passphrase. + - Removed some unused functions and imports. + - Cleaned up some comments/docstrings. + + Experimental: + - Split gui.py into gui.py and netentry.py. netentry is imported by gui.py to make use of NetworkEntry and its subclasses. + - Reorganzed how dbus and the language dict are used in wicd.py and gui.py. +------------------------------------------------------------ +revno: 151 +committer: imdano +branch nick: experimental +timestamp: Sat 2008-05-24 11:36:14 +0000 +message: + Experimental/Testing: + - Fix bug where wired advanced settings wouldn't be saved properly + + Experimental: + - Add support for determining which graphical sudo program (gksu/kdesu) should be used. +------------------------------------------------------------ +revno: 150 +committer: imdano +branch nick: experimental +timestamp: Fri 2008-05-09 21:07:41 +0000 +message: + Testing/Experimental: + - Fixed an indentation problem + - Use misc.RenameProcess for process renaming in wicd.py + + Experimental: + - Make the encryption template file parsing used for the GUI a little more robust. +------------------------------------------------------------ +revno: 149 +committer: imdano +branch nick: experimental +timestamp: Wed 2008-05-07 21:59:44 +0000 +message: + Testing/Experimental: + - Move process renaming code to the misc module, and fix process ranming for 64 bit systems. (Thanks to Helber Maciel) + - Move the error gtk method to the gui module. (Thanks to Helber Maciel) + - Removed a debugging print statement from monitor.py + - Fixed up a few docstrings/comments. + + Testing: + - Fix bug where Connect button would become inactive after disconnecting from a network. +------------------------------------------------------------ +revno: 148 +committer: imdano +branch nick: experimental +timestamp: Sun 2008-05-04 18:10:47 +0000 +message: + Testing/Experimental: + - Emit a dbus signal when an autoscan is called, so that the GUI can update if needed. + + Experimental: + - Merged a few changes from the testing branch. +------------------------------------------------------------ +revno: 147 +committer: imdano +branch nick: experimental +timestamp: Sat 2008-05-03 09:30:09 +0000 +message: + Testing/Experimental: + - Fixed bug where monitor would crash on resume because dbus wasn't ready yet. + - Monitor now calls a rescan every 2 minutes. + + Experimental: + - Added a network list submenu to the right-click menu of the tray icon. +------------------------------------------------------------ +revno: 146 +committer: imdano +branch nick: experimental +timestamp: Tue 2008-04-29 14:29:44 +0000 +message: + Testing/Experimental: + - Replaced uses of /proc/net/wireless with /sys/class/net/. +------------------------------------------------------------ +revno: 145 +committer: imdano +branch nick: experimental +timestamp: Mon 2008-04-28 18:22:37 +0000 +message: + Testing/Experimental: + - Added check to make sure wpa_cli is installed, and make sure not to try to validate authentication if it isn't. + Experimental: + - Increased length of sleep time before checking for an active link when the wired interface has to be put up explicitly. +------------------------------------------------------------ +revno: 144 +committer: imdano +branch nick: experimental +timestamp: Wed 2008-04-23 18:10:23 +0000 +message: + Fixed problems with passphrases using non-alphanumeric characters. +------------------------------------------------------------ +revno: 143 +committer: imdano +branch nick: experimental +timestamp: Sat 2008-04-19 09:09:15 +0000 +message: + Fixed bug where building with setup.py wouldn't add rcX symlinks to init.d, so wicd wouldn't start at boot. +------------------------------------------------------------ +revno: 142 +committer: imdano +branch nick: experimental +timestamp: Sat 2008-04-19 08:48:09 +0000 +message: + Fixed bug where special characters would break expander label formatting. +------------------------------------------------------------ +revno: 141 +committer: imdano +branch nick: experimental +timestamp: Sat 2008-04-19 08:00:44 +0000 +message: + Fixed problems with wpa_supplicant driver not being passed to wnettools correctly in networking.py. + Fixed bug where connect threads could crash if debug was on and dhcp failed. +------------------------------------------------------------ +revno: 140 +committer: imdano +branch nick: experimental +timestamp: Fri 2008-04-11 10:29:10 +0000 +message: + Fixed bug where advanced settings dialog wouldn't appear for wired networks. + Added MAC address to the top level info line in a wireless network entry. + Fixed some setup.py problems. +------------------------------------------------------------ +revno: 139 +committer: imdano +branch nick: experimental +timestamp: Wed 2008-04-02 10:52:41 +0000 +message: + Fixed some setup.py problems + Added a bunch of docstrings + Fixed a crash bug when the daemon is called with the -s option caused by wicd.py calling SetForceDisconnect(False) when it launches. +------------------------------------------------------------ +revno: 138 +committer: imdano +branch nick: experimental +timestamp: Mon 2008-03-31 21:37:21 +0000 +message: + Fixed gui sometimes not updating buttons after clicking the disconnect button for the active network. + Fixed gui not behaving properly after cancelling a connection. +------------------------------------------------------------ +revno: 137 +committer: imdano +branch nick: experimental +timestamp: Mon 2008-03-31 15:23:59 +0000 +message: + Lengthened the sleep time between putting a wired interface up and checking to see if the link is active. + A few small optimizations/code cleanup. +------------------------------------------------------------ +revno: 136 +committer: imdano +branch nick: experimental +timestamp: Mon 2008-03-31 14:21:43 +0000 +message: + Added support for monitoring connection status without the need for iwconfig, ifconfig, and ethtool/miitool. + Added a "Disconnect" button to each network entry, which will be visible instead of the "Connect" button for the active network. + Fixed a bug where cancelling a connection while validating authentication would leave the GUI in the connecting state forever. +------------------------------------------------------------ +revno: 135 +committer: imdano +branch nick: experimental +timestamp: Sun 2008-03-30 12:14:11 +0000 +message: + Added missing icon images + Updated dbus config file to work under more distros + Added support for determing wireless interface by parsing /proc/net/wireless (removing need for iwconfig call) + A few minor formatting improvements. +------------------------------------------------------------ +revno: 134 +committer: imdano +branch nick: experimental +timestamp: Mon 2008-03-24 20:37:46 +0000 +message: + Added support for resizing the preferences window to any size. Also added support for remembing the size of the preferences window. +------------------------------------------------------------ +revno: 133 +committer: imdano +branch nick: experimental +timestamp: Mon 2008-03-24 00:03:35 +0000 +message: + Added distro-specific init scripts based on those used by NM (these are very experimental and likely broken in many cases). + Updated setup.py to pick which initscript to install based on the distro detected. + Updated MANIFEST.in to make sure launchdaemon.sh is included in the sdist build. + Fixed a bunch of crash bugs in tool detection system when tools are detected. + Made tool detection work correctly when "which" returns output if no match is found (as opposed to no output). Eventually we might want to hardcode possible paths instead of using which at all... + Fixed some message formatting in the daemon. + Added some docstrings. + Added a pidfile system for increased initscript compatibility (sort of, it's somewhat incomplete). +------------------------------------------------------------ +revno: 132 +committer: imdano +branch nick: experimental +timestamp: Fri 2008-03-21 17:07:47 +0000 +message: + Added support in the preferences window for specifying which dhcp client, link detection tool, and route flushing tool to use. It can also be left up to wicd to decide automatically. + Made a few logic optimizations. +------------------------------------------------------------ +revno: 131 +committer: compwiz18 +branch nick: experimental +timestamp: Fri 2008-03-21 03:38:57 +0000 +message: + Couple of fixes, started integrating a feature that will allow Wicd to smartly detect wired networks, by using detected wireless networks and connected USB devices +------------------------------------------------------------ +revno: 130 +committer: imdano +branch nick: experimental +timestamp: Thu 2008-03-20 11:16:49 +0000 +message: + Scripts no longer fork into the background by default. +------------------------------------------------------------ +revno: 129 +committer: imdano +branch nick: experimental +timestamp: Tue 2008-03-18 22:42:55 +0000 +message: + Ported the animated tray icon code to the experimental branch. + Added a command line option to run the tray with the animations disabled. +------------------------------------------------------------ +revno: 128 +committer: imdano +branch nick: experimental +timestamp: Tue 2008-03-18 10:21:32 +0000 +message: + Fixed bug where wpa_supplicant driver wasn't being set properly in the preferences window. +------------------------------------------------------------ +revno: 127 +committer: imdano +branch nick: experimental +timestamp: Tue 2008-03-18 09:12:05 +0000 +message: + Added checks to auto-reconnection code to keep it from constantly trying to reconnect when it isn't working. + Added a ShouldAutoReconnect method to the daemon, to simply the call needed in monitor.py's auto_reconnect method. +------------------------------------------------------------ +revno: 126 +committer: imdano +branch nick: experimental +timestamp: Mon 2008-03-17 07:50:51 +0000 +message: + Improved automatic reconnection behavior. + Improved debug mode behavior. + Improved the way networking.py interfaces passes attributes on to wnettools.py interfaces. + Fixed crash in __printReturn when a parameter to return wasn't of type 'str'. +------------------------------------------------------------ +revno: 125 +committer: imdano +branch nick: experimental +timestamp: Sat 2008-03-15 00:40:27 +0000 +message: + Forgot the translations folder updates from two commits ago. (P.S. Adam make sure that the updates look right as well.) +------------------------------------------------------------ +revno: 124 +committer: imdano +branch nick: experimental +timestamp: Sat 2008-03-15 00:26:24 +0000 +message: + Forgot to add the "other" folder in the last commit. +------------------------------------------------------------ +revno: 123 +committer: imdano +branch nick: experimental +timestamp: Sat 2008-03-15 00:25:59 +0000 +message: + Added README and INSTALL files. + Added a setup.py script. + Added the new init and suspend scripts to a folder called other, which also holds all files which don't currently go in the /opt/wicd folders. These are used by the setup.py script and put into their respective directories. +------------------------------------------------------------ +revno: 122 +committer: imdano +branch nick: experimental +timestamp: Fri 2008-03-14 19:16:18 +0000 +message: + Fixed asynchronous Autoconnect calls so that they actually work properly +------------------------------------------------------------ +revno: 121 +committer: imdano +branch nick: experimental +timestamp: Fri 2008-03-14 10:18:28 +0000 +message: + Removed unneeded call to LogWriter() in wicd.py +------------------------------------------------------------ +revno: 120 +committer: imdano +branch nick: experimental +timestamp: Thu 2008-03-13 14:10:49 +0000 +message: + Made calls to Autoconnect outside the daemon asynchronous. + Removed some unnecessary print statements. + Added checks to the daemon and configscript.py to make sure the user opening it is root. + Fixed formatting problems in class definitions in wicd.py +------------------------------------------------------------ +revno: 119 +committer: imdano +branch nick: experimental +timestamp: Thu 2008-03-13 10:16:03 +0000 +message: + Improved GUI opening performance so there is less delay between clicking the icon and the gui actually appearing. + Made network entry list inactive while refreshing networks. + Made debugging output less spammy and more helpful (still incomplete). +------------------------------------------------------------ +revno: 118 +committer: imdano +branch nick: experimental +timestamp: Tue 2008-03-11 15:15:55 +0000 +message: + Fixed a malformed ''.join() call in daemon.py + Replaced a couple of concatenations with ''.join() calls. +------------------------------------------------------------ +revno: 117 +committer: imdano +branch nick: experimental +timestamp: Mon 2008-03-10 20:55:46 +0000 +message: + Added support for using one set of global settings for all networks with a given essid. + Fixed a few wired autoconnect issues. +------------------------------------------------------------ +revno: 116 +committer: imdano +branch nick: experimental +timestamp: Sun 2008-03-09 22:09:22 +0000 +message: + Refactored networking.py to be more modular. + Added docstrings to wnettools.py + Fixed wired autoconnect bug due to missing parenthesis on a method call. + Moved connection monitoring code out of daemon.py and into monitor.py, which is run as a separate, child process of daemon.py, to reduce delays in dbus reponse time while connection status and autoreconnect code is running. + Added full support for running the gui without the tray icon using the --no-tray option. + Some minor changes to code to be more readable/efficient/pythonic. +------------------------------------------------------------ +revno: 115 +committer: imdano +branch nick: experimental +timestamp: Wed 2008-03-05 23:29:48 +0000 +message: + Increased time allowed for wpa_supplicant to complete authentication. + Reduced external calls (when possible) in update_status_bar. + pulse_progress_bar is now only run when connecting to a network. + Only check encryption settings on connect, instead of all of them, which shouldn't be necessary. +------------------------------------------------------------ +revno: 114 +committer: imdano +branch nick: experimental +timestamp: Wed 2008-03-05 20:43:32 +0000 +message: + Fix formatting of wireless network entry information. +------------------------------------------------------------ +revno: 113 +committer: imdano +branch nick: experimental +timestamp: Wed 2008-03-05 15:30:22 +0000 +message: + Fixed a few more bugs caused by misnamed variables +------------------------------------------------------------ +revno: 112 +committer: imdano +branch nick: experimental +timestamp: Tue 2008-03-04 20:39:53 +0000 +message: + Made a bunch of small logic improvements. + Fixed some remaining bugs from the gui.py refactoring. +------------------------------------------------------------ +revno: 111 +committer: imdano +branch nick: experimental +timestamp: Tue 2008-03-04 14:06:04 +0000 +message: + Added support for putting interfaces up/down through the gui. +------------------------------------------------------------ +revno: 110 +committer: imdano +branch nick: experimental +timestamp: Tue 2008-03-04 11:55:34 +0000 +message: + Renamed a bunch of variables in gui.py to comply to python conventions. + Fixed a few small bugs due to misnamed variables in gui.py and networking.py +------------------------------------------------------------ +revno: 109 +committer: imdano +branch nick: experimental +timestamp: Mon 2008-03-03 22:42:29 +0000 +message: + Refactored the NetworkEntry/PrettyNetworkEntry classes in order to fix a memory leak. PrettyNetwork entry classes are now merged with NetworkEntry classes. There is now a separate AdvancedSettingsDialog to handle the advanced settings for each network entry. + Fixed last-used wired autoconnect support, which had gotten removed. + Removed a debugging string from networking.py +------------------------------------------------------------ +revno: 108 +committer: compwiz18 +branch nick: experimental +timestamp: Mon 2008-03-03 06:08:45 +0000 +message: + Fixed a bug that wouldn't let wireless interfaces scan +------------------------------------------------------------ +revno: 107 +committer: imdano +branch nick: experimental +timestamp: Sat 2008-03-01 19:45:45 +0000 +message: + Autoconnect method will now fallback to wireless if a wired attempt fails for any reason. +------------------------------------------------------------ +revno: 106 +committer: imdano +branch nick: experimental +timestamp: Sat 2008-03-01 00:59:52 +0000 +message: + Improved the authentication validation code. Instead of sleeping for an abitrary amount of time, then checking if authentication succeeded, it now repeatedly checks for a longer set amount of time. This way it is less likely to fail because it didn't wait long enough, but will usually finish faster. +------------------------------------------------------------ +revno: 105 +committer: imdano +branch nick: experimental +timestamp: Fri 2008-02-29 22:14:32 +0000 +message: + Altered autoconnection code to fall back to wireless if wired fails because there is no default profile set. +------------------------------------------------------------ +revno: 104 +committer: imdano +branch nick: experimental +timestamp: Fri 2008-02-29 15:20:51 +0000 +message: + Added wep-hex, wep-passphrase, eap-tls, wep-shared encryption templates + Removed wep template (its now called wep-hex). +------------------------------------------------------------ +revno: 103 +committer: imdano +branch nick: experimental +timestamp: Fri 2008-02-29 14:16:21 +0000 +message: + Fixed crash bug in script configuration dialog when a network doesn't have script options written in the config file yet. + Refactored networking.py to not have to create a new wnettools interface every time a method gets called. Now it reuses the same one and makes changes to the iface name/driver as needed. + Refactored a few methods in wnettools.py to be organized more logically and reduce external program calls. + In experimental branch, added a few methods to networking/wnettools that can be used for enabling/disabling interfaces, as well as unloading/loading the driver associated with an interface. + Added a check for mii-tool/ethtool that gets run when wicd starts, so it can decide which to use to check for a wired connection. + Added a check for ip, to decide how to flush the routing tables. + Rewrote some of the DHCP client checking code. + Added a method (that's currently unused) to release a dhcp lease for each of the supported clients. +------------------------------------------------------------ +revno: 102 +committer: imdano +branch nick: experimental +timestamp: Thu 2008-02-14 13:46:34 +0000 +message: + Fixed bug where preferences window sometimes wouldn't appear due to a problem with the wpacombobox. +------------------------------------------------------------ +revno: 101 +committer: imdano +branch nick: experimental +timestamp: Wed 2008-02-13 13:08:15 +0000 +message: + Added support for two more DHCP clients: pump and dhcpcd. + Added check when DHCP is run to determine what DHCP clients are available. + Fixed bug where sometimes wicd wouldn't reconnect automatically when a wired connection was lost. + Cleaned up a couple of comments. +------------------------------------------------------------ +revno: 100 +committer: imdano +branch nick: experimental +timestamp: Tue 2008-02-12 19:40:18 +0000 +message: + Fixed bug where script changes weren't getting saved. + Added check to make sure encryption information is entered when it's required. +------------------------------------------------------------ +revno: 99 +committer: imdano +branch nick: experimental +timestamp: Mon 2008-02-11 14:55:29 +0000 +message: + Fixed a bug that prevented unsetting the "automatically connect to this network" option. + Some formatting/docstring cleanups. +------------------------------------------------------------ +revno: 98 +committer: imdano +branch nick: experimental +timestamp: Tue 2008-02-05 13:46:42 +0000 +message: + Fixed bug where network entry settings weren't being saved correctly because of overloading the variable "type", which is a built in python function. + Cleaned up some formatting in gui.py and daemon.py + Fixed some bad daemon calls in the setting saving process. +------------------------------------------------------------ +revno: 97 +committer: imdano +branch nick: experimental +timestamp: Tue 2008-01-29 21:03:19 +0000 +message: + Fixed bad except statement in misc.py. + Cleaned up formatting in gui.py. + Made glade template for preferences dialog and rewrote gui.py to use it instead of creating it explictly in the code. + Fixed a bunch indentation/whitespace problems. + Cleaned up a ton of formatting in daemon.py + Fixed a wired autoconnect bug. + Rewrote part of the connection monitoring code, further minimizing the number of external program calls, as well as number of dbus calls. + Added StatusInformation methods to daemon.py, to allow external apps to poll for the current connection status without making several dbus calls. + Fixed bad function call to GetDBMSignalStrength in daemon.py. +------------------------------------------------------------ +revno: 96 +committer: imdano +branch nick: experimental +timestamp: Sun 2008-01-27 15:36:00 +0000 +message: + Got rid of extra call to ethtool that should only be done if using mii-tool fallback. +------------------------------------------------------------ +revno: 95 +committer: imdano +branch nick: experimental +timestamp: Sun 2008-01-27 15:32:21 +0000 +message: + Fixed some malformed regular expressions. +------------------------------------------------------------ +revno: 94 +committer: imdano +branch nick: experimental +timestamp: Fri 2008-01-25 14:12:32 +0000 +message: + Refactored several files (especially gui.py) to be more in line with python conventions and make the code easier to understand. + Added a bunch of docstrings. + Fixed an invalid function call in wnettools.py. +------------------------------------------------------------ +revno: 93 +committer: imdano +branch nick: experimental +timestamp: Fri 2008-01-25 14:11:59 +0000 +message: + Refactored several files (especially gui.py) to be more in line with python conventions and make the code easier to understand. + Added a bunch of docstrings. + Fixed an invalid function call in wnettools.py. +------------------------------------------------------------ +revno: 92 +committer: imdano +branch nick: experimental +timestamp: Fri 2008-01-25 09:23:50 +0000 +message: + Made IsValidIP method check that each ip octet is an integer < 255. + Added checks to the network entry settings menu to make sure that all the settings are valid. + Fixed global dns being set to True whenever static IP address were enabled for wireless networks. +------------------------------------------------------------ +revno: 91 +committer: imdano +branch nick: experimental +timestamp: Thu 2008-01-24 14:28:20 +0000 +message: + Forgot a file in the last commit. +------------------------------------------------------------ +revno: 90 +committer: imdano +branch nick: experimental +timestamp: Thu 2008-01-24 14:25:27 +0000 +message: + Simplified psk escape process. +------------------------------------------------------------ +revno: 89 +committer: imdano +branch nick: experimental +timestamp: Thu 2008-01-24 10:36:22 +0000 +message: + Committed patch from Sabin Iacob to sanitize a user's psk, to prevent possible parsing errors and security risks. +------------------------------------------------------------ +revno: 88 +committer: imdano +branch nick: experimental +timestamp: Tue 2008-01-22 16:05:30 +0000 +message: + Refactored a few daemon methods from bring registered under the 'wireless' service to 'daemon'. + Fixed the wired autoconnect profile chooser, which was badly broken. + Added a check to GetPluggedIn() that makes sure that the wired interface is up before checking. If it's not, it tries to put it up. This is necessary because ethtool doesn't make this check for us, as mii-tool did. +------------------------------------------------------------ +revno: 87 +committer: imdano +branch nick: experimental +timestamp: Tue 2008-01-22 09:55:42 +0000 +message: + Moved the advanced settings and script buttons into the main network entry expander. +------------------------------------------------------------ +revno: 86 +committer: imdano +branch nick: experimental +timestamp: Tue 2008-01-22 09:24:23 +0000 +message: + Fixed dns entries not getting cleared from wireless network preferences when they should be + Added signal strength info to uppermost level of each wireless network entry in the GUI. +------------------------------------------------------------ +revno: 85 +committer: imdano +branch nick: experimental +timestamp: Sun 2008-01-20 23:09:29 +0000 +message: + - Simplified main configuration loading code. This *might* break some old conf files, but should be easy to manually fix. + - Reworked GUI: Moved script button next to connect button, reduced size of both buttons, moved advanced settings from an expander to a dialog and put an advanced settings button next to scripts/connect buttons. + - When a wireless network has encryption enabled, "Secured" will no longer show up in the info for the network unless the encryption type can't be determined. + - Added support for detecting kill switch status (thanks to webograph for the inital patch). + - Reduced the number of calls to iwconfig during connection status updates (it is only called once per update now), which should lower cpu usage. + - Moved Autoreconnect methods from the wireless dbus service to the daemon dbus service. + - Added "Validating Authentication" status message during wireless connection process. + - Added support for disabling monitoring of connection status when computer is suspended, which gets rid of some error messages, eliminates occasional suspension failure, and reduces the odds that wicd will auto connect to a wireless network when a wired network is available. (Right now this feature is disabled, as it requires a script in /etc/acpi/suspend.d/, which can't be included with the current SVN layout.) +------------------------------------------------------------ +revno: 84 +committer: compwiz18 +branch nick: experimental +timestamp: Tue 2008-01-15 02:11:36 +0000 +message: + Updated comments in misc.py + Updated some GUI elements +------------------------------------------------------------ +revno: 83 +committer: imdano +branch nick: experimental +timestamp: Wed 2008-01-09 22:57:13 +0000 +message: + Fixed bad language key for "wired network" in wicd.py +------------------------------------------------------------ +revno: 82 +committer: imdano +branch nick: experimental +timestamp: Tue 2008-01-08 10:24:44 +0000 +message: + Updated wicd.glade to include a missing gtk.Dialog +------------------------------------------------------------ +revno: 81 +committer: imdano +branch nick: experimental +timestamp: Sun 2008-01-06 21:20:15 +0000 +message: + A default wired profile is now created when wired-settings.conf is initially generated. +------------------------------------------------------------ +revno: 80 +committer: imdano +branch nick: experimental +timestamp: Sun 2008-01-06 13:55:23 +0000 +message: + Changed misc.Run to use subprocess.Popen instead of os.popen. Also altered Run to optionally return a pipe to the command run, instead of just the output. + The output of dhclient is now parsed by wicd and used to determine why the connection failed. + All the wpa_supplicant conf files will now generate a ctrl_interface, so that they can be accessed by wpa_cli. wpa_cli now is used by wicd to attempt to determine is wpa_supplicant authentication was successful. This is still experimental, and might have to be tweaked to work properly. + If wicd.py is started and the daemon isn't present, it will autolaunch it by calling launchdaemon.sh, instead of asking the user to start the daemon manually. + Cleaned up some comments, formatting, etc. + Probably a couple of other little bug fixes I'm forgetting. +------------------------------------------------------------ +revno: 79 +committer: imdano +branch nick: experimental +timestamp: Fri 2008-01-04 14:08:14 +0000 +message: + Fixed resizing causing the window to center itself. +------------------------------------------------------------ +revno: 78 +committer: imdano +branch nick: experimental +timestamp: Sat 2007-12-29 11:56:47 +0000 +message: + Scripts now can only be setup with root access and always run as root, instead of trying to run as the current user. + Possibly fixed problems with scripts not running when they should and/or leaving zombies. + Slightly reworked the GUI to make the new script system look nicer. + Removed the ability to set script information through built in daemon functions, it now has to be done by directly editing configuration files (which require root access to read/write). +------------------------------------------------------------ +revno: 77 +committer: imdano +branch nick: experimental +timestamp: Sat 2007-12-22 22:09:00 +0000 +message: + Make sure daemon alerts tray to change status during connection process. + Specify which network is being connected to in both the tray tooltip and gui statusbar + Clean up code in wicd.py. + Refactor Edgy/DapperTrayIcon class names to something less Ubuntu-specific. + Fix typo in EggTrayIcon that would keep gui from opening. +------------------------------------------------------------ +revno: 76 +committer: imdano +branch nick: experimental +timestamp: Wed 2007-12-19 22:35:07 +0000 +message: + Fixed cancelling a connection not working. + Stopped the gui status bar from updating while the gui is closed, which reduces CPU usage and should hopefully fix problems with hibernation not working while wicd was running. +------------------------------------------------------------ +revno: 75 +committer: imdano +branch nick: experimental +timestamp: Mon 2007-12-17 15:44:41 +0000 +message: + Fixed a bug that would sometimes cause the tray icon to not display the right connection state on startup. +------------------------------------------------------------ +revno: 74 +committer: compwiz18 +branch nick: experimental +timestamp: Mon 2007-12-17 15:22:04 +0000 +message: + * Fixed a couple more syntax errors +------------------------------------------------------------ +revno: 73 +committer: compwiz18 +branch nick: experimental +timestamp: Mon 2007-12-17 15:20:02 +0000 +message: + * Fixed indentation errors and syntax errors + * Fixed wicd.py so it starts properly + * Hid the status bar in gui.py when it is displayed via the tray icon +------------------------------------------------------------ +revno: 72 +committer: imdano +branch nick: experimental +timestamp: Mon 2007-12-17 15:17:00 +0000 +message: + Fixed some problems with tabs being used instead of 4 spaces. +------------------------------------------------------------ +revno: 71 +committer: imdano +branch nick: experimental +timestamp: Mon 2007-12-17 11:49:03 +0000 +message: + Fixed a bug (typo?) in daemon.py that would keep it from working correctly. +------------------------------------------------------------ +revno: 70 +committer: imdano +branch nick: experimental +timestamp: Mon 2007-12-17 11:42:16 +0000 +message: + Lowered minimum GUI height to 400. + Added support for the GUI to remember when its resized. +------------------------------------------------------------ +revno: 69 +committer: compwiz18 +branch nick: experimental +timestamp: Sun 2007-12-16 19:08:00 +0000 +message: + Applied pach in https://bugs.launchpad.net/wicd/+bug/175104 to fix signal strength issues, thanks Philip +------------------------------------------------------------ +revno: 68 +committer: imdano +branch nick: experimental +timestamp: Mon 2007-12-10 16:48:37 +0000 +message: + Moved autoreconnect code and connection status updates into the daemon. Daemon now sends D-Bus signals when status changes, which the tray listens for and updates icon/tooltip when received. +------------------------------------------------------------ +revno: 67 +committer: imdano +branch nick: experimental +timestamp: Tue 2007-12-04 12:02:14 +0000 +message: + Fix some indentation problems and turned off stdout/stderr redirection in wicd.py since it would break things. +------------------------------------------------------------ +revno: 66 +committer: imdano +branch nick: experimental +timestamp: Thu 2007-11-22 10:23:33 +0000 +message: + Adding peap-tkip template part 2 +------------------------------------------------------------ +revno: 65 +committer: imdano +branch nick: experimental +timestamp: Tue 2007-11-20 22:20:10 +0000 +message: + Fixed encoding problems that would cause wicd to crash if a network returned an essid with exotic characters. + Reduced log spam, and altered how logging gets done a little bit. + Cleaned up some comments, docstrings, etc. +------------------------------------------------------------ +revno: 64 +committer: imdano +branch nick: experimental +timestamp: Mon 2007-11-19 13:22:14 +0000 +message: + Fixed some problems with the tray icon running under gtk < 2.10. +------------------------------------------------------------ +revno: 63 +committer: imdano +branch nick: experimental +timestamp: Sun 2007-11-18 14:19:50 +0000 +message: + - Fixed a crash bug caused by dBm signal strength not being found correctly. + - Fixed a crash caused by an incorrectly named variable in wicd.py. +------------------------------------------------------------ +revno: 62 +committer: imdano +branch nick: experimental +timestamp: Sun 2007-11-18 01:37:16 +0000 +message: + * Removing files (all tray-related) that are no longer used. +------------------------------------------------------------ +revno: 61 +committer: imdano +branch nick: experimental +timestamp: Sun 2007-11-18 01:35:35 +0000 +message: + * Completely reworked the gui/tray system. gui.py and edgy/dapper/tray.py are now all run from the same wicd.py file. + * Added a connection_lost_counter to prevent the wicd frontend from trying to automatically reconnect too quickly if signal strength is briefly lost. + * Added some code to hopefully fix some of the dbus-related encoding problems caused by essids with weird characters. (Might still need work). + * The tray/gui will now show up in the process manager under the name wicd (along with the wicd icon), instead of just python. + * Added a GetCurrentInterface() method to the daemon that will eventually be used in the VPN plugin. + * Fixed a possible crash caused by signal strength not being returned correctly. + * Split the Wired Profile Chooser from the appGui class, so they are now called separately within wicd.py. When the profile chooser is called from the daemon, it sets a flag as well as sending a dbus signal, so the chooser will still launch if the wicd frontend isn't running yet. + * Added some docstrings, comments, etc. Probably a few other small changes I'm forgetting. +------------------------------------------------------------ +revno: 60 +committer: compwiz18 +branch nick: experimental +timestamp: Tue 2007-10-23 00:45:36 +0000 +message: + Fixed the typo in the LEAP template. +------------------------------------------------------------ +revno: 59 +committer: compwiz18 +branch nick: experimental +timestamp: Fri 2007-10-05 02:29:42 +0000 +message: + applied patch from bug https://bugs.launchpad.net/wicd/+bug/149318 + applied patch from bug https://bugs.launchpad.net/wicd/+bug/149322 + thanks Daniel +------------------------------------------------------------ +revno: 58 +committer: compwiz18 +branch nick: experimental +timestamp: Thu 2007-10-04 03:31:07 +0000 +message: + Added mhenze's patch to add last used wired profile +------------------------------------------------------------ +revno: 57 +committer: imdano +branch nick: experimental +timestamp: Thu 2007-09-20 13:11:43 +0000 +message: + Fixed more signal display issues + Added a "Connecting..." dialog to tray icon in experimental branch + Possibly fixed issue where GUI statusbar would still show up as connected when ethernet cable was unplugged. +------------------------------------------------------------ +revno: 56 +committer: imdano +branch nick: experimental +timestamp: Wed 2007-09-19 09:56:17 +0000 +message: + Fixed bug in signal strength display for ralink cards + Altered the way ralink network info gets handled during the connection process +------------------------------------------------------------ +revno: 55 +committer: compwiz18 +branch nick: experimental +timestamp: Tue 2007-09-04 02:43:25 +0000 +message: + fixed indentation problems +------------------------------------------------------------ +revno: 54 +committer: imdano +branch nick: experimental +timestamp: Fri 2007-08-31 08:19:13 +0000 +message: + Fixed bug where manually opened (not opened with the tray) gui.py would reopen when closed. +------------------------------------------------------------ +revno: 53 +committer: imdano +branch nick: experimental +timestamp: Wed 2007-08-29 18:49:02 +0000 +message: + Completely reorganized edgy.py + Changed the way wired profile chooser gets launched (now uses a dbus signal) + Fixed bug where launching gui.py through the tray sometimes left a zombie (uses a dbus signal) + Added a bunch of docstrings and changed formatting to follow python conventions + Added support for displaying signal strength in dBm instead of a percentage + Added some print statements during the ad-hoc connection process + Started work on a way to autoconnect to a hidden network (not done or working yet) +------------------------------------------------------------ +revno: 52 +committer: imdano +branch nick: experimental +timestamp: Fri 2007-08-17 06:13:08 +0000 +message: + Reverted an accidental change to networking.py that undid a bug fix +------------------------------------------------------------ +revno: 51 +committer: compwiz18 +branch nick: experimental +timestamp: Fri 2007-08-17 04:36:16 +0000 +message: + fixed the tray icon +------------------------------------------------------------ +revno: 50 +committer: imdano +branch nick: experimental +timestamp: Thu 2007-08-16 12:18:03 +0000 +message: + Changed script execution behavior to fork before running. Causes more reliable execution but can leave zombies. +------------------------------------------------------------ +revno: 49 +committer: compwiz18 +branch nick: experimental +timestamp: Thu 2007-08-16 05:55:45 +0000 +message: + fixed a couple of bugs: + + wnettools.py: DetectWirelessInterfaces() didn't return the wireless interface + daemon.py: GetGlobalDNSAddresses() now returns a blank string instead of None for blank addresses; None could not be sent over dbus +------------------------------------------------------------ +revno: 48 +committer: metrics +branch nick: experimental +timestamp: Thu 2007-08-16 01:53:13 +0000 +message: + Fix up some issues spotted by pychecker. +------------------------------------------------------------ +revno: 47 +committer: metrics +branch nick: experimental +timestamp: Thu 2007-08-16 01:07:26 +0000 +message: + Split the networking module, moving the common tasks into wnettools.py + + By splitting the common tasks performed by the networking module out + into a separate set of classes, it is possible to reduce code + duplication and improve the structure of the networking module. + + The wnettools module now performs _almost_ all the actual commands that + control the network interfaces, splitting it from the actual connection + logic contained in the networking module. Splitting these two tasks also + allows for tool changes to be made in a central location, rather than + spread throughout the networking.py file. +------------------------------------------------------------ +revno: 46 +committer: imdano +branch nick: experimental +timestamp: Wed 2007-08-15 07:25:10 +0000 +message: + Added a bunch of bug fixes from the experimental branch to the testing branch. + Added disconnect script feature and executing script in usermode feature to testing branch +------------------------------------------------------------ +revno: 45 +committer: imdano +branch nick: experimental +timestamp: Tue 2007-08-14 17:02:38 +0000 +message: + Fixed the typo in networking.py correctly this time :) + Corrected the version number displayed in usage() +------------------------------------------------------------ +revno: 44 +committer: imdano +branch nick: experimental +timestamp: Tue 2007-08-14 16:01:30 +0000 +message: + Improved the behavior of threading in networking.py when an error occurs. + Fixed typo in the wpa_supplicant string in networking.py. + Changed formatting in dapper.py, edgy.py, and networking.py to conform closer to python coding conventions (and hopefully improve readability in general) +------------------------------------------------------------ +revno: 43 +committer: metrics +branch nick: experimental +timestamp: Sun 2007-08-12 03:31:04 +0000 +message: + Refactor daemon.py to handle command line arguments. + + Move the old module code in daemon.py into a main() function, splitting + off the daemonization into daemonize() function. Also add correct + parsing of command line arguments to allow disabling of stderr and + stdout redirection, daemonizing and auto-connect. + + Tidy up start of file including correct GPL license pre-amble and a + short description of the wicd daemon module. +------------------------------------------------------------ +revno: 42 +committer: metrics +branch nick: experimental +timestamp: Sun 2007-08-12 01:36:49 +0000 +message: + Convert FlushWriter into LogWriter and optimise log writing. + + FlushWriter looped through all the characters provided, writing them one + at a time. This is not strictly necessary, so modify the algorithm to + use a smart substitution and keep the timestamps correct. Name change to + better match its behaviour. +------------------------------------------------------------ +revno: 41 +committer: metrics +branch nick: experimental +timestamp: Sun 2007-08-12 00:30:01 +0000 +message: + Centralise path configuration into a single file. + + Path configuration was distributed throughout wicd, making it difficult + to move around project files. Centralise the configuration into + wpath.py. +------------------------------------------------------------ +revno: 40 +committer: imdano +branch nick: experimental +timestamp: Fri 2007-08-10 07:59:36 +0000 +message: + Added disconnection script + Changed auto-reconnection behavior slightly to prevent possible hanging issues + Changed/Added some comments +------------------------------------------------------------ +revno: 39 +committer: imdano +branch nick: experimental +timestamp: Sat 2007-08-04 19:09:05 +0000 +message: + Added support for displaying correct network info in drivers using some non-standard display info. +------------------------------------------------------------ +revno: 38 +committer: imdano +branch nick: experimental +timestamp: Wed 2007-08-01 09:31:43 +0000 +message: + Changed script execution method so that scripts are always run in usermode. + Removed autostarting daemon code so that script execution would work properly. + Added channel display support for cards that only get frequency info in 'iwlist scan'. + Changed autoconnect behavior to fix a bug where dbus would crash if connecting was taking too long. + Changed/added some comments. +------------------------------------------------------------ +revno: 37 +committer: imdano +branch nick: experimental +timestamp: Sun 2007-07-29 08:17:00 +0000 +message: + made get debugmode function return an int +------------------------------------------------------------ +revno: 36 +committer: imdano +branch nick: experimental +timestamp: Sat 2007-07-28 11:20:38 +0000 +message: + added a debugmode check to dapper.py +------------------------------------------------------------ +revno: 35 +committer: imdano +branch nick: experimental +timestamp: Sat 2007-07-28 11:19:18 +0000 +message: + fixed a bug in the open/close gui function in dapper.py + fixed a bug in getdebugmode function in daemon.py +------------------------------------------------------------ +revno: 34 +committer: imdano +branch nick: experimental +timestamp: Fri 2007-07-27 18:20:51 +0000 +message: + Rewrote dapper.py to act just like edgy.py (needs to be tested), changed some gui behavior, fixed version numbers in experimental/testing daemon.py +------------------------------------------------------------ +revno: 33 +committer: imdano +branch nick: experimental +timestamp: Wed 2007-07-25 17:59:31 +0000 +message: + Updated autoconnect.py to reflect changes to daemon +------------------------------------------------------------ +revno: 32 +committer: imdano +branch nick: experimental +timestamp: Wed 2007-07-25 09:04:39 +0000 +message: + Fixed typo in the testing release, added ralink correct signal strength info to experimental release, fixed wired connection bug in experimental release +------------------------------------------------------------ +revno: 31 +committer: imdano +branch nick: experimental +timestamp: Tue 2007-07-24 15:30:59 +0000 +message: + fixed a typo +------------------------------------------------------------ +revno: 30 +committer: compwiz18 +branch nick: experimental +timestamp: Tue 2007-07-24 06:31:07 +0000 +message: + daemon will now fork +------------------------------------------------------------ +revno: 29 +committer: compwiz18 +branch nick: experimental +timestamp: Tue 2007-07-24 06:06:27 +0000 +message: + updates and bug fixes and all that fun stuff +------------------------------------------------------------ +revno: 28 +committer: imdano +branch nick: experimental +timestamp: Tue 2007-07-24 05:05:15 +0000 +message: + Added myself as a co-author :) +------------------------------------------------------------ +revno: 27 +committer: imdano +branch nick: experimental +timestamp: Mon 2007-07-23 07:05:05 +0000 +message: + Added wired auto-connect profile chooser, fixed some bugs in the ralink legacy connection code, reorganized edgy.py and fixed some bugs in it, probably a few other things too +------------------------------------------------------------ +revno: 26 +committer: imdano +branch nick: experimental +timestamp: Tue 2007-07-17 08:03:16 +0000 +message: + fixed bug where wired icon wouldn't change if cable became unplugged, fixed yet another indentation screw up +------------------------------------------------------------ +revno: 25 +committer: imdano +branch nick: experimental +timestamp: Tue 2007-07-17 07:33:18 +0000 +message: + improved autoreconnect code +------------------------------------------------------------ +revno: 24 +committer: imdano +branch nick: experimental +timestamp: Tue 2007-07-17 07:19:10 +0000 +message: + fixed a screw up in my indentation in edgy.py, changed tabs to 4 spaces everywhere it wasn't already +------------------------------------------------------------ +revno: 23 +committer: compwiz18 +branch nick: experimental +timestamp: Mon 2007-07-16 09:23:18 +0000 +message: + daemon will now daemonize +------------------------------------------------------------ +revno: 22 +committer: compwiz18 +branch nick: experimental +timestamp: Mon 2007-07-16 08:35:07 +0000 +message: + fixed global DNS +------------------------------------------------------------ +revno: 21 +committer: imdano +branch nick: experimental +timestamp: Mon 2007-07-16 06:41:34 +0000 +message: + removed conflict resolution info that would probably cause syntax errors +------------------------------------------------------------ +revno: 20 +committer: imdano +branch nick: experimental +timestamp: Mon 2007-07-16 06:34:23 +0000 +message: + Added support for ralink legacy cards, implemented a debug mode option, swapped order that autoconnect uses, fixed some indentation issues, changed/added some comments +------------------------------------------------------------ +revno: 19 +committer: compwiz18 +branch nick: experimental +timestamp: Mon 2007-07-16 06:16:52 +0000 +message: + added global dns options (not quite working) +------------------------------------------------------------ +revno: 18 +committer: imdano +branch nick: experimental +timestamp: Wed 2007-07-11 12:47:44 +0000 +message: + Optimized autoconnect for wired code (should be more log friendly) +------------------------------------------------------------ +revno: 17 +committer: imdano +branch nick: experimental +timestamp: Tue 2007-07-10 14:32:45 +0000 +message: + Fixed bug caused by wired/wireless daemons using the same function names +------------------------------------------------------------ +revno: 16 +committer: compwiz18 +branch nick: experimental +timestamp: Tue 2007-07-10 05:39:00 +0000 +message: + syntax error fixed +------------------------------------------------------------ +revno: 15 +committer: imdano +branch nick: experimental +timestamp: Mon 2007-07-09 14:41:14 +0000 +message: + Added script execution support, added autoconnect to wired network support, created a default wired network system to allow autoconnection +------------------------------------------------------------ +revno: 14 +committer: imdano +branch nick: experimental +timestamp: Mon 2007-07-09 09:38:45 +0000 +message: + Removed sleep time in autoreconnect in stable (it would sometimes make it impossible to open the GUI), removed sleep time and altered autoreconnect behavior in experimental. (Try #3) +------------------------------------------------------------ +revno: 13 +committer: imdano +branch nick: experimental +timestamp: Mon 2007-07-09 09:27:13 +0000 +message: + Removed sleep time in autoreconnect in stable (it would sometimes make it impossible to open the GUI), removed sleep time and altered autoreconnect behavior in experimental. +------------------------------------------------------------ +revno: 12 +committer: imdano +branch nick: experimental +timestamp: Mon 2007-07-09 09:21:42 +0000 +message: + Removed sleep time in autoreconnect in stable (it would sometimes make it impossible to open the GUI), removed sleep time and altered autoreconnect behavior in experimental. +------------------------------------------------------------ +revno: 11 +committer: compwiz18 +branch nick: experimental +timestamp: Sun 2007-07-08 20:12:44 +0000 +message: + changed version number +------------------------------------------------------------ +revno: 10 +committer: imdano +branch nick: experimental +timestamp: Sun 2007-07-08 10:36:47 +0000 +message: + Added DNS fix to wired class +------------------------------------------------------------ +revno: 9 +committer: imdano +branch nick: experimental +timestamp: Sun 2007-07-08 10:31:48 +0000 +message: + Fixed a static DNS bug and added some comments / fixed some typos +------------------------------------------------------------ +revno: 8 +committer: imdano +branch nick: experimental +timestamp: Sun 2007-07-08 10:31:28 +0000 +message: + Fixed a static DNS bug and added some comments / fixed some typos +------------------------------------------------------------ +revno: 7 +committer: imdano +branch nick: experimental +timestamp: Sun 2007-07-08 08:34:42 +0000 +message: + shortened sleep time when returning from hibernation +------------------------------------------------------------ +revno: 6 +committer: imdano +branch nick: experimental +timestamp: Sat 2007-07-07 20:31:45 +0000 +message: + some minor adjustments and bug fixes +------------------------------------------------------------ +revno: 5 +committer: compwiz18 +branch nick: experimental +timestamp: Sat 2007-07-07 20:09:37 +0000 +message: + Added ICS support, but commented it out so we can release +------------------------------------------------------------ +revno: 4 +committer: compwiz18 +branch nick: experimental +timestamp: Sat 2007-07-07 08:06:14 +0000 +message: + string table updated +------------------------------------------------------------ +revno: 3 +committer: imdano +branch nick: experimental +timestamp: Thu 2007-07-05 06:53:57 +0000 +message: + Fixed a typo, added note that only WEP can be used for Ad-hoc encryption +------------------------------------------------------------ +revno: 2 +committer: imdano +branch nick: experimental +timestamp: Thu 2007-07-05 05:30:09 +0000 +message: + Fixed bug where tray wouldn't load when it automatically opened the daemon + Fixed some typos +------------------------------------------------------------ +revno: 1 +committer: compwiz18 +branch nick: stable +timestamp: Wed 2007-07-04 14:51:57 +0000 +message: + trying to fix From 8014a2b16ae2fa764a212a450178f84f9b9808cc Mon Sep 17 00:00:00 2001 From: Andrew Psaltis Date: Tue, 21 Apr 2009 13:16:44 -0400 Subject: [PATCH 052/186] Added support for disabling nonexistent external tools in the pref_curses.py. Added a DynRadioButton in curses_misc.py. --- curses/curses_misc.py | 6 ++++++ curses/prefs_curses.py | 26 ++++++++++++++++++-------- 2 files changed, 24 insertions(+), 8 deletions(-) diff --git a/curses/curses_misc.py b/curses/curses_misc.py index 22b5b12..9639c9a 100644 --- a/curses/curses_misc.py +++ b/curses/curses_misc.py @@ -107,6 +107,12 @@ class DynIntEdit(DynWrap): edit = urwid.IntEdit(caption,edit_text) self.__super.__init__(edit,sensitive,attrs,focus_attr) +class DynRadioButton(DynWrap): + def __init__(self,group,label,state='first True',on_state_change=None, user_data=None, sensitive=True, attrs=('body','editnfc'),focus_attr='body'): + #caption = ('editcp',caption + ':') + button = urwid.RadioButton(group,label,state,on_state_change,user_data) + self.__super.__init__(button,sensitive,attrs,focus_attr) + class MaskingEditException(Exception): pass diff --git a/curses/prefs_curses.py b/curses/prefs_curses.py index 45a2d86..d51c61d 100644 --- a/curses/prefs_curses.py +++ b/curses/prefs_curses.py @@ -24,7 +24,7 @@ import urwid.curses_display from wicd import misc from wicd import dbusmanager -from curses_misc import SelText,DynWrap,ComboBox,TabColumns +from curses_misc import SelText,DynWrap,DynRadioButton,ComboBox,TabColumns daemon = None wireless = None @@ -179,21 +179,24 @@ class PrefsDialog(urwid.WidgetWrap): self.dhcp_l = [] # Automatic self.dhcp0 = urwid.RadioButton(self.dhcp_l,automatic_t) - self.dhcp1 = urwid.RadioButton(self.dhcp_l,dhcp1_t) - self.dhcp2 = urwid.RadioButton(self.dhcp_l,dhcp2_t) - self.dhcp3 = urwid.RadioButton(self.dhcp_l,dhcp3_t) + self.dhcp1 = DynRadioButton(self.dhcp_l,dhcp1_t) + self.dhcp2 = DynRadioButton(self.dhcp_l,dhcp2_t) + self.dhcp3 = DynRadioButton(self.dhcp_l,dhcp3_t) + self.dhcp_l = [self.dhcp0,self.dhcp1,self.dhcp2,self.dhcp3] self.wired_l = [] self.wired_detect_header = urwid.Text(wired_detect_header_t) self.wired0 = urwid.RadioButton(self.wired_l,automatic_t) - self.wired1 = urwid.RadioButton(self.wired_l,wired1_t) - self.wired2 = urwid.RadioButton(self.wired_l,wired2_t) + self.wired1 = DynRadioButton(self.wired_l,wired1_t) + self.wired2 = DynRadioButton(self.wired_l,wired2_t) + self.wired_l = [self.wired0,self.wired1,self.wired2] self.flush_l = [] self.flush_header = urwid.Text(flush_header_t) self.flush0 = urwid.RadioButton(self.flush_l,automatic_t) - self.flush1 = urwid.RadioButton(self.flush_l,flush1_t) - self.flush2 = urwid.RadioButton(self.flush_l,flush2_t) + self.flush1 = DynRadioButton(self.flush_l,flush1_t) + self.flush2 = DynRadioButton(self.flush_l,flush2_t) + self.flush_l = [self.flush0,self.flush1,self.flush2] externalLB = urwid.ListBox([self.dhcp_header, self.dhcp0,self.dhcp1,self.dhcp2,self.dhcp3, @@ -267,13 +270,20 @@ class PrefsDialog(urwid.WidgetWrap): self.wired_auto_l[daemon.GetWiredAutoConnectMethod()-1] self.auto_reconn_checkb.set_state(daemon.GetAutoReconnect()) + def find_avail(apps): + for app in apps[1:]: + app.set_sensitive(daemon.GetAppAvailable(app.get_label())) + ### External Programs + find_avail(self.dhcp_l) dhcp_method = daemon.GetDHCPClient() self.dhcp_l[dhcp_method].set_state(True) + find_avail(self.wired_l) wired_link_method = daemon.GetLinkDetectionTool() self.wired_l[wired_link_method].set_state(True) + find_avail(self.flush_l) flush_method = daemon.GetFlushTool() self.flush_l[flush_method].set_state(True) From 72e6bb73de7b91825b17b43c6a8bf560eb39987c Mon Sep 17 00:00:00 2001 From: Andrew Psaltis Date: Tue, 21 Apr 2009 13:34:01 -0400 Subject: [PATCH 053/186] Fix bug introduced in r356 where wicd would crash upon not finding dhclient. --- wicd/wnettools.py | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/wicd/wnettools.py b/wicd/wnettools.py index 243fbff..51ad50c 100644 --- a/wicd/wnettools.py +++ b/wicd/wnettools.py @@ -296,11 +296,13 @@ class BaseInterface(object): """ self.dhclient_cmd = self._find_program_path("dhclient") - output = misc.Run(self.dhclient_cmd + " --version", include_stderr=True) - if '4.' in output: - self.dhclient_needs_verbose = True - else: - self.dhclient_needs_verbose = False + if self.dhclient_cmd != None: + output = misc.Run(self.dhclient_cmd + " --version", + include_stderr=True) + if '4.' in output: + self.dhclient_needs_verbose = True + else: + self.dhclient_needs_verbose = False self.dhcpcd_cmd = self._find_program_path("dhcpcd") self.pump_cmd = self._find_program_path("pump") From fedd788264ccf8c12bace8373eb080ad4b1532d9 Mon Sep 17 00:00:00 2001 From: Andrew Psaltis Date: Tue, 21 Apr 2009 14:09:29 -0400 Subject: [PATCH 054/186] Fixed a problem where if a scan is initiated externally, and wicd-curses doesn't see it, wicd-curses will half-drop a running big dialog. --- curses/wicd-curses.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/curses/wicd-curses.py b/curses/wicd-curses.py index a8ce2dfb..db9641a 100755 --- a/curses/wicd-curses.py +++ b/curses/wicd-curses.py @@ -616,7 +616,8 @@ class appGUI(): self.do_diag_lock = False return True self.update_netlist(force_check=True) - self.frame.set_body(self.thePile) + if not self.diag: + self.frame.set_body(self.thePile) self.screen_locked = False self.update_ui() From 97d553bce3f8e99a63a0ff7783b222fe793c3d22 Mon Sep 17 00:00:00 2001 From: Dan O'Reilly Date: Tue, 21 Apr 2009 20:30:40 -0400 Subject: [PATCH 055/186] Use atexit instead of catching SIGTERM in wicd-daemon. Use Popen to launch wicd-monitor instead of gobject.spawn_async. --- wicd/wicd-client.py | 2 +- wicd/wicd-daemon.py | 16 +++++++--------- 2 files changed, 8 insertions(+), 10 deletions(-) diff --git a/wicd/wicd-client.py b/wicd/wicd-client.py index 6c072a7..bcb4900 100755 --- a/wicd/wicd-client.py +++ b/wicd/wicd-client.py @@ -660,7 +660,7 @@ def setup_dbus(force=True): misc.PromptToStartDaemon() try: dbusmanager.connect_to_dbus() - except dbusmanager.DBusException: + except DBusException: error(None, "Could not connect to wicd's D-Bus interface. " + "Check the wicd log for error messages.") return False diff --git a/wicd/wicd-daemon.py b/wicd/wicd-daemon.py index 513716b..a2203e7 100755 --- a/wicd/wicd-daemon.py +++ b/wicd/wicd-daemon.py @@ -37,6 +37,8 @@ import sys import time import getopt import signal +import atexit +from subprocess import Popen # DBUS import gobject @@ -1601,8 +1603,6 @@ def daemonize(): os.dup2(0, 2) -child_pid = None - def main(argv): """ The main daemon program. @@ -1610,7 +1610,6 @@ def main(argv): argv -- The arguments passed to the script. """ - global child_pid do_daemonize = True redirect_stderr = True redirect_stdout = True @@ -1667,9 +1666,10 @@ def main(argv): wicd_bus = dbus.service.BusName('org.wicd.daemon', bus=bus) daemon = WicdDaemon(wicd_bus, auto_connect=auto_connect) if not no_poll: - (child_pid, x, y, z) = gobject.spawn_async( - [misc.find_path("python"), "-O", os.path.join(wpath.lib, "monitor.py")]) - signal.signal(signal.SIGTERM, sigterm_caught) + child_pid = Popen([misc.find_path("python"), "-O", + os.path.join(wpath.lib, "monitor.py")], + shell=False, close_fds=True).pid + atexit.register(on_exit, child_pid) # Enter the main loop mainloop = gobject.MainLoop() @@ -1678,11 +1678,9 @@ def main(argv): except KeyboardInterrupt: pass daemon.DaemonClosing() - sigterm_caught() -def sigterm_caught(sig=None, frame=None): +def on_exit(child_pid): """ Called when a SIGTERM is caught, kills monitor.py before exiting. """ - global child_pid if child_pid: print 'Daemon going down, killing wicd-monitor...' try: From 779fb40fff22327bdce749641b692181895dfc24 Mon Sep 17 00:00:00 2001 From: Dan O'Reilly Date: Tue, 21 Apr 2009 21:25:59 -0400 Subject: [PATCH 056/186] Refactor monitor.py polling code to remove reliance on globals. Make sure we update the polling rate in wicd-monitor when the backend changes. --- wicd/monitor.py | 59 ++++++++++++++++++++++++++------------------- wicd/wicd-daemon.py | 6 +++++ 2 files changed, 40 insertions(+), 25 deletions(-) diff --git a/wicd/monitor.py b/wicd/monitor.py index d47add5..82727cd 100755 --- a/wicd/monitor.py +++ b/wicd/monitor.py @@ -45,7 +45,7 @@ daemon = dbus_dict["daemon"] wired = dbus_dict["wired"] wireless = dbus_dict["wireless"] -monitor = to_time = update_callback = mainloop = None +mainloop = None def diewithdbus(func): def wrapper(self, *__args, **__kargs): @@ -86,11 +86,42 @@ class ConnectionStatus(object): self.iwconfig = "" self.trigger_reconnect = False self.__lost_dbus_count = 0 - + self._to_time = daemon.GetBackendUpdateInterval() + + self.add_poll_callback() bus = dbusmanager.get_bus() bus.add_signal_receiver(self._force_update_connection_status, "UpdateState", "org.wicd.daemon") + bus.add_signal_receiver(self._update_timeout_interval, + "SignalBackendChanged", "org.wicd.daemon") + def _update_timeout_interval(self, interval): + """ Update the callback interval when signaled by the daemon. """ + self._to_time = interval + gobject.source_remove(self.update_callback) + self.add_poll_callback() + + def _force_update_connection_status(self): + """ Run a connection status update on demand. + + Removes the scheduled update_connection_status() + call, explicitly calls the function, and reschedules + it. + + """ + gobject.source_remove(self.update_callback) + self.update_connection_status() + self.add_poll_callback() + + def add_poll_callback(self): + """ Registers a polling call at a predetermined interval. + + The polling interval is determined by the backend in use. + + """ + self.update_callback = misc.timeout_add(self._to_time, + self.update_connection_status) + def check_for_wired_connection(self, wired_ip): """ Checks for a wired connection. @@ -229,19 +260,6 @@ class ConnectionStatus(object): self.auto_reconnect(from_wireless) return self.update_state(state) - def _force_update_connection_status(self): - """ Run a connection status update on demand. - - Removes the scheduled update_connection_status() - call, explicitly calls the function, and reschedules - it. - - """ - global update_callback - gobject.source_remove(update_callback) - self.update_connection_status() - add_poll_callback() - def update_state(self, state, wired_ip=None, wifi_ip=None): """ Set the current connection state. """ # Set our connection state/info. @@ -333,12 +351,6 @@ def err_handle(error): """ Just a dummy function needed for asynchronous dbus calls. """ pass -def add_poll_callback(): - global monitor, to_time, update_callback - - update_callback = misc.timeout_add(to_time, - monitor.update_connection_status) - def main(): """ Starts the connection monitor. @@ -346,11 +358,8 @@ def main(): an amount of time determined by the active backend. """ - global monitor, to_time, mainloop - + global mainloop monitor = ConnectionStatus() - to_time = daemon.GetBackendUpdateInterval() - add_poll_callback() mainloop = gobject.MainLoop() mainloop.run() diff --git a/wicd/wicd-daemon.py b/wicd/wicd-daemon.py index a2203e7..073d1b1 100755 --- a/wicd/wicd-daemon.py +++ b/wicd/wicd-daemon.py @@ -208,6 +208,7 @@ class WicdDaemon(dbus.service.Object): self.suspended = True self.wifi.LoadBackend(backend) self.wired.LoadBackend(backend) + self.SignalBackendChanged(self.GetBackendUpdateInterval()) self.SetSuspend(False) @dbus.service.method('org.wicd.daemon') @@ -824,6 +825,11 @@ class WicdDaemon(dbus.service.Object): """ pass + + @dbus.service.signal(dbus_interface='org.wicd.daemon', signature='i') + def SignalBackendChanged(self, interval): + """ Emits a signal when the current backend changes. """ + pass def ReadConfig(self): """ Reads the manager-settings.conf file. From 3665bc3c61c2f2d33b2e77aa771038fe3daec694 Mon Sep 17 00:00:00 2001 From: Adam Blackburn Date: Wed, 22 Apr 2009 21:45:51 +0800 Subject: [PATCH 057/186] Updated vcsinfo.py generation logic --- setup.py | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/setup.py b/setup.py index 35df602..298e894 100755 --- a/setup.py +++ b/setup.py @@ -29,18 +29,21 @@ VERSION_NUM = '1.6.0a1' REVISION_NUM = 'unknown' CURSES_REVNO = 'uimod' +# change to the directory setup.py is contained in +os.chdir(os.path.abspath(__file)) + try: - try: - os.system('bzr version-info --python > vcsinfo.py') - except: - pass + if os.path.exists('.bzr') and os.system('bzr') == 0: + try: + os.system('bzr version-info --python > vcsinfo.py') + except: + pass import vcsinfo REVISION_NUM = vcsinfo.version_info['revno'] except Exception, e: print 'failed to find revision number:' print e - class configure(Command): description = "configure the paths that Wicd will be installed to" From 167b18cdeb25b7415df06e028feaae828fba8673 Mon Sep 17 00:00:00 2001 From: Adam Blackburn Date: Wed, 22 Apr 2009 22:02:31 +0800 Subject: [PATCH 058/186] Updated version number --- setup.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/setup.py b/setup.py index 298e894..ffa05c0 100755 --- a/setup.py +++ b/setup.py @@ -24,7 +24,7 @@ import subprocess # Be sure to keep this updated! # VERSIONNUMBER -VERSION_NUM = '1.6.0a1' +VERSION_NUM = '1.6.0a2' # REVISION_NUM is automatically updated REVISION_NUM = 'unknown' CURSES_REVNO = 'uimod' From 807054bb3af4427b1b61234cb1c79469934f3b14 Mon Sep 17 00:00:00 2001 From: Adam Blackburn Date: Wed, 22 Apr 2009 22:11:33 +0800 Subject: [PATCH 059/186] fixed a typo --- setup.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/setup.py b/setup.py index ffa05c0..5e48064 100755 --- a/setup.py +++ b/setup.py @@ -30,7 +30,7 @@ REVISION_NUM = 'unknown' CURSES_REVNO = 'uimod' # change to the directory setup.py is contained in -os.chdir(os.path.abspath(__file)) +os.chdir(os.path.abspath(__file__)) try: if os.path.exists('.bzr') and os.system('bzr') == 0: From 5b8819bc6cf94eaa3601b6075d4bd1e0a415b458 Mon Sep 17 00:00:00 2001 From: Adam Blackburn Date: Wed, 22 Apr 2009 22:17:39 +0800 Subject: [PATCH 060/186] fixed another typo --- setup.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/setup.py b/setup.py index 5e48064..a66f187 100755 --- a/setup.py +++ b/setup.py @@ -30,7 +30,7 @@ REVISION_NUM = 'unknown' CURSES_REVNO = 'uimod' # change to the directory setup.py is contained in -os.chdir(os.path.abspath(__file__)) +os.chdir(os.path.abspath(os.path.split(__file__)[0])) try: if os.path.exists('.bzr') and os.system('bzr') == 0: From 4998d8c83efda6a86e7a657b886aa6681262bda0 Mon Sep 17 00:00:00 2001 From: Andrew Psaltis Date: Wed, 22 Apr 2009 12:13:06 -0400 Subject: [PATCH 061/186] Set the SVG wicd icon as the window icon in wicd-client. --- wicd/gui.py | 1 + 1 file changed, 1 insertion(+) diff --git a/wicd/gui.py b/wicd/gui.py index 2a2e174..e6bdecb 100644 --- a/wicd/gui.py +++ b/wicd/gui.py @@ -149,6 +149,7 @@ class appGui(object): gladefile = os.path.join(wpath.share, "wicd.glade") self.wTree = gtk.glade.XML(gladefile) self.window = self.wTree.get_widget("window1") + self.window.set_icon_from_file(wpath.icons +'scalable/apps/wicd-client.svg') size = daemon.ReadWindowSize("main") width = size[0] height = size[1] From 72941a17c16ae7b619a6de3cb4c9625701a2bf0b Mon Sep 17 00:00:00 2001 From: Andrew Psaltis Date: Wed, 22 Apr 2009 17:37:50 -0400 Subject: [PATCH 062/186] Made the network preferences dialogs save whether they are using static IPs or not. Thanks to Adam for finding this one. --- curses/netentry_curses.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/curses/netentry_curses.py b/curses/netentry_curses.py index 5bcf2f8..2723efe 100644 --- a/curses/netentry_curses.py +++ b/curses/netentry_curses.py @@ -178,6 +178,9 @@ class WiredSettingsDialog(AdvancedSettingsDialog): self.global_dns_cb.set_state(bool(wired.GetWiredProperty('use_global_dns'))) self.static_dns_cb.set_state(bool(wired.GetWiredProperty('use_static_dns'))) + # Set static ip checkbox. Forgot to do this the first time. + if stringToNone(self.ip_edit.get_edit_text()): + self.static_ip_cb.set_state(True) self.dns1.set_edit_text(self.format_entry( "dns1")) self.dns2.set_edit_text(self.format_entry( "dns2")) self.dns3.set_edit_text(self.format_entry( "dns3")) From a00f7c4ae584b1981e085cf7cc5b55b20e843503 Mon Sep 17 00:00:00 2001 From: Robby Workman Date: Wed, 22 Apr 2009 19:53:08 -0500 Subject: [PATCH 063/186] Added NEWS file with major changes since 1.5.x. Updated CHANGES file with 'bzr log' output as of r367. --- CHANGES | 137 ++++++++++++++++++++++++++++++++++++++++++++++++++++---- NEWS | 34 ++++++++++++++ 2 files changed, 163 insertions(+), 8 deletions(-) create mode 100644 NEWS diff --git a/CHANGES b/CHANGES index 7cf7a3f..065096e 100644 --- a/CHANGES +++ b/CHANGES @@ -1,11 +1,132 @@ -MAJOR CHANGES FROM 1.5: - * Enhanced GUI - * Console client (wicd-curses) - * Support for multiple backends - * Enhanced network setting properties - * Bug fixes - -CHANGELOG: +------------------------------------------------------------ +revno: 367 +committer: Andrew Psaltis +branch nick: 1.6 +timestamp: Wed 2009-04-22 17:40:07 -0400 +message: + Merged r318 of experimental-nacl, fixing yet another wicd-curses bug. + ------------------------------------------------------------ + revno: 202.2.27 + committer: Andrew Psaltis + branch nick: experimental-nacl + timestamp: Wed 2009-04-22 17:37:50 -0400 + message: + Made the network preferences dialogs save whether they are using static IPs or not. Thanks to Adam for finding this one. + ------------------------------------------------------------ + revno: 202.2.26 + committer: Andrew Psaltis + branch nick: experimental-nacl + timestamp: Wed 2009-04-22 14:06:26 -0400 + message: + Merged r366 of mainline 1.6. +------------------------------------------------------------ +revno: 366 +committer: Andrew Psaltis +branch nick: 1.6 +timestamp: Wed 2009-04-22 12:13:06 -0400 +message: + Set the SVG wicd icon as the window icon in wicd-client. +------------------------------------------------------------ +revno: 365 +committer: Adam Blackburn +branch nick: 1.6 +timestamp: Wed 2009-04-22 22:17:39 +0800 +message: + fixed another typo +------------------------------------------------------------ +revno: 364 +committer: Adam Blackburn +branch nick: 1.6 +timestamp: Wed 2009-04-22 22:11:33 +0800 +message: + fixed a typo +------------------------------------------------------------ +revno: 363 +committer: Adam Blackburn +branch nick: 1.6 +timestamp: Wed 2009-04-22 22:02:31 +0800 +message: + Updated version number +------------------------------------------------------------ +revno: 362 +committer: Adam Blackburn +branch nick: 1.6 +timestamp: Wed 2009-04-22 21:45:51 +0800 +message: + Updated vcsinfo.py generation logic +------------------------------------------------------------ +revno: 361 +committer: Dan O'Reilly +branch nick: experimental +timestamp: Tue 2009-04-21 21:25:59 -0400 +message: + Refactor monitor.py polling code to remove reliance on globals. + Make sure we update the polling rate in wicd-monitor when the backend changes. +------------------------------------------------------------ +revno: 360 +committer: Dan O'Reilly +branch nick: experimental +timestamp: Tue 2009-04-21 20:30:40 -0400 +message: + Use atexit instead of catching SIGTERM in wicd-daemon. + Use Popen to launch wicd-monitor instead of gobject.spawn_async. +------------------------------------------------------------ +revno: 359 +committer: Andrew Psaltis +branch nick: 1.6 +timestamp: Tue 2009-04-21 17:47:46 -0400 +message: + Merged r316 of experimental-nacl, providing some small feature additions and bufixes. + ------------------------------------------------------------ + revno: 202.2.25 + committer: Andrew Psaltis + branch nick: experimental-nacl + timestamp: Tue 2009-04-21 14:09:29 -0400 + message: + Fixed a problem where if a scan is initiated externally, and wicd-curses doesn't see it, wicd-curses will half-drop a running big dialog. + ------------------------------------------------------------ + revno: 202.2.24 + committer: Andrew Psaltis + branch nick: experimental-nacl + timestamp: Tue 2009-04-21 13:34:01 -0400 + message: + Fix bug introduced in r356 where wicd would crash upon not finding dhclient. + ------------------------------------------------------------ + revno: 202.2.23 + committer: Andrew Psaltis + branch nick: experimental-nacl + timestamp: Tue 2009-04-21 13:16:44 -0400 + message: + Added support for disabling nonexistent external tools in the pref_curses.py. + Added a DynRadioButton in curses_misc.py. + ------------------------------------------------------------ + revno: 202.2.22 + committer: Andrew Psaltis + branch nick: experimental-nacl + timestamp: Tue 2009-04-21 13:15:30 -0400 + message: + Merged with r358 of mainline 1.6. + ------------------------------------------------------------ + revno: 202.2.21 + committer: Andrew Psaltis + branch nick: experimental-nacl + timestamp: Fri 2009-04-17 08:04:02 -0400 + message: + Merged r355 of mainline 1.6. + ------------------------------------------------------------ + revno: 202.2.20 + committer: Andrew Psaltis + branch nick: experimental-nacl + timestamp: Sun 2009-04-12 12:12:38 -0400 + message: + Merge r352 of mainline 1.6 +------------------------------------------------------------ +revno: 358 +committer: Adam Blackburn +branch nick: 1.6 +timestamp: Tue 2009-04-21 22:33:29 +0800 +message: + Updated CHANGES ------------------------------------------------------------ revno: 357 committer: Andrew Psaltis diff --git a/NEWS b/NEWS new file mode 100644 index 0000000..0aa709a --- /dev/null +++ b/NEWS @@ -0,0 +1,34 @@ +Wicd 1.6.x Branch + +Major Changes: +- Improved tray icon and gui images (thanks to Martin Sagastume) +- Reorganized network list in the gui for easier navigation +- New experimental ioctl backend, which is more cpu-friendly than the + previous one +- Added a curses client (thanks to Andrew Psaltis) +- Added a right-click connection menu to the tray icon +- Added options to specify a dns domain and search domain for static networks +- Reworked the Preferences menu to be more in line with GNOME standards +- Added support for global scripts +- Made it possible to have optional entries in encryption templates + +Enchancements: +- Better autoconnection behavior +- Tray/GUI will survive the daemon being killed +- Reasons for connection failures will now bubble back to the GUI +- Add/Remove wired profile system is now more user-friendly +- Support for using resolvconf instead of directly editing /etc/resolv.conf +- Wicd won't blindly kill dhcp clients / wpa_supplicant any more +- Added an option to automatically switch from a wireless network to a wired + one as soon as a cable is plugged in +- Moved scanning to its own thread, which makes GUI and daemon more responsive + during scans +- Made it possible to specify macros in script entries +- The gui will now display the encryption entry dialog if you attempt to + connect to an encrypted network without entering a password +- Static gateway entry is now optional +- Passwords with leading or trailing whitespace are now stored properly +- Many init/config script, man page, and setup.py fixes/updates, including + better autodetection of file placement with regard to sleep hooks and + kde autostart files (thanks to Robby Workman) + From 9242457b8b85d4164cb0a38018bd84b6c8f40779 Mon Sep 17 00:00:00 2001 From: Adam Blackburn Date: Thu, 23 Apr 2009 19:38:48 +0800 Subject: [PATCH 064/186] Updated CHANGES and added NEWS --- CHANGES | 109 +++++++++++++++++++++++++++++++++++++++++++++++++++----- NEWS | 25 +++++++++++++ 2 files changed, 126 insertions(+), 8 deletions(-) create mode 100644 NEWS diff --git a/CHANGES b/CHANGES index 7cf7a3f..d93e342 100644 --- a/CHANGES +++ b/CHANGES @@ -1,11 +1,104 @@ -MAJOR CHANGES FROM 1.5: - * Enhanced GUI - * Console client (wicd-curses) - * Support for multiple backends - * Enhanced network setting properties - * Bug fixes - -CHANGELOG: +------------------------------------------------------------ +revno: 365 +committer: Adam Blackburn +branch nick: 1.6 +timestamp: Wed 2009-04-22 22:17:39 +0800 +message: + fixed another typo +------------------------------------------------------------ +revno: 364 +committer: Adam Blackburn +branch nick: 1.6 +timestamp: Wed 2009-04-22 22:11:33 +0800 +message: + fixed a typo +------------------------------------------------------------ +revno: 363 +committer: Adam Blackburn +branch nick: 1.6 +timestamp: Wed 2009-04-22 22:02:31 +0800 +message: + Updated version number +------------------------------------------------------------ +revno: 362 +committer: Adam Blackburn +branch nick: 1.6 +timestamp: Wed 2009-04-22 21:45:51 +0800 +message: + Updated vcsinfo.py generation logic +------------------------------------------------------------ +revno: 361 +committer: Dan O'Reilly +branch nick: experimental +timestamp: Tue 2009-04-21 21:25:59 -0400 +message: + Refactor monitor.py polling code to remove reliance on globals. + Make sure we update the polling rate in wicd-monitor when the backend changes. +------------------------------------------------------------ +revno: 360 +committer: Dan O'Reilly +branch nick: experimental +timestamp: Tue 2009-04-21 20:30:40 -0400 +message: + Use atexit instead of catching SIGTERM in wicd-daemon. + Use Popen to launch wicd-monitor instead of gobject.spawn_async. +------------------------------------------------------------ +revno: 359 +committer: Andrew Psaltis +branch nick: 1.6 +timestamp: Tue 2009-04-21 17:47:46 -0400 +message: + Merged r316 of experimental-nacl, providing some small feature additions and bufixes. + ------------------------------------------------------------ + revno: 202.2.25 + committer: Andrew Psaltis + branch nick: experimental-nacl + timestamp: Tue 2009-04-21 14:09:29 -0400 + message: + Fixed a problem where if a scan is initiated externally, and wicd-curses doesn't see it, wicd-curses will half-drop a running big dialog. + ------------------------------------------------------------ + revno: 202.2.24 + committer: Andrew Psaltis + branch nick: experimental-nacl + timestamp: Tue 2009-04-21 13:34:01 -0400 + message: + Fix bug introduced in r356 where wicd would crash upon not finding dhclient. + ------------------------------------------------------------ + revno: 202.2.23 + committer: Andrew Psaltis + branch nick: experimental-nacl + timestamp: Tue 2009-04-21 13:16:44 -0400 + message: + Added support for disabling nonexistent external tools in the pref_curses.py. + Added a DynRadioButton in curses_misc.py. + ------------------------------------------------------------ + revno: 202.2.22 + committer: Andrew Psaltis + branch nick: experimental-nacl + timestamp: Tue 2009-04-21 13:15:30 -0400 + message: + Merged with r358 of mainline 1.6. + ------------------------------------------------------------ + revno: 202.2.21 + committer: Andrew Psaltis + branch nick: experimental-nacl + timestamp: Fri 2009-04-17 08:04:02 -0400 + message: + Merged r355 of mainline 1.6. + ------------------------------------------------------------ + revno: 202.2.20 + committer: Andrew Psaltis + branch nick: experimental-nacl + timestamp: Sun 2009-04-12 12:12:38 -0400 + message: + Merge r352 of mainline 1.6 +------------------------------------------------------------ +revno: 358 +committer: Adam Blackburn +branch nick: 1.6 +timestamp: Tue 2009-04-21 22:33:29 +0800 +message: + Updated CHANGES ------------------------------------------------------------ revno: 357 committer: Andrew Psaltis diff --git a/NEWS b/NEWS new file mode 100644 index 0000000..3b3c184 --- /dev/null +++ b/NEWS @@ -0,0 +1,25 @@ +MAIN CHANGES: +- New and improved tray icon and gui images. (Thanks to Martin Sagastume). +- Re-organized network list in the GUI to be easier to navigate. +- Added new experimental ioctl backend, which is more CPU friendly than the previous one. +- Added a curses client (Thanks to Andrew Psaltis). +- Added a right-click connection menu to the tray icon. +- Add options to specify a dns domain and search domain for static networks. +- Re-worked Preferences menu to be more in line with GNOME standards. +- Support for global scripts. +- Make it possible to have optional entries in encryption templates. + +SMALL CHANGES: +- Better autoconnection behavior. +- Tray/GUI will survive the daemon going down. +- Reasons for connection failures will now bubble back to the GUI. +- Add/Remove wired profile system is now more user-friendly. +- Support for using resolvconf instead of directly editing /etc/resolv.conf. +- Wicd won't blindly kill dhcp clients / wpa_supplicant anymore. +- Added an option to automatically switch from a wireless network to a wired one as soon as a cable is plugged in. +- Move scanning to its own thread, which makes GUI and daemon more responsive during scans. +- Make it possible to specify macros in script entries. +- GUI will now display the encryption entry dialog if you attempt to connect to an encrypted network without entering a password. +- Static gateway entry is now optional. +- Passwords with leading or trailing whitespace are now stored properly. +- Many init/config script, man page, and setup.py fixes/updates (Thanks to Robby Workman). From e407230d622f8ac8e8f7de52700f7473f6197e06 Mon Sep 17 00:00:00 2001 From: Adam Blackburn Date: Sun, 26 Apr 2009 07:53:24 +0900 Subject: [PATCH 065/186] Fixed setup.py translations installation and made wicd-daemon.py +x --- setup.py | 12 ++++-------- wicd/wicd-daemon.py | 0 2 files changed, 4 insertions(+), 8 deletions(-) mode change 100755 => 100644 wicd/wicd-daemon.py diff --git a/setup.py b/setup.py index a66f187..5d5a665 100755 --- a/setup.py +++ b/setup.py @@ -463,14 +463,10 @@ try: print 'Using pid path', os.path.basename(wpath.pidfile) print 'Language support for', for language in os.listdir('translations/'): - if not language.startswith('.'): - codes = language.split('_') - short_language = language - if codes[0].lower() == codes[1].lower(): - short_language = codes[0].lower() - print short_language, - data.append((wpath.translations + short_language + '/LC_MESSAGES/', - ['translations/' + language + '/LC_MESSAGES/wicd.mo'])) + print language, + data.append((wpath.translations + language + '/LC_MESSAGES/', + ['translations/' + language + '/LC_MESSAGES/wicd.mo'])) + print except Exception, e: print str(e) print '''Error setting up data array. This is normal if diff --git a/wicd/wicd-daemon.py b/wicd/wicd-daemon.py old mode 100755 new mode 100644 From 25aab2763594321e23eb8635f8161fec65e308a1 Mon Sep 17 00:00:00 2001 From: Adam Blackburn Date: Sun, 26 Apr 2009 08:00:33 +0900 Subject: [PATCH 066/186] Redirected bzr output to /dev/null --- setup.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/setup.py b/setup.py index 5d5a665..7c1420a 100755 --- a/setup.py +++ b/setup.py @@ -33,7 +33,7 @@ CURSES_REVNO = 'uimod' os.chdir(os.path.abspath(os.path.split(__file__)[0])) try: - if os.path.exists('.bzr') and os.system('bzr') == 0: + if os.path.exists('.bzr') and os.system('bzr > /dev/null 2>&1') == 0: try: os.system('bzr version-info --python > vcsinfo.py') except: From 6650c84aecc07ec90dadc4debbee871c25686947 Mon Sep 17 00:00:00 2001 From: Adam Blackburn Date: Sun, 26 Apr 2009 08:03:59 +0900 Subject: [PATCH 067/186] Updated version numbers --- CHANGES | 56 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++ setup.py | 2 +- 2 files changed, 57 insertions(+), 1 deletion(-) diff --git a/CHANGES b/CHANGES index d93e342..7556ef8 100644 --- a/CHANGES +++ b/CHANGES @@ -1,4 +1,60 @@ ------------------------------------------------------------ +revno: 369 +committer: Adam Blackburn +branch nick: 1.6 +timestamp: Sun 2009-04-26 08:00:33 +0900 +message: + Redirected bzr output to /dev/null +------------------------------------------------------------ +revno: 368 +committer: Adam Blackburn +branch nick: 1.6 +timestamp: Sun 2009-04-26 07:53:24 +0900 +message: + Fixed setup.py translations installation and made wicd-daemon.py +x +------------------------------------------------------------ +revno: 367 +committer: Adam Blackburn +branch nick: 1.6 +timestamp: Thu 2009-04-23 19:41:10 +0800 +message: + Merged + ------------------------------------------------------------ + revno: 365.1.2 + committer: Andrew Psaltis + branch nick: 1.6 + timestamp: Wed 2009-04-22 17:40:07 -0400 + message: + Merged r318 of experimental-nacl, fixing yet another wicd-curses bug. + ------------------------------------------------------------ + revno: 202.2.27 + committer: Andrew Psaltis + branch nick: experimental-nacl + timestamp: Wed 2009-04-22 17:37:50 -0400 + message: + Made the network preferences dialogs save whether they are using static IPs or not. Thanks to Adam for finding this one. + ------------------------------------------------------------ + revno: 202.2.26 + committer: Andrew Psaltis + branch nick: experimental-nacl + timestamp: Wed 2009-04-22 14:06:26 -0400 + message: + Merged r366 of mainline 1.6. + ------------------------------------------------------------ + revno: 365.1.1 + committer: Andrew Psaltis + branch nick: 1.6 + timestamp: Wed 2009-04-22 12:13:06 -0400 + message: + Set the SVG wicd icon as the window icon in wicd-client. +------------------------------------------------------------ +revno: 366 +committer: Adam Blackburn +branch nick: 1.6 +timestamp: Thu 2009-04-23 19:38:48 +0800 +message: + Updated CHANGES and added NEWS +------------------------------------------------------------ revno: 365 committer: Adam Blackburn branch nick: 1.6 diff --git a/setup.py b/setup.py index 7c1420a..376552c 100755 --- a/setup.py +++ b/setup.py @@ -24,7 +24,7 @@ import subprocess # Be sure to keep this updated! # VERSIONNUMBER -VERSION_NUM = '1.6.0a2' +VERSION_NUM = '1.6.0a3' # REVISION_NUM is automatically updated REVISION_NUM = 'unknown' CURSES_REVNO = 'uimod' From c9b3a507d88d14f32ec604dd81ebee73dd5d1744 Mon Sep 17 00:00:00 2001 From: Robby Workman Date: Sat, 25 Apr 2009 22:55:12 -0500 Subject: [PATCH 068/186] Synced CHANGES file with mainline. Minor tweaks to NEWS file (mostly formatting). --- CHANGES | 56 +++++++++++++++++++++++++++++++++++------------ NEWS | 68 ++++++++++++++++++++++++++++----------------------------- 2 files changed, 76 insertions(+), 48 deletions(-) diff --git a/CHANGES b/CHANGES index 065096e..7556ef8 100644 --- a/CHANGES +++ b/CHANGES @@ -1,31 +1,59 @@ ------------------------------------------------------------ +revno: 369 +committer: Adam Blackburn +branch nick: 1.6 +timestamp: Sun 2009-04-26 08:00:33 +0900 +message: + Redirected bzr output to /dev/null +------------------------------------------------------------ +revno: 368 +committer: Adam Blackburn +branch nick: 1.6 +timestamp: Sun 2009-04-26 07:53:24 +0900 +message: + Fixed setup.py translations installation and made wicd-daemon.py +x +------------------------------------------------------------ revno: 367 -committer: Andrew Psaltis +committer: Adam Blackburn branch nick: 1.6 -timestamp: Wed 2009-04-22 17:40:07 -0400 +timestamp: Thu 2009-04-23 19:41:10 +0800 message: - Merged r318 of experimental-nacl, fixing yet another wicd-curses bug. + Merged ------------------------------------------------------------ - revno: 202.2.27 + revno: 365.1.2 committer: Andrew Psaltis - branch nick: experimental-nacl - timestamp: Wed 2009-04-22 17:37:50 -0400 + branch nick: 1.6 + timestamp: Wed 2009-04-22 17:40:07 -0400 message: - Made the network preferences dialogs save whether they are using static IPs or not. Thanks to Adam for finding this one. + Merged r318 of experimental-nacl, fixing yet another wicd-curses bug. + ------------------------------------------------------------ + revno: 202.2.27 + committer: Andrew Psaltis + branch nick: experimental-nacl + timestamp: Wed 2009-04-22 17:37:50 -0400 + message: + Made the network preferences dialogs save whether they are using static IPs or not. Thanks to Adam for finding this one. + ------------------------------------------------------------ + revno: 202.2.26 + committer: Andrew Psaltis + branch nick: experimental-nacl + timestamp: Wed 2009-04-22 14:06:26 -0400 + message: + Merged r366 of mainline 1.6. ------------------------------------------------------------ - revno: 202.2.26 + revno: 365.1.1 committer: Andrew Psaltis - branch nick: experimental-nacl - timestamp: Wed 2009-04-22 14:06:26 -0400 + branch nick: 1.6 + timestamp: Wed 2009-04-22 12:13:06 -0400 message: - Merged r366 of mainline 1.6. + Set the SVG wicd icon as the window icon in wicd-client. ------------------------------------------------------------ revno: 366 -committer: Andrew Psaltis +committer: Adam Blackburn branch nick: 1.6 -timestamp: Wed 2009-04-22 12:13:06 -0400 +timestamp: Thu 2009-04-23 19:38:48 +0800 message: - Set the SVG wicd icon as the window icon in wicd-client. + Updated CHANGES and added NEWS ------------------------------------------------------------ revno: 365 committer: Adam Blackburn diff --git a/NEWS b/NEWS index 0aa709a..536b3f1 100644 --- a/NEWS +++ b/NEWS @@ -1,34 +1,34 @@ -Wicd 1.6.x Branch - -Major Changes: -- Improved tray icon and gui images (thanks to Martin Sagastume) -- Reorganized network list in the gui for easier navigation -- New experimental ioctl backend, which is more cpu-friendly than the - previous one -- Added a curses client (thanks to Andrew Psaltis) -- Added a right-click connection menu to the tray icon -- Added options to specify a dns domain and search domain for static networks -- Reworked the Preferences menu to be more in line with GNOME standards -- Added support for global scripts -- Made it possible to have optional entries in encryption templates - -Enchancements: -- Better autoconnection behavior -- Tray/GUI will survive the daemon being killed -- Reasons for connection failures will now bubble back to the GUI -- Add/Remove wired profile system is now more user-friendly -- Support for using resolvconf instead of directly editing /etc/resolv.conf -- Wicd won't blindly kill dhcp clients / wpa_supplicant any more -- Added an option to automatically switch from a wireless network to a wired - one as soon as a cable is plugged in -- Moved scanning to its own thread, which makes GUI and daemon more responsive - during scans -- Made it possible to specify macros in script entries -- The gui will now display the encryption entry dialog if you attempt to - connect to an encrypted network without entering a password -- Static gateway entry is now optional -- Passwords with leading or trailing whitespace are now stored properly -- Many init/config script, man page, and setup.py fixes/updates, including - better autodetection of file placement with regard to sleep hooks and - kde autostart files (thanks to Robby Workman) - +Wicd 1.6.x Branch + +Major Changes: +- Improved tray icon and gui images (thanks to Martin Sagastume) +- Reorganized network list in the gui for easier navigation +- New experimental ioctl backend, which is more cpu-friendly than the + previous one +- Added a curses client (thanks to Andrew Psaltis) +- Added a right-click connection menu to the tray icon +- Added options to specify a dns domain and search domain for static networks +- Reworked the Preferences menu to be more in line with GNOME standards +- Added support for global scripts +- Made it possible to have optional entries in encryption templates + +Minor Changes and Other Enchancements: +- Better autoconnection behavior +- Tray/GUI will survive the daemon being killed +- Reasons for connection failures will now bubble back to the GUI +- Add/Remove wired profile system is now more user-friendly +- Support for using resolvconf instead of directly editing /etc/resolv.conf +- Wicd won't blindly kill dhcp clients / wpa_supplicant any more +- Added an option to automatically switch from a wireless network to a wired + one as soon as a cable is plugged in +- Moved scanning to its own thread, which makes GUI and daemon more responsive + during scans +- Made it possible to specify macros in script entries +- The gui will now display the encryption entry dialog if you attempt to + connect to an encrypted network without entering a password +- Static gateway entry is now optional +- Passwords with leading or trailing whitespace are now stored properly +- Many init/config script, man page, and setup.py fixes/updates, including + better autodetection of file placement with regard to sleep hooks and + kde autostart files (thanks to Robby Workman) + From 9588a78b68bc6d14b3b6162da38793253b5dc49e Mon Sep 17 00:00:00 2001 From: Robby Workman Date: Sat, 25 Apr 2009 23:17:33 -0500 Subject: [PATCH 069/186] Use set_icon_name() instead of set_icon_from_file() in gui.py ; this allows gtk to use the themed icons (and presumably the correct size and all that good stuff). --- wicd/gui.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/wicd/gui.py b/wicd/gui.py index e6bdecb..47227ba 100644 --- a/wicd/gui.py +++ b/wicd/gui.py @@ -149,7 +149,7 @@ class appGui(object): gladefile = os.path.join(wpath.share, "wicd.glade") self.wTree = gtk.glade.XML(gladefile) self.window = self.wTree.get_widget("window1") - self.window.set_icon_from_file(wpath.icons +'scalable/apps/wicd-client.svg') + self.window.set_icon_name("wicd-client") size = daemon.ReadWindowSize("main") width = size[0] height = size[1] From 63b00dd75696b2216d2598fb486399508f58162d Mon Sep 17 00:00:00 2001 From: Robby Workman Date: Sun, 26 Apr 2009 21:38:10 -0500 Subject: [PATCH 070/186] Clarified some required versions in INSTALL --- INSTALL | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/INSTALL b/INSTALL index e563e4b..7537ed4 100644 --- a/INSTALL +++ b/INSTALL @@ -1,15 +1,16 @@ Installation of Wicd should be done using your distribution package if one exists. If not, the installation is relatively straightforward, but there are a few dependencies: - 1. python (obviously) and pygtk + 1. python (>=2.4, <3.0) + 2. pygtk (>=2.10) 2. dbus and its glib and python bindings 3. a dhcp client (dhclient, dhcpcd, and pump are supported) 4. wireless-tools (iwlist, iwconfig, etcetera) 5. net-tools (ip, route, etcetera) 6. a graphical sudo application (gksu, kdesu, and ktsuss are supported), while optional, is strongly recommended - 7. urwid (if you want to use the curses client) - 8. pm-utils (optional for suspend/resume integration - needs version 1.2.4+) + 7. urwid (if you want to use the curses client - needs version >=0.9.8.3) + 8. pm-utils (optional for suspend/resume integration - needs version >=1.2.4) If you are installing from a bzr pull or beta/rc tarball and you want the native language translations, first run this: From 531cde7250f75129813313e552f190375d166e09 Mon Sep 17 00:00:00 2001 From: Dan O'Reilly Date: Mon, 27 Apr 2009 19:17:01 -0400 Subject: [PATCH 071/186] Correctly handle case where a key is all digits and starts with a '0'. Remove some unused imports. Simplfy code that checks for valid wpa_supplicant drivers. --- wicd/autoconnect.py | 1 - wicd/configmanager.py | 3 ++- wicd/dbusmanager.py | 1 - wicd/gui.py | 5 ++--- wicd/logfile.py | 2 -- wicd/monitor.py | 3 +-- wicd/netentry.py | 2 +- wicd/prefs.py | 2 +- wicd/wicd-client.py | 1 - wicd/wnettools.py | 12 ++++-------- 10 files changed, 11 insertions(+), 21 deletions(-) diff --git a/wicd/autoconnect.py b/wicd/autoconnect.py index b591076..b68a5c7 100755 --- a/wicd/autoconnect.py +++ b/wicd/autoconnect.py @@ -23,7 +23,6 @@ from wicd import dbusmanager import dbus import time -import gobject import sys if getattr(dbus, 'version', (0, 0, 0)) < (0, 80, 0): diff --git a/wicd/configmanager.py b/wicd/configmanager.py index 9426e53..24d8dd4 100644 --- a/wicd/configmanager.py +++ b/wicd/configmanager.py @@ -106,7 +106,8 @@ class ConfigManager(RawConfigParser): # Try to intelligently handle the type of the return value. try: - ret = int(ret) + if not ret.startswith('0') or len(ret) == 1: + ret = int(ret) except (ValueError, TypeError): ret = Noneify(ret) # This is a workaround for a python-dbus issue on 64-bit systems. diff --git a/wicd/dbusmanager.py b/wicd/dbusmanager.py index 6cd3ec3..17e9e0c 100644 --- a/wicd/dbusmanager.py +++ b/wicd/dbusmanager.py @@ -24,7 +24,6 @@ A module for managing wicd's dbus interfaces. # import dbus -from dbus import DBusException if getattr(dbus, "version", (0, 0, 0)) < (0, 80, 0): import dbus.glib else: diff --git a/wicd/gui.py b/wicd/gui.py index e6bdecb..8db8b6f 100644 --- a/wicd/gui.py +++ b/wicd/gui.py @@ -31,7 +31,6 @@ import pango import gtk import gtk.glade from dbus import DBusException -from dbus import version as dbus_version from wicd import misc from wicd import wpath @@ -41,7 +40,7 @@ from wicd import netentry from wicd.misc import noneToString from wicd.netentry import WiredNetworkEntry, WirelessNetworkEntry from wicd.prefs import PreferencesDialog -from wicd.guiutil import error, GreyLabel, LabelEntry, SmallLabel +from wicd.guiutil import error, LabelEntry from wicd.translations import language if __name__ == '__main__': @@ -709,7 +708,7 @@ class appGui(object): try: daemon.WriteWindowSize(width, height, "main") daemon.SetGUIOpen(False) - except dbusmanager.DBusException: + except DBusException: pass if self.standalone: diff --git a/wicd/logfile.py b/wicd/logfile.py index 408aea2..639a912 100644 --- a/wicd/logfile.py +++ b/wicd/logfile.py @@ -25,8 +25,6 @@ import sys import os import time -import wicd.wpath as wpath - class SizeError(IOError): pass diff --git a/wicd/monitor.py b/wicd/monitor.py index 82727cd..4accb0e 100755 --- a/wicd/monitor.py +++ b/wicd/monitor.py @@ -26,7 +26,6 @@ when appropriate. import gobject import time -import sys from dbus import DBusException @@ -53,7 +52,7 @@ def diewithdbus(func): ret = func(self, *__args, **__kargs) self.__lost_dbus_count = 0 return ret - except dbusmanager.DBusException, e: + except DBusException, e: print "Caught exception %s" % str(e) if not hasattr(self, "__lost_dbus_count"): self.__lost_dbus_count = 0 diff --git a/wicd/netentry.py b/wicd/netentry.py index 28722ab..460f387 100644 --- a/wicd/netentry.py +++ b/wicd/netentry.py @@ -29,7 +29,7 @@ import misc import wpath import dbusmanager from misc import noneToString, stringToNone, noneToBlankString, to_bool -from guiutil import error, SmallLabel, LabelEntry, GreyLabel, LeftAlignedLabel, string_input +from guiutil import error, LabelEntry, GreyLabel, LeftAlignedLabel, string_input from translations import language diff --git a/wicd/prefs.py b/wicd/prefs.py index f511c42..30d7a5d 100644 --- a/wicd/prefs.py +++ b/wicd/prefs.py @@ -26,7 +26,7 @@ handles recieving/sendings the settings from/to the daemon. import gtk import gobject -import pango +#import pango import os import gtk.glade diff --git a/wicd/wicd-client.py b/wicd/wicd-client.py index bcb4900..0c34f7e 100755 --- a/wicd/wicd-client.py +++ b/wicd/wicd-client.py @@ -40,7 +40,6 @@ import gobject import getopt import os import pango -import time import atexit from dbus import DBusException diff --git a/wicd/wnettools.py b/wicd/wnettools.py index 51ad50c..d09e8f2 100644 --- a/wicd/wnettools.py +++ b/wicd/wnettools.py @@ -112,10 +112,9 @@ def GetWirelessInterfaces(): """ dev_dir = '/sys/class/net/' - ifnames = [] - - ifnames = [iface for iface in os.listdir(dev_dir) if os.path.isdir(dev_dir + iface) - and 'wireless' in os.listdir(dev_dir + iface)] + ifnames = [iface for iface in os.listdir(dev_dir) + if os.path.isdir(dev_dir + iface) and + 'wireless' in os.listdir(dev_dir + iface)] return ifnames @@ -134,10 +133,7 @@ def IsValidWpaSuppDriver(driver): """ Returns True if given string is a valid wpa_supplicant driver. """ output = misc.Run(["wpa_supplicant", "-D%s" % driver, "-iolan19", "-c/etc/abcd%sdefzz.zconfz" % random.randint(1, 1000)]) - if re.match("Unsupported driver", output): - return False - else: - return True + return not "Unsupported driver" in output def neediface(default_response): """ A decorator for only running a method if self.iface is defined. From c6ad1c570633ad2f4fe2d8658dede14b6d2e4981 Mon Sep 17 00:00:00 2001 From: Robby Workman Date: Tue, 28 Apr 2009 10:51:16 -0500 Subject: [PATCH 072/186] Tweaks to NEWS file. --- NEWS | 57 +++++++++++++++++++++++++++++++++------------------------ 1 file changed, 33 insertions(+), 24 deletions(-) diff --git a/NEWS b/NEWS index 3b3c184..536b3f1 100644 --- a/NEWS +++ b/NEWS @@ -1,25 +1,34 @@ -MAIN CHANGES: -- New and improved tray icon and gui images. (Thanks to Martin Sagastume). -- Re-organized network list in the GUI to be easier to navigate. -- Added new experimental ioctl backend, which is more CPU friendly than the previous one. -- Added a curses client (Thanks to Andrew Psaltis). -- Added a right-click connection menu to the tray icon. -- Add options to specify a dns domain and search domain for static networks. -- Re-worked Preferences menu to be more in line with GNOME standards. -- Support for global scripts. -- Make it possible to have optional entries in encryption templates. +Wicd 1.6.x Branch + +Major Changes: +- Improved tray icon and gui images (thanks to Martin Sagastume) +- Reorganized network list in the gui for easier navigation +- New experimental ioctl backend, which is more cpu-friendly than the + previous one +- Added a curses client (thanks to Andrew Psaltis) +- Added a right-click connection menu to the tray icon +- Added options to specify a dns domain and search domain for static networks +- Reworked the Preferences menu to be more in line with GNOME standards +- Added support for global scripts +- Made it possible to have optional entries in encryption templates + +Minor Changes and Other Enchancements: +- Better autoconnection behavior +- Tray/GUI will survive the daemon being killed +- Reasons for connection failures will now bubble back to the GUI +- Add/Remove wired profile system is now more user-friendly +- Support for using resolvconf instead of directly editing /etc/resolv.conf +- Wicd won't blindly kill dhcp clients / wpa_supplicant any more +- Added an option to automatically switch from a wireless network to a wired + one as soon as a cable is plugged in +- Moved scanning to its own thread, which makes GUI and daemon more responsive + during scans +- Made it possible to specify macros in script entries +- The gui will now display the encryption entry dialog if you attempt to + connect to an encrypted network without entering a password +- Static gateway entry is now optional +- Passwords with leading or trailing whitespace are now stored properly +- Many init/config script, man page, and setup.py fixes/updates, including + better autodetection of file placement with regard to sleep hooks and + kde autostart files (thanks to Robby Workman) -SMALL CHANGES: -- Better autoconnection behavior. -- Tray/GUI will survive the daemon going down. -- Reasons for connection failures will now bubble back to the GUI. -- Add/Remove wired profile system is now more user-friendly. -- Support for using resolvconf instead of directly editing /etc/resolv.conf. -- Wicd won't blindly kill dhcp clients / wpa_supplicant anymore. -- Added an option to automatically switch from a wireless network to a wired one as soon as a cable is plugged in. -- Move scanning to its own thread, which makes GUI and daemon more responsive during scans. -- Make it possible to specify macros in script entries. -- GUI will now display the encryption entry dialog if you attempt to connect to an encrypted network without entering a password. -- Static gateway entry is now optional. -- Passwords with leading or trailing whitespace are now stored properly. -- Many init/config script, man page, and setup.py fixes/updates (Thanks to Robby Workman). From 51c6ef0f0ee15a00056d81432bbe5dee8770cf49 Mon Sep 17 00:00:00 2001 From: Adam Blackburn Date: Fri, 1 May 2009 13:41:13 +0800 Subject: [PATCH 073/186] Also catch AttributeErrors when guessing data types --- wicd/configmanager.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/wicd/configmanager.py b/wicd/configmanager.py index 24d8dd4..8862bc8 100644 --- a/wicd/configmanager.py +++ b/wicd/configmanager.py @@ -108,7 +108,7 @@ class ConfigManager(RawConfigParser): try: if not ret.startswith('0') or len(ret) == 1: ret = int(ret) - except (ValueError, TypeError): + except (ValueError, TypeError, AttributeError): ret = Noneify(ret) # This is a workaround for a python-dbus issue on 64-bit systems. if isinstance(ret, (int)): From e28dcb4337d38401e0c4a86d6867ed5c795a94ae Mon Sep 17 00:00:00 2001 From: Adam Blackburn Date: Fri, 1 May 2009 13:46:21 +0800 Subject: [PATCH 074/186] Initial notification support --- wicd/wicd-client.py | 60 +++++++++++++++++++++++++++++++++++++++------ 1 file changed, 52 insertions(+), 8 deletions(-) diff --git a/wicd/wicd-client.py b/wicd/wicd-client.py index 0c34f7e..d7d0b2e 100755 --- a/wicd/wicd-client.py +++ b/wicd/wicd-client.py @@ -43,6 +43,17 @@ import pango import atexit from dbus import DBusException +HAS_NOTIFY = True +try: + import pygtk + pygtk.require('2.0') + import pynotify + if not pynotify.init("Wicd"): + HAS_NOTIFY = False +except ImportError: + HAS_NOTIFY = False + + # Wicd specific imports from wicd import wpath from wicd import misc @@ -63,6 +74,8 @@ if not hasattr(gtk, "StatusIcon"): print 'Unable to load tray icon: Missing both egg.trayicon and gtk.StatusIcon modules.' ICON_AVAIL = False +print "Has notifications support", HAS_NOTIFY + misc.RenameProcess("wicd-client") if __name__ == '__main__': @@ -118,7 +131,7 @@ class TrayIcon(object): def is_embedded(self): if USE_EGG: - raise NotImplementedError + raise NotImplementedError() else: return self.tr.is_embedded() @@ -138,12 +151,30 @@ class TrayIcon(object): self.max_snd_gain = 10000 self.max_rcv_gain = 10000 self.animate = animate + + # keep track of the last state to provide appropriate + # notifications + self._last_bubble = None + self.last_state = None + self.should_notify = True + if DBUS_AVAIL: self.update_tray_icon() else: handle_no_dbus() self.set_not_connected_state() + def _show_notification(self, status_string): + if self.should_notify: + if not self._last_bubble: + self._last_bubble = pynotify.Notification("Network status", status_string) + self._last_bubble.show() + else: + self._last_bubble.update("Network status", status_string) + self._last_bubble.show() + + self.should_notify = False + @catchdbus def wired_profile_chooser(self): """ Launch the wired profile chooser. """ @@ -154,8 +185,10 @@ class TrayIcon(object): """ Sets the icon info for a wired state. """ wired_ip = info[0] self.tr.set_from_file(os.path.join(wpath.images, "wired.png")) - self.tr.set_tooltip(language['connected_to_wired'].replace('$A', - wired_ip)) + status_string = language['connected_to_wired'].replace('$A', + wired_ip) + self.tr.set_tooltip(status_string) + self._show_notification(status_string) @catchdbus def set_wireless_state(self, info): @@ -169,12 +202,14 @@ class TrayIcon(object): if wireless.GetWirelessProperty(cur_net_id, "encryption"): lock = "-lock" - - self.tr.set_tooltip(language['connected_to_wireless'] + status_string = (language['connected_to_wireless'] .replace('$A', self.network) .replace('$B', sig_string) - .replace('$C', str(wireless_ip))) + .replace('$C', str(wireless_ip))) + self.tr.set_tooltip(status_string) self.set_signal_image(int(strength), lock) + self._show_notification(status_string) + def set_connecting_state(self, info): """ Sets the icon info for a connecting state. """ @@ -182,9 +217,11 @@ class TrayIcon(object): cur_network = language['wired_network'] else: cur_network = info[1] - self.tr.set_tooltip(language['connecting'] + " to " + - cur_network + "...") + status_string = language['connecting'] + " to " + \ + cur_network + "..." + self.tr.set_tooltip(status_string) self.tr.set_from_file(os.path.join(wpath.images, "no-signal.png")) + self._show_notification(status_string) @catchdbus def set_not_connected_state(self, info=None): @@ -198,6 +235,7 @@ class TrayIcon(object): else: status = language['not_connected'] self.tr.set_tooltip(status) + self._show_notification(status) @catchdbus def update_tray_icon(self, state=None, info=None): @@ -206,6 +244,12 @@ class TrayIcon(object): if not state or not info: [state, info] = daemon.GetConnectionStatus() + + self._show_notification('hello!') + + self.should_notify = (self.last_state != state) and HAS_NOTIFY + + self.last_state = state if state == misc.WIRED: self.set_wired_state(info) From 7aa0027c3949a27c2d32657671b28d960f5de591 Mon Sep 17 00:00:00 2001 From: Adam Blackburn Date: Fri, 1 May 2009 14:32:09 +0800 Subject: [PATCH 075/186] added support for enabling/disabling notifications --- data/wicd.glade | 273 +++++++++++++++++++++++++++----------------- wicd/prefs.py | 19 +++ wicd/wicd-client.py | 6 +- 3 files changed, 191 insertions(+), 107 deletions(-) diff --git a/data/wicd.glade b/data/wicd.glade index 0fe8d7a..9d39ce3 100644 --- a/data/wicd.glade +++ b/data/wicd.glade @@ -1,25 +1,23 @@ - - - + + + 450 400 True Wicd Network Manager - GTK_WIN_POS_CENTER + center 550 - GDK_GRAVITY_CENTER - - + center True True - GTK_TOOLBAR_BOTH_HORIZ - GTK_ICON_SIZE_MENU + both-horiz + 0 True @@ -31,8 +29,8 @@ True + gtk-network True - gtk-network True True @@ -40,31 +38,21 @@ True + Create an ad-hoc network True - Create an ad-hoc network True + True - - - True - gtk-add - - + Find a hidden network True Enter a hidden network to try to locate. - Find a hidden network True + True - - - True - network-wireless - - @@ -74,6 +62,9 @@ + + False + @@ -86,6 +77,7 @@ + False True @@ -99,6 +91,7 @@ + False True @@ -112,6 +105,7 @@ + False True @@ -125,6 +119,7 @@ + False True @@ -139,12 +134,14 @@ + False True False + 0 @@ -165,12 +162,12 @@ True False - GTK_POLICY_AUTOMATIC - GTK_POLICY_AUTOMATIC + automatic + automatic True - GTK_SHADOW_NONE + none True @@ -198,15 +195,17 @@ 3 + 0 - True - Cancel the current connection attempt gtk-cancel + True + False + False + Cancel the current connection attempt True - 0 @@ -238,8 +237,8 @@ GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK 5 Configure Scripts - GTK_WIN_POS_CENTER_ON_PARENT - GDK_WINDOW_TYPE_HINT_DIALOG + center-on-parent + dialog False @@ -259,6 +258,7 @@ False False + 0 @@ -272,6 +272,9 @@ GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK Pre-connection Script: + + 0 + @@ -302,6 +305,9 @@ GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK Post-connection Script: + + 0 + @@ -332,6 +338,9 @@ GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK Disconnection Script: + + 0 + @@ -359,32 +368,41 @@ True - GTK_BUTTONBOX_END + end + gtk-cancel True True - gtk-cancel + False True - 0 + + False + False + 0 + + gtk-ok + 1 True True - gtk-ok + False True - 1 + False + False 1 False - GTK_PACK_END + end + 0 @@ -392,8 +410,8 @@ 5 - GTK_WIN_POS_CENTER_ON_PARENT - GDK_WINDOW_TYPE_HINT_DIALOG + center-on-parent + dialog False @@ -414,17 +432,17 @@ True True - GTK_POLICY_AUTOMATIC - GTK_POLICY_AUTOMATIC + automatic + automatic True - GTK_RESIZE_QUEUE - GTK_SHADOW_NONE + queue + none True - 18 + 20 2 4 4 @@ -433,14 +451,14 @@ True + Always switch to a wired connection when available True True + False True If selected, wicd will automatically connect to a wired network as soon as a cable is plugged in, even if a wireless connection is already active. - Always switch to a wired connection when available - 0 True @@ -490,10 +508,10 @@ is already active. 12 + Automatically reconnect on network connection loss True True - Automatically reconnect on network connection loss - 0 + False True @@ -525,10 +543,10 @@ is already active. 12 + Use last wired network profile True True - Use last wired network profile - 0 + False True True @@ -547,10 +565,10 @@ is already active. 12 + Prompt for wired network profile True True - Prompt for wired network profile - 0 + False True True pref_use_last_radio @@ -570,10 +588,10 @@ is already active. 12 + Use default wired network profile True True - Use default wired network profile - 0 + False True True pref_use_last_radio @@ -766,10 +784,10 @@ is already active. 12 + Use global DNS servers True True - Use global DNS servers - 0 + False True @@ -840,11 +858,11 @@ is already active. 24 + Always show wired interface True True + False If enabled, the wired network interface will always be displayed in the main window. This can be useful if your wired network card does not detect when the interface is connected to a cable. - Always show wired interface - 0 True @@ -856,6 +874,41 @@ is already active. + + + True + 0 + <b>Notifications</b> + True + + + 2 + 18 + 19 + + + + + + True + 12 + + + Display notifications about connection status + True + True + False + True + + + + + 2 + 19 + 20 + + + @@ -870,8 +923,8 @@ is already active. General Settings - tab False + tab @@ -885,13 +938,13 @@ is already active. True True - GTK_POLICY_AUTOMATIC - GTK_POLICY_AUTOMATIC + automatic + automatic True - GTK_RESIZE_QUEUE - GTK_SHADOW_NONE + queue + none True @@ -931,23 +984,24 @@ is already active. True + Automatic (recommended) True True - Automatic (recommended) - 0 + False True True False + 0 + ip True True - ip - 0 + False True True flush_auto_radio @@ -959,10 +1013,10 @@ is already active. + route True True - route - 0 + False True True flush_auto_radio @@ -990,23 +1044,24 @@ is already active. True + Automatic (recommended) True True - Automatic (recommended) - 0 + False True True False + 0 + ethtool True True - ethtool - 0 + False True True link_auto_radio @@ -1018,10 +1073,10 @@ is already active. + mii-tool True True - mii-tool - 0 + False True True link_auto_radio @@ -1049,24 +1104,25 @@ is already active. True + Automatic (recommended) True True - Automatic (recommended) - 0 + False True True dhclient_radio False + 0 + dhclient True True - dhclient - 0 + False True True @@ -1077,10 +1133,10 @@ is already active. + dhcpcd True True - dhcpcd - 0 + False True True dhclient_radio @@ -1092,10 +1148,10 @@ is already active. + pump True True - pump - 0 + False True True dhclient_radio @@ -1147,23 +1203,24 @@ is already active. True + Automatic (recommended) True True - Automatic (recommended) - 0 + False True True False + 0 + gksudo True True - gksudo - 0 + False True True sudo_auto_radio @@ -1175,10 +1232,10 @@ is already active. + kdesu True True - kdesu - 0 + False True True sudo_auto_radio @@ -1190,10 +1247,10 @@ is already active. + ktsuss True True - ktsuss - 0 + False True True sudo_auto_radio @@ -1228,9 +1285,9 @@ is already active. External Programs - tab 1 False + tab @@ -1270,6 +1327,7 @@ to read its description. False + 0 @@ -1316,10 +1374,10 @@ to read its description. 12 + Use dBm to measure signal strength True True - Use dBm to measure signal strength - 0 + False True @@ -1337,10 +1395,10 @@ to read its description. 12 + Enable debug mode True True - Enable debug mode - 0 + False True @@ -1477,9 +1535,9 @@ WPA supplicant driver. Advanced Settings - tab 2 False + tab @@ -1490,34 +1548,41 @@ WPA supplicant driver. True - GTK_BUTTONBOX_END + end + gtk-cancel True True True - gtk-cancel True - 0 + + False + False + 0 + + gtk-ok + 1 True True True - gtk-ok True - 1 + False + False 1 False - GTK_PACK_END + end + 0 diff --git a/wicd/prefs.py b/wicd/prefs.py index 30d7a5d..2c577ea 100644 --- a/wicd/prefs.py +++ b/wicd/prefs.py @@ -41,6 +41,8 @@ wired = None from translations import language +USER_SETTINGS_DIR = os.path.expanduser('~/.wicd/') + def setup_dbus(): global daemon, wireless, wired daemon = dbusmanager.get_interface('daemon') @@ -144,6 +146,11 @@ class PreferencesDialog(object): self.backendcombo.set_active(self.backends.index(cur_backend)) except ValueError: self.backendcombo.set_active(0) + + self.notificationscheckbox.set_active( + os.path.exists( + os.path.join(USER_SETTINGS_DIR, 'USE_NOTIFICATIONS') + )) self.wTree.get_widget("notebook2").set_current_page(0) @@ -224,6 +231,15 @@ class PreferencesDialog(object): [width, height] = self.dialog.get_size() daemon.WriteWindowSize(width, height, "pref") + + not_path = os.path.join(USER_SETTINGS_DIR, 'USE_NOTIFICATIONS') + if self.notificationscheckbox.get_active(): + if not os.path.exists(not_path): + open(not_path, 'w') + else: + if os.path.exists(not_path): + os.remove(not_path) + def set_label(self, glade_str, label): """ Sets the label for the given widget in wicd.glade. """ @@ -308,6 +324,9 @@ class PreferencesDialog(object): 'use_last_used_profile') + self.notificationscheckbox = setup_label("pref_use_libnotify", + 'display_notifications') + # DHCP Clients self.dhcpautoradio = setup_label("dhcp_auto_radio", "wicd_auto_config") self.dhclientradio = self.wTree.get_widget("dhclient_radio") diff --git a/wicd/wicd-client.py b/wicd/wicd-client.py index d7d0b2e..143d9e5 100755 --- a/wicd/wicd-client.py +++ b/wicd/wicd-client.py @@ -53,6 +53,8 @@ try: except ImportError: HAS_NOTIFY = False +USE_NOTIFY = os.path.exists(os.path.join(os.path.expanduser('~/.wicd'), + 'USE_NOTIFICATIONS')) # Wicd specific imports from wicd import wpath @@ -245,9 +247,7 @@ class TrayIcon(object): if not state or not info: [state, info] = daemon.GetConnectionStatus() - self._show_notification('hello!') - - self.should_notify = (self.last_state != state) and HAS_NOTIFY + self.should_notify = (self.last_state != state) and HAS_NOTIFY and USE_NOTIFY self.last_state = state From adec1fdc18a30e9c51e7f1863d774afb5ff73f99 Mon Sep 17 00:00:00 2001 From: Dan O'Reilly Date: Fri, 1 May 2009 20:20:40 -0400 Subject: [PATCH 076/186] Fix crash when saving settings for unencrypted networks. Remove unneeded function in prefs.py --- wicd/netentry.py | 4 ++-- wicd/prefs.py | 7 ++----- 2 files changed, 4 insertions(+), 7 deletions(-) diff --git a/wicd/netentry.py b/wicd/netentry.py index 460f387..a4cfa40 100644 --- a/wicd/netentry.py +++ b/wicd/netentry.py @@ -405,9 +405,9 @@ class WirelessSettingsDialog(AdvancedSettingsDialog): def save_settings(self, networkid): # Check encryption info + encrypt_info = self.encryption_info if self.chkbox_encryption.get_active(): print "setting encryption info..." - encrypt_info = self.encryption_info encrypt_methods = self.encrypt_types self.set_net_prop("enctype", encrypt_methods[self.combo_encryption.get_active()]['type']) @@ -432,7 +432,7 @@ class WirelessSettingsDialog(AdvancedSettingsDialog): print "no encryption specified..." self.set_net_prop("enctype", "None") for entry in encrypt_info.iterkeys(): - self.set_net_prop(entry[0].entry, "") + self.set_net_prop(entry[0], "") AdvancedSettingsDialog.save_settings(self) if self.chkbox_global_settings.get_active(): diff --git a/wicd/prefs.py b/wicd/prefs.py index 30d7a5d..80634b4 100644 --- a/wicd/prefs.py +++ b/wicd/prefs.py @@ -57,12 +57,9 @@ class PreferencesDialog(object): def _setup_external_app_radios(self, radio_list, get_method, set_method): """ Generic function for setting up external app radios. """ - def set_available(apps): - for app in apps: - app.set_sensitive(daemon.GetAppAvailable(app.get_label())) - # Disable radios for apps that aren't installed. - set_available(radio_list[1:]) + for app in radio_list[1:]: + app.set_sensitive(daemon.GetAppAvailable(app.get_label())) selected_app = get_method() # Make sure the app we want to select is actually available. if radio_list[selected_app].get_property("sensitive"): From 8dcc028c392c1bbd4fb87cd6072dd178ba76f033 Mon Sep 17 00:00:00 2001 From: Dan O'Reilly Date: Fri, 1 May 2009 20:26:46 -0400 Subject: [PATCH 077/186] Fix bug where shared essid settings couldn't be disabled once they were turned on. --- wicd/wicd-daemon.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/wicd/wicd-daemon.py b/wicd/wicd-daemon.py index 073d1b1..17f3e2d 100644 --- a/wicd/wicd-daemon.py +++ b/wicd/wicd-daemon.py @@ -1201,8 +1201,8 @@ class WirelessDaemon(dbus.service.Object): # We want to write the essid in addition to bssid # sections if global settings are enabled. + self.config.remove_section(essid_key) if cur_network["use_settings_globally"]: - self.config.remove_section(essid_key) self.config.add_section(essid_key) for x in cur_network: From d54f7e080213703b22af6d96b16f67298d9ea513 Mon Sep 17 00:00:00 2001 From: Andrew Psaltis Date: Fri, 1 May 2009 22:13:15 -0400 Subject: [PATCH 078/186] Some more bugfixes... Fixed unencrypted network support in both UIs. Fixed marking the Static IP checkbox in wicd-curses. Made the checkboxes in the the network properties dialogs in wicd-curses act like those in wicd-client. Filter the urwid popen2 warning in wicd-curses. --- curses/netentry_curses.py | 27 +++++++++++++++++---------- curses/wicd-curses.py | 5 ++++- wicd/netentry.py | 2 -- 3 files changed, 21 insertions(+), 13 deletions(-) diff --git a/curses/netentry_curses.py b/curses/netentry_curses.py index 2723efe..8711ed3 100644 --- a/curses/netentry_curses.py +++ b/curses/netentry_curses.py @@ -62,17 +62,17 @@ class AdvancedSettingsDialog(urwid.WidgetWrap): ok_t = 'OK' self.static_ip_cb = urwid.CheckBox(static_ip_t, - on_state_change=self.static_ip_set_state) + on_state_change=self.static_ip_toggle) self.ip_edit =DynWrap(urwid.Edit(ip_t),False) self.netmask_edit=DynWrap(urwid.Edit(netmask_t),False) self.gateway_edit=DynWrap(urwid.Edit(gateway_t),False) - self.static_dns_cb = urwid.CheckBox(use_static_dns_t, - on_state_change=self.dns_toggle) + self.static_dns_cb = DynWrap(urwid.CheckBox(use_static_dns_t, + on_state_change=self.dns_toggle),True,('body','editnfc'),None) self.global_dns_cb = DynWrap(urwid.CheckBox(use_global_dns_t, on_state_change=self.dns_toggle),False,('body','editnfc'),None) - checkb_cols = urwid.Columns([self.static_dns_cb, + self.checkb_cols = urwid.Columns([self.static_dns_cb, self.global_dns_cb]) self.dns_dom_edit = DynWrap(urwid.Edit(dns_dom_t) ,False) self.search_dom_edit = DynWrap(urwid.Edit(search_dom_t),False) @@ -87,7 +87,7 @@ class AdvancedSettingsDialog(urwid.WidgetWrap): self.netmask_edit, self.gateway_edit, _blank, - checkb_cols, + self.checkb_cols, self.dns_dom_edit,self.search_dom_edit, self.dns1,self.dns2,self.dns3 ]) @@ -99,12 +99,19 @@ class AdvancedSettingsDialog(urwid.WidgetWrap): self._frame = urwid.Frame(self._listbox) self.__super.__init__(self._frame) - def static_ip_set_state(self,checkb,new_state,user_data=None): + def static_ip_toggle(self,checkb,new_state,user_data=None): for w in [ self.ip_edit,self.netmask_edit,self.gateway_edit ]: w.set_sensitive(new_state) + self.static_dns_cb.set_state(new_state) + self.static_dns_cb.set_sensitive(not new_state) + if new_state: + self.checkb_cols.set_focus(self.global_dns_cb) + else: + self.checkb_cols.set_focus(self.static_dns_cb) + def dns_toggle(self,checkb,new_state,user_data=None): - if checkb == self.static_dns_cb: + if checkb == self.static_dns_cb.get_w(): for w in [ self.dns_dom_edit,self.search_dom_edit, self.dns1,self.dns2,self.dns3 ]: w.set_sensitive(new_state) @@ -256,6 +263,8 @@ class WirelessSettingsDialog(AdvancedSettingsDialog): self.static_dns_cb.set_state(bool(wireless.GetWirelessProperty(networkID, 'use_static_dns'))) + if stringToNone(self.ip_edit.get_edit_text()): + self.static_ip_cb.set_state(True) self.dns1.set_edit_text(self.format_entry(networkID, "dns1")) self.dns2.set_edit_text(self.format_entry(networkID, "dns2")) self.dns3.set_edit_text(self.format_entry(networkID, "dns3")) @@ -327,8 +336,6 @@ class WirelessSettingsDialog(AdvancedSettingsDialog): return False else: self.set_net_prop("enctype", "None") - for entry in encrypt_info.iterkeys(): - self.set_net_prop(entry[0].entry, "") AdvancedSettingsDialog.save_settings(self) # Save the autoconnect setting. This is not where it originally was @@ -347,9 +354,9 @@ class WirelessSettingsDialog(AdvancedSettingsDialog): # More or less ripped from netentry.py def change_encrypt_method(self): #self.lbox_encrypt = urwid.ListBox() + self.encryption_info = {} wid,ID = self.encryption_combo.get_focus() methods = misc.LoadEncryptionMethods() - self.encryption_info = {} if self._w.body.body.__contains__(self.pile_encrypt): self._w.body.body.pop(self._w.body.body.__len__()-1) diff --git a/curses/wicd-curses.py b/curses/wicd-curses.py index db9641a..b188b16 100755 --- a/curses/wicd-curses.py +++ b/curses/wicd-curses.py @@ -33,7 +33,10 @@ at least get a network connection. Or those who don't like using X. ;-) Comments, criticisms, patches, bug reports all welcome! """ - +# Filter out a confusing urwid warning in python 2.6. +# This is valid as of urwid version 0.9.8.4 +import warnings +warnings.filterwarnings("ignore","The popen2 module is deprecated. Use the subprocess module.") # UI stuff # This library is the only reason why I wrote this program. import urwid diff --git a/wicd/netentry.py b/wicd/netentry.py index 460f387..289ea34 100644 --- a/wicd/netentry.py +++ b/wicd/netentry.py @@ -431,8 +431,6 @@ class WirelessSettingsDialog(AdvancedSettingsDialog): else: print "no encryption specified..." self.set_net_prop("enctype", "None") - for entry in encrypt_info.iterkeys(): - self.set_net_prop(entry[0].entry, "") AdvancedSettingsDialog.save_settings(self) if self.chkbox_global_settings.get_active(): From 176be0b9d3a3bd28effad869dafc8b1f50b7f5f1 Mon Sep 17 00:00:00 2001 From: Adam Blackburn Date: Sat, 2 May 2009 12:43:43 +0800 Subject: [PATCH 079/186] Reworded notifications and added new entries to translations.py --- wicd/translations.py | 4 +++- wicd/wicd-client.py | 17 ++++++++++------- 2 files changed, 13 insertions(+), 8 deletions(-) diff --git a/wicd/translations.py b/wicd/translations.py index 327951c..b92bf44 100644 --- a/wicd/translations.py +++ b/wicd/translations.py @@ -226,4 +226,6 @@ language['raw_screen_arg'] = _('use urwid\'s raw screen controller') language['ok'] = _('OK') language['cancel'] = _('Cancel') - +language['disconnected'] = _('Disconnected') +language['connection_established'] = _('Connection established') +language['establishing_connection'] = _('Establishing connection...') diff --git a/wicd/wicd-client.py b/wicd/wicd-client.py index 143d9e5..da3b173 100755 --- a/wicd/wicd-client.py +++ b/wicd/wicd-client.py @@ -166,13 +166,13 @@ class TrayIcon(object): handle_no_dbus() self.set_not_connected_state() - def _show_notification(self, status_string): + def _show_notification(self, title, details): if self.should_notify: if not self._last_bubble: - self._last_bubble = pynotify.Notification("Network status", status_string) + self._last_bubble = pynotify.Notification(title, details) self._last_bubble.show() else: - self._last_bubble.update("Network status", status_string) + self._last_bubble.update(title, details) self._last_bubble.show() self.should_notify = False @@ -190,7 +190,8 @@ class TrayIcon(object): status_string = language['connected_to_wired'].replace('$A', wired_ip) self.tr.set_tooltip(status_string) - self._show_notification(status_string) + self._show_notification(language['wired_network'], + language['connection_established']) @catchdbus def set_wireless_state(self, info): @@ -210,7 +211,8 @@ class TrayIcon(object): .replace('$C', str(wireless_ip))) self.tr.set_tooltip(status_string) self.set_signal_image(int(strength), lock) - self._show_notification(status_string) + self._show_notification(self.network, + language['connection_established']) def set_connecting_state(self, info): @@ -223,7 +225,8 @@ class TrayIcon(object): cur_network + "..." self.tr.set_tooltip(status_string) self.tr.set_from_file(os.path.join(wpath.images, "no-signal.png")) - self._show_notification(status_string) + self._show_notification(cur_network, + language['establishing_connection']) @catchdbus def set_not_connected_state(self, info=None): @@ -237,7 +240,7 @@ class TrayIcon(object): else: status = language['not_connected'] self.tr.set_tooltip(status) - self._show_notification(status) + self._show_notification(language['disconnected'], None) @catchdbus def update_tray_icon(self, state=None, info=None): From 0563b9b4b2c902687e104d7b73376d0462a33c26 Mon Sep 17 00:00:00 2001 From: Adam Blackburn Date: Sat, 2 May 2009 14:01:30 +0800 Subject: [PATCH 080/186] Disable the enable notification option if pynotify isn't installed --- wicd/prefs.py | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/wicd/prefs.py b/wicd/prefs.py index 7a6d709..abfa6b0 100644 --- a/wicd/prefs.py +++ b/wicd/prefs.py @@ -148,6 +148,13 @@ class PreferencesDialog(object): os.path.exists( os.path.join(USER_SETTINGS_DIR, 'USE_NOTIFICATIONS') )) + + # if pynotify isn't installed disable the option + try: + import pynotify + except ImportError: + self.notificationscheckbox.set_active(False) + self.notificationscheckbox.set_sensitive(False) self.wTree.get_widget("notebook2").set_current_page(0) From 5c4261a2676756eb515ec39a884af92eaae0aa31 Mon Sep 17 00:00:00 2001 From: Adam Blackburn Date: Sat, 2 May 2009 15:24:50 +0800 Subject: [PATCH 081/186] added support for automatically retrieving translations.py --- setup.py | 24 +++++++++++++++++++++++- 1 file changed, 23 insertions(+), 1 deletion(-) diff --git a/setup.py b/setup.py index 376552c..4ebc6aa 100755 --- a/setup.py +++ b/setup.py @@ -332,6 +332,26 @@ class test(Command): print 'running tests' tests.run_tests() +class update_translations_py(Command): + description = "download new translations.py from the online translator" + + user_options = [] + + def initialize_options(self): + pass + + def finalize_options(self): + pass + + def run(self): + import urllib, shutil + # grab translations.py + filename, headers = urllib.urlretrieve('http://wicd.net/translator/generate/translations.py/') + # copy it into the right location + shutil.copyfile(filename, + os.path.join(os.path.dirname(os.path.realpath(__file__)), + 'wicd/translations.py')) + class get_translations(Command): description = "download the translations from the online translator" @@ -482,7 +502,9 @@ iwscan_ext = Extension(name='iwscan', libraries=['iw'], sources=['depends/python-iwscan/pyiwscan.c']) setup(cmdclass={'configure' : configure, 'get_translations' : get_translations, - 'uninstall' : uninstall, 'test' : test, 'clear_generated' : clear_generated}, + 'uninstall' : uninstall, 'test' : test, 'clear_generated' : + clear_generated, 'update_translations_py' : + update_translations_py}, name="Wicd", version=VERSION_NUM, description="A wireless and wired network manager", From 6810145743c993c44d8168ad42bdd7d04abdfeeb Mon Sep 17 00:00:00 2001 From: Adam Blackburn Date: Sat, 2 May 2009 15:30:09 +0800 Subject: [PATCH 082/186] Added automatically generated translations.py --- wicd/translations.py | 325 +++++++++++++++++++++---------------------- 1 file changed, 155 insertions(+), 170 deletions(-) diff --git a/wicd/translations.py b/wicd/translations.py index 327951c..7de3616 100644 --- a/wicd/translations.py +++ b/wicd/translations.py @@ -55,175 +55,160 @@ def get_gettext(): _ = lang.gettext return _ +# Generated automatically on Sat, 02 May 2009 02:29:29 CDT _ = get_gettext() language = {} -language['connect'] = _('Connect') -language['ip'] = _('IP') -language['netmask'] = _('Netmask') -language['gateway'] = _('Gateway') -language['dns'] = _('DNS') -language['use_static_ip'] = _('Use Static IPs') -language['use_static_dns'] = _('Use Static DNS') -language['use_encryption'] = _('Use Encryption') -language['advanced_settings'] = _('Advanced Settings') -language['properties'] = _('Properties') -language['wired_network'] = _('Wired Network') -language['wired_network_instructions'] = _('To connect to a wired network,' -' you must create a network profile. To create a network profile, type a' -' name that describes this network, and press Add.') -language['automatic_connect'] = _('Automatically connect to this network') -language['secured'] = _('Secured') -language['unsecured'] = _('Unsecured') -language['channel'] = _('Channel') -language['preferences'] = _('Preferences') -language['wpa_supplicant_driver'] = _('WPA Supplicant Driver') -language['wireless_interface'] = _('Wireless Interface') -language['wired_interface'] = _('Wired Interface') -language['hidden_network'] = _('Hidden Network') -language['hidden_network_essid'] = _('Hidden Network ESSID') -language['connected_to_wireless'] = _('Connected to $A at $B (IP: $C)') -language['connected_to_wired'] = _('Connected to wired network (IP: $A)') -language['not_connected'] = _('Not connected') -language['no_wireless_networks_found'] = _('No wireless networks found.') -language['killswitch_enabled'] = _('Wireless Kill Switch Enabled') -language['key'] = _('Key') -language['username'] = _('Username') -language['password'] = _('Password') -language['anonymous_identity'] = _('Anonymous Identity') -language['identity'] = _('Identity') -language['authentication'] = _('Authentication') -language['path_to_pac_file'] = _('Path to PAC File') -language['select_a_network'] = _('Choose from the networks below:') -#language['connecting...'] = _('Connecting...') -language['wired_always_on'] = _('Always show wired interface') -language['auto_reconnect'] = _('Automatically reconnect on connection loss') -language['create_adhoc_network'] = _('Create an Ad-Hoc Network') -language['essid'] = _('ESSID') -language['use_wep_encryption'] = _('Use Encryption (WEP only)') -language['before_script'] = _('Run script before connect') -language['after_script'] = _('Run script after connect') -language['disconnect_script'] = _('Run disconnect script') -language['script_settings'] = _('Scripts') -language['use_ics'] = _('Activate Internet Connection Sharing') -language['madwifi_for_adhoc'] = _('Check if using madwifi/atheros drivers') -language['default_wired'] = _('Use as default profile (overwrites any previous default)') -language['use_debug_mode'] = _('Enable debug mode') -language['use_global_dns'] = _('Use global DNS servers') -language['use_default_profile'] = _('Use default profile on wired autoconnect') -language['show_wired_list'] = _('Prompt for profile on wired autoconnect') -language['use_last_used_profile'] = _('Use last used profile on wired autoconnect') -language['choose_wired_profile'] = _('Select or create a wired profile to connect with') -language['wired_network_found'] = _('Wired connection detected') -language['stop_showing_chooser'] = _('Stop Showing Autoconnect pop-up temporarily') -language['display_type_dialog'] = _('Use dBm to measure signal strength') -language['scripts'] = _('Scripts') -language['invalid_address'] = _('Invalid address in $A entry.') -language['global_settings'] = _('Use these settings for all networks sharing this essid') -language['encrypt_info_missing'] = _('Required encryption information is missing.') -language['enable_encryption'] = _('This network requires encryption to be enabled.') -language['wicd_auto_config'] = _('Automatic (recommended)') -language["gen_settings"] = _('General Settings') -language["ext_programs"] = _('External Programs') -language["dhcp_client"] = _('DHCP Client') -language["wired_detect"] = _('Wired Link Detection') -language["route_flush"] = _('Route Table Flushing') -language["backend"] = _('Backend') -language["backend_alert"] = _('Changes to your backend won\'t occur until the daemon is restarted.') -language['dns_domain'] = _('DNS domain') -language['search_domain'] = _('Search domain') -language['global_dns_not_enabled'] = _('Global DNS has not been enabled in general preferences.') -language['scripts_need_pass'] = _('You must enter your password to configure scripts') -language['no_sudo_prog'] = _('Could not find a graphical sudo program. The script editor could not be launched.' + - ' You\'ll have to edit scripts directly your configuration file.') - -language['interface_down'] = _('Putting interface down...') -language['resetting_ip_address'] = _('Resetting IP address...') -language['interface_up'] = _('Putting interface up...') -language['setting_encryption_info'] = _('Setting encryption info') -language['removing_old_connection'] = _('Removing old connection...') -language['generating_psk'] = _('Generating PSK...') -language['generating_wpa_config'] = _('Generating WPA configuration file...') -language['flushing_routing_table'] = _('Flushing the routing table...') -language['configuring_interface'] = _('Configuring wireless interface...') -language['validating_authentication'] = _('Validating authentication...') -language['setting_broadcast_address'] = _('Setting broadcast address...') -language['setting_static_dns'] = _('Setting static DNS servers...') -language['setting_static_ip'] = _('Setting static IP addresses...') -language['running_dhcp'] = _('Obtaining IP address...') -language['dhcp_failed'] = _('Connection Failed: Unable to Get IP Address') -language['no_dhcp_offers'] = _('Connection Failed: No DHCP offers received.') -language['aborted'] = _('Connection Cancelled') -language['bad_pass'] = _('Connection Failed: Could not authenticate (bad password?)') -language['verifying_association'] = _("Verifying access point association...") -language['association_failed'] = _("Connection Failed: Could not contact the wireless access point.") -language['done'] = _('Done connecting...') -language['scanning'] = _('Scanning') -language['scanning_stand_by'] = _('Scanning networks... stand by...') -language['cannot_start_daemon'] = _('Unable to connect to wicd daemon DBus interface. " + \ - "This typically means there was a problem starting the daemon. " + \ - "Check the wicd log for more info') -language['lost_dbus'] = _('The wicd daemon has shut down, the UI will not function properly until it is restarted.') -language['access_denied'] = _("Unable to contact the wicd dameon due to an access denied error from DBus. Please check your DBus configuration.") -language['configuring_wireless'] = _('Configuring preferences for wireless network "$A" ($B)') -language['configuring_wired'] = _('Configuring preferences for wired profile "$A"') -language['scan'] = _('Scan') -language['always_switch_to_wired'] = _('Always switch to wired connection when available') -language['wired_autoconnect_settings'] = _('Wired Autoconnect Settings') -language['always_use_wext'] = _('You should almost always use wext as the WPA supplicant driver') -language['debugging'] = _('Debugging') -language['wpa_supplicant'] = _('WPA Supplicant') -language['automatic_reconnection'] = _('Automatic Reconnection') -language['global_dns_servers'] = _('Global DNS servers') -language['network_interfaces'] = _('Network Interfaces') -language['connecting_to_daemon'] = _('Connecting to daemon...') -language['cannot_connect_to_daemon'] = _('Can\'t connect to the daemon, trying to start it automatically...') -language['could_not_connect'] = _('Could not connect to wicd\'s D-Bus interface. Check the wicd log for error messages.') -language["exception"] = _('EXCEPTION! Please report this to the maintainer and file a bug report with the backtrace below:') -language["brought_to_you"] = _('Brought to you by:') -language["add_new_profile"] = _('Add a new profile') -language["add_new_wired_profile"] = _('Add a new wired profile') -language["no_delete_last_profile"] = _('wicd-curses does not support deleting the last wired profile. Try renaming it (\'F2\')') -language["rename_wired_profile"] = _('Rename wired profile') -language["select_hidden_essid"] = _('Select Hidden Network ESSID') -language["esc_to_cancel"] = _('Press ESC to cancel') -language["press_to_quit"] = _('Press F8 or Q to quit.') - -language['terminated'] = _('Terminated by user') -language['wicd_curses'] = _('Wicd Curses Interface') -language['dbus_fail'] = _('DBus failure! This is most likely caused by the wicd daemon stopping while wicd-curses is running. Please restart the daemon, and then restart wicd-curses.') - -# These are in the tray list, but not in the non-tray list -language['connecting'] = _('Connecting') -language['daemon_unavailable'] = _('The wicd daemon is unavailable, so your request cannot be completed') -language['no_daemon_tooltip'] = _('Wicd daemon unreachable') - -# Translations added on Wed Mar 4 03:36:24 UTC 2009 -language['make_wired_profile'] = _('To connect to a wired network, you must create a network profile. To create a network profile, type a name that describes this network, and press Add.') -language['access_cards'] = _('Wicd needs to access your computer\'s network cards.') -#language['CHANGE_ME'] = _('Create Ad-Hoc network') -#language['CHANGE_ME'] = _('Wired Autoconnect Setting:') -language['bad_pass'] = _('Connection Failed: Bad password') -language['cannot_edit_scripts_1'] = _('To avoid various complications, wicd-curses does not support directly editing the scripts directly. However, you can edit them manually. First, (as root)", open the "$A" config file, and look for the section labeled by the $B in question. In this case, this is:') -language['cannot_edit_scripts_2'] = _('Once there, you can adjust (or add) the "beforescript", "afterscript", and "disconnectscript" variables as needed, to change the preconnect, postconnect, and disconnect scripts respectively. Note that you will be specifying the full path to the scripts - not the actual script contents. You will need to add/edit the script contents separately. Refer to the wicd manual page for more information.') -language['cannot_edit_scripts_3'] = _('You can also configure the wireless networks by looking for the "[]" field in the config file.') -language['wired_networks'] = _('Wired Networks') -language['wireless_networks'] = _('Wireless Networks') -language['about'] = _('About Wicd') -language['more_help'] = _('For more detailed help, consult the wicd-curses(8) man page.') -language['case_sensitive'] = _('All controls are case sensitive') -language['help_help'] = _('Display this help dialog') -language['connect_help'] = _('Connect to selected network') -language['disconn_help'] = _('Disconnect from all networks') -language['about_help'] = _('Stop a network connection in progress') -language['refresh_help'] = _('Refresh network list') -language['prefs_help'] = _('Preferences dialog') -language['scan_help'] = _('Scan for hidden networks') -language['scripts_help'] = _('Select scripts') -language['adhoc_help'] = _('Set up Ad-hoc network') -language['config_help'] = _('Configure Selected Network') -#language[''] = _('Press H or ? for help') # Defunct in curses-uimod -language['raw_screen_arg'] = _('use urwid\'s raw screen controller') -language['ok'] = _('OK') -language['cancel'] = _('Cancel') - - +language['resetting_ip_address'] = _('''Resetting IP address...''') +language['prefs_help'] = _('''Preferences dialog''') +language['no_dhcp_offers'] = _('''Connection Failed: No DHCP offers received.''') +language['more_help'] = _('''For more detailed help, consult the wicd-curses(8) man page.''') +language['bad_pass'] = _('''Connection Failed: Bad password''') +language['cannot_start_daemon'] = _('''Unable to connect to wicd daemon DBus interface. This typically means there was a problem starting the daemon. Check the wicd log for more information.''') +language['wired_always_on'] = _('''Always show wired interface''') +language['could_not_connect'] = _('''Could not connect to wicd's D-Bus interface. Check the wicd log for error messages.''') +language['path_to_pac_file'] = _('''Path to PAC File''') +language['always_switch_to_wired'] = _('''Always switch to wired connection when available''') +language['disconn_help'] = _('''Disconnect from all networks''') +language['wired_networks'] = _('''Wired Networks''') +language['backend_alert'] = _('''Changes to your backend won't occur until the daemon is restarted.''') +language['about_help'] = _('''Stop a network connection in progress''') +language['connecting'] = _('''Connecting''') +language['disconnect_script'] = _('''Run disconnect script''') +language['cannot_edit_scripts_1'] = _('''To avoid various complications, wicd-curses does not support directly editing the scripts directly. However, you can edit them manually. First, (as root)", open the "$A" config file, and look for the section labeled by the $B in question. In this case, this is:''') +language['cannot_edit_scripts_3'] = _('''You can also configure the wireless networks by looking for the "[]" field in the config file.''') +language['cannot_edit_scripts_2'] = _('''Once there, you can adjust (or add) the "beforescript", "afterscript", and "disconnectscript" variables as needed, to change the preconnect, postconnect, and disconnect scripts respectively. Note that you will be specifying the full path to the scripts - not the actual script contents. You will need to add/edit the script contents separately. Refer to the wicd manual page for more information.''') +language['scripts_need_pass'] = _('''You must enter your password to configure scripts''') +language['dns_domain'] = _('''DNS domain''') +language['aborted'] = _('''Connection Cancelled''') +language['scanning_stand_by'] = _('''Scanning networks... stand by...''') +language['password'] = _('''Password''') +language['no_daemon_tooltip'] = _('''Wicd daemon unreachable''') +language['use_static_dns'] = _('''Use Static DNS''') +language['setting_broadcast_address'] = _('''Setting broadcast address...''') +language['choose_wired_profile'] = _('''Select or create a wired profile to connect with''') +language['make_wired_profile'] = _('''To connect to a wired network, you must create a network profile. To create a network profile, type a name that describes this network, and press Add.''') +language['esc_to_cancel'] = _('''Press ESC to cancel''') +language['scanning'] = _('''Scanning''') +language['flushing_routing_table'] = _('''Flushing the routing table...''') +language['brought_to_you'] = _('''Brought to you by:''') +language['refresh_help'] = _('''Refresh network list''') +language['select_hidden_essid'] = _('''Select Hidden Network ESSID''') +language['ext_programs'] = _('''External Programs''') +language['connect'] = _('''Connect''') +language['help_help'] = _('''Display this help dialog''') +language['use_global_dns'] = _('''Use global DNS servers''') +language['enable_encryption'] = _('''This network requires encryption to be enabled.''') +language['use_last_used_profile'] = _('''Use last used profile on wired autoconnect''') +language['preferences'] = _('''Preferences''') +language['dhcp_failed'] = _('''Connection Failed: Unable to Get IP Address''') +language['setting_static_ip'] = _('''Setting static IP addresses...''') +language['connecting_to_daemon'] = _('''Connecting to daemon...''') +language['automatic_connect'] = _('''Automatically connect to this network''') +language['add_new_wired_profile'] = _('''Add a new wired profile''') +language['dhcp_client'] = _('''DHCP Client''') +language['display_type_dialog'] = _('''Use dBm to measure signal strength''') +language['global_settings'] = _('''Use these settings for all networks sharing this essid''') +language['config_help'] = _('''Configure Selected Network''') +language['use_debug_mode'] = _('''Enable debug mode''') +language['removing_old_connection'] = _('''Removing old connection...''') +language['no_sudo_prog'] = _('''Could not find a graphical sudo program. The script editor could not be launched. You'll have to edit scripts directly your configuration file.''') +language['wireless_networks'] = _('''Wireless Networks''') +language['configuring_wired'] = _('''Configuring preferences for wired profile "$A"''') +language['no_wireless_networks_found'] = _('''No wireless networks found.''') +language['madwifi_for_adhoc'] = _('''Check if using madwifi/atheros drivers''') +language['properties'] = _('''Properties''') +language['setting_encryption_info'] = _('''Setting encryption info''') +language['about'] = _('''About Wicd''') +language['ok'] = _('''OK''') +language['adhoc_help'] = _('''Set up Ad-hoc network''') +language['scripts_help'] = _('''Select scripts''') +language['invalid_address'] = _('''Invalid address in $A entry.''') +language['configuring_interface'] = _('''Configuring wireless interface...''') +language['generating_psk'] = _('''Generating PSK...''') +language['validating_authentication'] = _('''Validating authentication...''') +language['essid'] = _('''ESSID''') +language['anonymous_identity'] = _('''Anonymous Identity''') +language['wireless_interface'] = _('''Wireless Interface''') +language['hidden_network'] = _('''Hidden Network''') +language['key'] = _('''Key''') +language['wicd_curses'] = _('''Wicd Curses Interface''') +language['debugging'] = _('''Debugging''') +language['use_encryption'] = _('''Use Encryption''') +language['wpa_supplicant'] = _('''WPA Supplicant''') +language['global_dns_servers'] = _('''Global DNS servers''') +language['not_connected'] = _('''Not connected''') +language['done'] = _('''Done connecting...''') +language['cannot_connect_to_daemon'] = _('''Can't connect to the daemon, trying to start it automatically...''') +language['cancel'] = _('''Cancel''') +language['case_sensitive'] = _('''All controls are case sensitive''') +language['gateway'] = _('''Gateway''') +language['backend'] = _('''Backend''') +language['dbus_fail'] = _('''DBus failure! This is most likely caused by the wicd daemon stopping while wicd-curses is running. Please restart the daemon, and then restart wicd-curses.''') +language['terminated'] = _('''Terminated by user''') +language['wired_detect'] = _('''Wired Link Detection''') +language['add_new_profile'] = _('''Add a new profile''') +language['use_ics'] = _('''Activate Internet Connection Sharing''') +language['create_adhoc_network'] = _('''Create an Ad-Hoc Network''') +language['interface_up'] = _('''Putting interface up...''') +language['global_dns_not_enabled'] = _('''Global DNS has not been enabled in general preferences.''') +language['dns'] = _('''DNS''') +language['advanced_settings'] = _('''Advanced Settings''') +language['username'] = _('''Username''') +language['wicd_auto_config'] = _('''Automatic (recommended)''') +language['wired_network_found'] = _('''Wired connection detected''') +language['netmask'] = _('''Netmask''') +language['select_a_network'] = _('''Choose from the networks below:''') +language['connect_help'] = _('''Connect to selected network''') +language['no_delete_last_profile'] = _('''wicd-curses does not support deleting the last wired profile. Try renaming it ('F2')''') +language['gen_settings'] = _('''General Settings''') +language['connected_to_wireless'] = _('''Connected to $A at $B (IP: $C)''') +language['exception'] = _('''EXCEPTION! Please report this to the maintainer and file a bug report with the backtrace below:''') +language['configuring_wireless'] = _('''Configuring preferences for wireless network "$A" ($B)''') +language['generating_wpa_config'] = _('''Generating WPA configuration file...''') +language['search_domain'] = _('''Search domain''') +language['encrypt_info_missing'] = _('''Required encryption information is missing.''') +language['running_dhcp'] = _('''Obtaining IP address...''') +language['lost_dbus'] = _('''The wicd daemon has shut down. The UI will not function properly until it is restarted.''') +language['wired_network_instructions'] = _('''To connect to a wired network, you must create a network profile. To create a network profile, type a name that describes this network, and press Add.''') +language['setting_static_dns'] = _('''Setting static DNS servers...''') +language['auto_reconnect'] = _('''Automatically reconnect on connection loss''') +language['use_wep_encryption'] = _('''Use Encryption (WEP only)''') +language['wired_autoconnect_settings'] = _('''Wired Autoconnect Settings''') +language['before_script'] = _('''Run script before connect''') +language['always_use_wext'] = _('''You should almost always use wext as the WPA supplicant driver''') +language['network_interfaces'] = _('''Network Interfaces''') +language['use_default_profile'] = _('''Use default profile on wired autoconnect''') +language['scan'] = _('''Scan''') +language['ip'] = _('''IP''') +language['connected_to_wired'] = _('''Connected to wired network (IP: $A)''') +language['wpa_supplicant_driver'] = _('''WPA Supplicant Driver''') +language['access_cards'] = _('''Wicd needs to access your computer's network cards.''') +language['killswitch_enabled'] = _('''Wireless Kill Switch Enabled''') +language['hidden_network_essid'] = _('''Hidden Network ESSID''') +language['secured'] = _('''Secured''') +language['interface_down'] = _('''Putting interface down...''') +language['authentication'] = _('''Authentication''') +language['after_script'] = _('''Run script after connect''') +language['show_wired_list'] = _('''Prompt for profile on wired autoconnect''') +language['channel'] = _('''Channel''') +language['unsecured'] = _('''Unsecured''') +language['rename_wired_profile'] = _('''Rename wired profile''') +language['daemon_unavailable'] = _('''The wicd daemon is unavailable, so your request cannot be completed''') +language['stop_showing_chooser'] = _('''Stop Showing Autoconnect pop-up temporarily''') +language['scan_help'] = _('''Scan for hidden networks''') +language['use_static_ip'] = _('''Use Static IPs''') +language['raw_screen_arg'] = _('''use urwid's raw screen controller''') +language['route_flush'] = _('''Route Table Flushing''') +language['scripts'] = _('''Scripts''') +language['identity'] = _('''Identity''') +language['automatic_reconnection'] = _('''Automatic Reconnection''') +language['wired_interface'] = _('''Wired Interface''') +language['press_to_quit'] = _('''Press F8 or Q to quit.''') +language['default_wired'] = _('''Use as default profile (overwrites any previous default)''') +language['wired_network'] = _('''Wired Network''') +language['dns_server'] = _('''DNS server''') +language['notifications'] = _('''Notifications''') +language['display_notifications'] = _('''Display notifications about connection status''') +language['connection_established'] = _('''Connection established''') +language['disconnected'] = _('''Disconnected''') +language['establishing_connection'] = _('''Establishing connection...''') From 42df5084138e9b318f3b3e8468e597fa7ed884d5 Mon Sep 17 00:00:00 2001 From: Adam Blackburn Date: Sat, 2 May 2009 15:32:58 +0800 Subject: [PATCH 083/186] Updated INSTALL to use update_translations_py before get_translations --- INSTALL | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/INSTALL b/INSTALL index 7537ed4..f29b3f0 100644 --- a/INSTALL +++ b/INSTALL @@ -12,8 +12,9 @@ are a few dependencies: 7. urwid (if you want to use the curses client - needs version >=0.9.8.3) 8. pm-utils (optional for suspend/resume integration - needs version >=1.2.4) -If you are installing from a bzr pull or beta/rc tarball and you want +If you are installing from a bzr pull and you want the native language translations, first run this: + python setup.py update_translations_py python setup.py get_translations You will not need to do this if you're installing from a release tarball. From c7745de68becb85bc3760cb080d10edad7d84d26 Mon Sep 17 00:00:00 2001 From: Adam Blackburn Date: Sun, 3 May 2009 09:50:09 +0800 Subject: [PATCH 084/186] Fixed the libglade warnings when loading the GTK GUI --- data/wicd.glade | 18 ++++++++++++++---- 1 file changed, 14 insertions(+), 4 deletions(-) diff --git a/data/wicd.glade b/data/wicd.glade index 9d39ce3..c42ddb1 100644 --- a/data/wicd.glade +++ b/data/wicd.glade @@ -40,9 +40,14 @@ Create an ad-hoc network True - True - True + False + + + True + gtk-add + + @@ -50,9 +55,14 @@ Find a hidden network True Enter a hidden network to try to locate. - True - True + False + + + True + gtk-find + + From d8df1d1a36d802d96ffa12d93a501a4559d5e15e Mon Sep 17 00:00:00 2001 From: Adam Blackburn Date: Sun, 3 May 2009 10:32:10 +0800 Subject: [PATCH 085/186] Added support for instantly enabling/disabling notifications when the preference is changed --- wicd/gui.py | 6 ++++-- wicd/prefs.py | 9 +++++++-- wicd/wicd-client.py | 13 ++++++++----- 3 files changed, 19 insertions(+), 9 deletions(-) diff --git a/wicd/gui.py b/wicd/gui.py index e792579..3971c42 100644 --- a/wicd/gui.py +++ b/wicd/gui.py @@ -141,10 +141,12 @@ class WiredProfileChooser: class appGui(object): """ The main wicd GUI class. """ - def __init__(self, standalone=False): + def __init__(self, standalone=False, tray=None): """ Initializes everything needed for the GUI. """ setup_dbus() + self.tray = tray + gladefile = os.path.join(wpath.share, "wicd.glade") self.wTree = gtk.glade.XML(gladefile) self.window = self.wTree.get_widget("window1") @@ -305,7 +307,7 @@ class appGui(object): def settings_dialog(self, widget, event=None): """ Displays a general settings dialog. """ if not self.pref: - self.pref = PreferencesDialog(self.wTree) + self.pref = PreferencesDialog(self, self.wTree) else: self.pref.load_preferences_diag() if self.pref.run() == 1: diff --git a/wicd/prefs.py b/wicd/prefs.py index abfa6b0..0066a1b 100644 --- a/wicd/prefs.py +++ b/wicd/prefs.py @@ -51,8 +51,9 @@ def setup_dbus(): class PreferencesDialog(object): """ Class for handling the wicd preferences dialog window. """ - def __init__(self, wTree): + def __init__(self, parent, wTree): setup_dbus() + self.parent = parent self.wTree = wTree self.prep_settings_diag() self.load_preferences_diag() @@ -243,7 +244,11 @@ class PreferencesDialog(object): else: if os.path.exists(not_path): os.remove(not_path) - + # if this GUI was started by a tray icon, + # instantly change the notifications there + if self.parent.tray: + self.parent.tray.icon_info.use_notify = \ + self.notificationscheckbox.get_active() def set_label(self, glade_str, label): """ Sets the label for the given widget in wicd.glade. """ diff --git a/wicd/wicd-client.py b/wicd/wicd-client.py index da3b173..4399ca2 100755 --- a/wicd/wicd-client.py +++ b/wicd/wicd-client.py @@ -53,9 +53,6 @@ try: except ImportError: HAS_NOTIFY = False -USE_NOTIFY = os.path.exists(os.path.join(os.path.expanduser('~/.wicd'), - 'USE_NOTIFICATIONS')) - # Wicd specific imports from wicd import wpath from wicd import misc @@ -130,6 +127,7 @@ class TrayIcon(object): else: self.tr = self.StatusTrayIconGUI() self.icon_info = self.TrayConnectionInfo(self.tr, animate) + self.tr.icon_info = self.icon_info def is_embedded(self): if USE_EGG: @@ -160,6 +158,10 @@ class TrayIcon(object): self.last_state = None self.should_notify = True + self.use_notify = os.path.exists(os.path.join( + os.path.expanduser('~/.wicd'), + 'USE_NOTIFICATIONS')) + if DBUS_AVAIL: self.update_tray_icon() else: @@ -250,7 +252,8 @@ class TrayIcon(object): if not state or not info: [state, info] = daemon.GetConnectionStatus() - self.should_notify = (self.last_state != state) and HAS_NOTIFY and USE_NOTIFY + self.should_notify = (self.last_state != state) and \ + HAS_NOTIFY and self.use_notify self.last_state = state @@ -599,7 +602,7 @@ class TrayIcon(object): def toggle_wicd_gui(self): """ Toggles the wicd GUI. """ if not self.gui_win: - self.gui_win = gui.appGui() + self.gui_win = gui.appGui(tray=self) elif not self.gui_win.is_visible: self.gui_win.show_win() else: From a6c6ca1f1a1392a8e36094cf5abc6bb546f89517 Mon Sep 17 00:00:00 2001 From: Adam Blackburn Date: Sun, 3 May 2009 17:20:02 +0800 Subject: [PATCH 086/186] Updated translations.py to include all translations from old translations.py --- wicd/translations.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/wicd/translations.py b/wicd/translations.py index 7de3616..2047a30 100644 --- a/wicd/translations.py +++ b/wicd/translations.py @@ -55,7 +55,7 @@ def get_gettext(): _ = lang.gettext return _ -# Generated automatically on Sat, 02 May 2009 02:29:29 CDT +# Generated automatically on Sun, 03 May 2009 04:19:52 CDT _ = get_gettext() language = {} language['resetting_ip_address'] = _('''Resetting IP address...''') @@ -64,6 +64,7 @@ language['no_dhcp_offers'] = _('''Connection Failed: No DHCP offers received.''' language['more_help'] = _('''For more detailed help, consult the wicd-curses(8) man page.''') language['bad_pass'] = _('''Connection Failed: Bad password''') language['cannot_start_daemon'] = _('''Unable to connect to wicd daemon DBus interface. This typically means there was a problem starting the daemon. Check the wicd log for more information.''') +language['verifying_association'] = _('''Verifying access point association...''') language['wired_always_on'] = _('''Always show wired interface''') language['could_not_connect'] = _('''Could not connect to wicd's D-Bus interface. Check the wicd log for error messages.''') language['path_to_pac_file'] = _('''Path to PAC File''') @@ -212,3 +213,6 @@ language['display_notifications'] = _('''Display notifications about connection language['connection_established'] = _('''Connection established''') language['disconnected'] = _('''Disconnected''') language['establishing_connection'] = _('''Establishing connection...''') +language['association_failed'] = _('''Connection failed: Could not contact the wireless access point.''') +language['access_denied'] = _('''Unable to contact the wicd dameon due to an access denied error from DBus. Please check your DBus configuration.''') +language['script_settings'] = _('''Scripts''') From a6f486e4055e6b2ced25c5c49a33844e65b92b03 Mon Sep 17 00:00:00 2001 From: Adam Blackburn Date: Sun, 3 May 2009 17:26:29 +0800 Subject: [PATCH 087/186] added images to wired network connection notifications --- wicd/wicd-client.py | 24 ++++++++++++++++++------ 1 file changed, 18 insertions(+), 6 deletions(-) diff --git a/wicd/wicd-client.py b/wicd/wicd-client.py index 4399ca2..37b35be 100755 --- a/wicd/wicd-client.py +++ b/wicd/wicd-client.py @@ -168,13 +168,16 @@ class TrayIcon(object): handle_no_dbus() self.set_not_connected_state() - def _show_notification(self, title, details): + def _show_notification(self, title, details, image=None): if self.should_notify: if not self._last_bubble: - self._last_bubble = pynotify.Notification(title, details) + self._last_bubble = pynotify.Notification(title, details, + image) self._last_bubble.show() else: - self._last_bubble.update(title, details) + self._last_bubble.clear_actions() + self._last_bubble.clear_hints() + self._last_bubble.update(title, details, image) self._last_bubble.show() self.should_notify = False @@ -193,7 +196,8 @@ class TrayIcon(object): wired_ip) self.tr.set_tooltip(status_string) self._show_notification(language['wired_network'], - language['connection_established']) + language['connection_established'], + 'network-wired') @catchdbus def set_wireless_state(self, info): @@ -219,16 +223,24 @@ class TrayIcon(object): def set_connecting_state(self, info): """ Sets the icon info for a connecting state. """ + wired = False if info[0] == 'wired' and len(info) == 1: cur_network = language['wired_network'] + wired = True else: cur_network = info[1] status_string = language['connecting'] + " to " + \ cur_network + "..." self.tr.set_tooltip(status_string) self.tr.set_from_file(os.path.join(wpath.images, "no-signal.png")) - self._show_notification(cur_network, - language['establishing_connection']) + if wired: + self._show_notification(cur_network, + language['establishing_connection'], + 'network-wired') + else: + self._show_notification(cur_network, + language['establishing_connection']) + @catchdbus def set_not_connected_state(self, info=None): From 9ce1c5255bc52567803066c56a1f0a57f8fa3223 Mon Sep 17 00:00:00 2001 From: Adam Blackburn Date: Sun, 3 May 2009 17:31:18 +0800 Subject: [PATCH 088/186] Added icons for wireless networks and disconnect states --- wicd/wicd-client.py | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/wicd/wicd-client.py b/wicd/wicd-client.py index 37b35be..e692612 100755 --- a/wicd/wicd-client.py +++ b/wicd/wicd-client.py @@ -218,7 +218,8 @@ class TrayIcon(object): self.tr.set_tooltip(status_string) self.set_signal_image(int(strength), lock) self._show_notification(self.network, - language['connection_established']) + language['connection_established'], + 'network-wireless') def set_connecting_state(self, info): @@ -239,7 +240,8 @@ class TrayIcon(object): 'network-wired') else: self._show_notification(cur_network, - language['establishing_connection']) + language['establishing_connection'], + 'network-wireless') @catchdbus @@ -254,7 +256,7 @@ class TrayIcon(object): else: status = language['not_connected'] self.tr.set_tooltip(status) - self._show_notification(language['disconnected'], None) + self._show_notification(language['disconnected'], None, 'stop') @catchdbus def update_tray_icon(self, state=None, info=None): From 831d11e5967de173ee4f33a0bfce53a2cb5d22ea Mon Sep 17 00:00:00 2001 From: Adam Blackburn Date: Sun, 3 May 2009 21:58:11 +0800 Subject: [PATCH 089/186] print wicd's version number on daemon start --- wicd/wicd-daemon.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/wicd/wicd-daemon.py b/wicd/wicd-daemon.py index 17f3e2d..e0230d9 100644 --- a/wicd/wicd-daemon.py +++ b/wicd/wicd-daemon.py @@ -1667,6 +1667,8 @@ def main(argv): print 'wicd initializing...' print '---------------------------' + print 'wicd is version', wpath.version, wpath.revision + # Open the DBUS session bus = dbus.SystemBus() wicd_bus = dbus.service.BusName('org.wicd.daemon', bus=bus) From 45b5c4718ca3d97f6c97842d1d5740196a0726e3 Mon Sep 17 00:00:00 2001 From: Adam Blackburn Date: Tue, 5 May 2009 10:34:44 +0800 Subject: [PATCH 090/186] added support for disabling notifications in setup.py --- in/wicd=wpath.py.in | 1 + setup.py | 4 +++- wicd/prefs.py | 6 ++++++ wicd/wicd-client.py | 10 ++++++++-- 4 files changed, 18 insertions(+), 3 deletions(-) diff --git a/in/wicd=wpath.py.in b/in/wicd=wpath.py.in index a4f17ef..d1fbbc1 100755 --- a/in/wicd=wpath.py.in +++ b/in/wicd=wpath.py.in @@ -71,6 +71,7 @@ no_install_kde = %NO_INSTALL_KDE% no_install_acpi = %NO_INSTALL_ACPI% no_install_docs = %NO_INSTALL_DOCS% no_install_ncurses = %NO_INSTALL_NCURSES% +no_use_notifications = %NO_USE_NOTIFICATIONS% def chdir(file): """Change directory to the location of the specified file. diff --git a/setup.py b/setup.py index 4ebc6aa..fdee577 100755 --- a/setup.py +++ b/setup.py @@ -92,7 +92,8 @@ class configure(Command): ('no-install-acpi', None, 'do not install the suspend.d and resume.d acpi scripts'), ('no-install-pmutils', None, 'do not install the pm-utils hooks'), ('no-install-docs', None, 'do not install the auxiliary documentation'), - ('no-install-ncurses', None, 'do not install the ncurses client') + ('no-install-ncurses', None, 'do not install the ncurses client'), + ('no-use-notifications', None, 'do not ever allow the use of libnotify notifications') ] def initialize_options(self): @@ -127,6 +128,7 @@ class configure(Command): self.no_install_pmutils = False self.no_install_docs = False self.no_install_ncurses = False + self.no_use_notifications = False # Determine the default init file location on several different distros diff --git a/wicd/prefs.py b/wicd/prefs.py index 0066a1b..a8da776 100644 --- a/wicd/prefs.py +++ b/wicd/prefs.py @@ -156,6 +156,12 @@ class PreferencesDialog(object): except ImportError: self.notificationscheckbox.set_active(False) self.notificationscheckbox.set_sensitive(False) + + # if notifications were disabled with the configure flag + if wpath.no_use_notifications: + self.notificationscheckbox.set_active(False) + self.notificationscheckbox.hide() + self.wTree.get_widget('label2').hide() self.wTree.get_widget("notebook2").set_current_page(0) diff --git a/wicd/wicd-client.py b/wicd/wicd-client.py index e692612..dc306de 100755 --- a/wicd/wicd-client.py +++ b/wicd/wicd-client.py @@ -75,6 +75,9 @@ if not hasattr(gtk, "StatusIcon"): print "Has notifications support", HAS_NOTIFY +if wpath.no_use_notifications: + print 'Notifications disabled during setup.py configure' + misc.RenameProcess("wicd-client") if __name__ == '__main__': @@ -266,8 +269,11 @@ class TrayIcon(object): if not state or not info: [state, info] = daemon.GetConnectionStatus() - self.should_notify = (self.last_state != state) and \ - HAS_NOTIFY and self.use_notify + # should this state change display a notification? + self.should_notify = not wpath.no_use_notifications and \ + (self.last_state != state) and \ + HAS_NOTIFY and \ + self.use_notify self.last_state = state From cd391b8ff551adffc895ecd812577aa83ce8640f Mon Sep 17 00:00:00 2001 From: Adam Blackburn Date: Tue, 5 May 2009 12:00:22 +0800 Subject: [PATCH 091/186] updated CHANGES/NEWS --- CHANGES | 265 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++ NEWS | 1 + 2 files changed, 266 insertions(+) diff --git a/CHANGES b/CHANGES index 7556ef8..437cb5d 100644 --- a/CHANGES +++ b/CHANGES @@ -1,4 +1,269 @@ ------------------------------------------------------------ +revno: 382 +committer: Adam Blackburn +branch nick: 1.6 +timestamp: Tue 2009-05-05 11:58:36 +0800 +message: + merged notifications branch + ------------------------------------------------------------ + revno: 371.1.13 + committer: Adam Blackburn + branch nick: libnotify-support-ng + timestamp: Tue 2009-05-05 10:34:44 +0800 + message: + added support for disabling notifications in setup.py + ------------------------------------------------------------ + revno: 371.1.12 + committer: Adam Blackburn + branch nick: libnotify-support-ng + timestamp: Tue 2009-05-05 10:17:10 +0800 + message: + merged latest 1.6 + ------------------------------------------------------------ + revno: 371.1.11 + committer: Adam Blackburn + branch nick: libnotify-support-ng + timestamp: Sun 2009-05-03 17:31:18 +0800 + message: + Added icons for wireless networks and disconnect states + ------------------------------------------------------------ + revno: 371.1.10 + committer: Adam Blackburn + branch nick: libnotify-support-ng + timestamp: Sun 2009-05-03 17:27:31 +0800 + message: + merge latest 1.6 + ------------------------------------------------------------ + revno: 371.1.9 + committer: Adam Blackburn + branch nick: libnotify-support-ng + timestamp: Sun 2009-05-03 17:26:29 +0800 + message: + added images to wired network connection notifications + ------------------------------------------------------------ + revno: 371.1.8 + committer: Adam Blackburn + branch nick: libnotify-support-ng + timestamp: Sun 2009-05-03 10:32:10 +0800 + message: + Added support for instantly enabling/disabling notifications when the preference is changed + ------------------------------------------------------------ + revno: 371.1.7 + committer: Adam Blackburn + branch nick: libnotify-support-ng + timestamp: Sun 2009-05-03 09:50:09 +0800 + message: + Fixed the libglade warnings when loading the GTK GUI + ------------------------------------------------------------ + revno: 371.1.6 + committer: Adam Blackburn + branch nick: libnotify-support-ng + timestamp: Sun 2009-05-03 09:33:32 +0800 + message: + Merge latest 1.6 + ------------------------------------------------------------ + revno: 371.1.5 + committer: Adam Blackburn + branch nick: libnotify-support-ng + timestamp: Sat 2009-05-02 14:01:30 +0800 + message: + Disable the enable notification option if pynotify isn't installed + ------------------------------------------------------------ + revno: 371.1.4 + committer: Adam Blackburn + branch nick: libnotify-support-ng + timestamp: Sat 2009-05-02 12:47:05 +0800 + message: + Merge latest 1.6 + ------------------------------------------------------------ + revno: 371.1.3 + committer: Adam Blackburn + branch nick: libnotify-support-ng + timestamp: Sat 2009-05-02 12:43:43 +0800 + message: + Reworded notifications and added new entries to translations.py + ------------------------------------------------------------ + revno: 371.1.2 + committer: Adam Blackburn + branch nick: libnotify-support-ng + timestamp: Fri 2009-05-01 14:32:09 +0800 + message: + added support for enabling/disabling notifications + ------------------------------------------------------------ + revno: 371.1.1 + committer: Adam Blackburn + branch nick: libnotify-support-ng + timestamp: Fri 2009-05-01 13:46:21 +0800 + message: + Initial notification support +------------------------------------------------------------ +revno: 381 +committer: Adam Blackburn +branch nick: 1.6 +timestamp: Sun 2009-05-03 22:00:24 +0800 +message: + print wicd's version number on daemon start + ------------------------------------------------------------ + revno: 379.1.1 + committer: Adam Blackburn + branch nick: 1.6 + timestamp: Sun 2009-05-03 17:20:02 +0800 + message: + Updated translations.py to include all translations from old translations.py +------------------------------------------------------------ +revno: 380 +committer: Adam Blackburn +branch nick: 1.6 +timestamp: Sun 2009-05-03 21:58:11 +0800 +message: + print wicd's version number on daemon start +------------------------------------------------------------ +revno: 379 +committer: Andrew Psaltis +branch nick: 1.6 +timestamp: Sat 2009-05-02 14:08:07 -0400 +message: + Merged bugfixes from r321 of experimental-nacl. + ------------------------------------------------------------ + revno: 202.2.30 + committer: Andrew Psaltis + branch nick: experimental-nacl + timestamp: Fri 2009-05-01 22:23:40 -0400 + message: + Merge r375 of mainline 1.6. + ------------------------------------------------------------ + revno: 202.2.29 + committer: Andrew Psaltis + branch nick: experimental-nacl + timestamp: Fri 2009-05-01 22:13:15 -0400 + message: + Some more bugfixes... + Fixed unencrypted network support in both UIs. + Fixed marking the Static IP checkbox in wicd-curses. + Made the checkboxes in the the network properties dialogs in wicd-curses act + like those in wicd-client. + Filter the urwid popen2 warning in wicd-curses. + ------------------------------------------------------------ + revno: 202.2.28 + committer: Andrew Psaltis + branch nick: experimental-nacl + timestamp: Fri 2009-05-01 13:02:44 -0400 + message: + Merged with r272 of mainline 1.6. +------------------------------------------------------------ +revno: 378 +committer: Adam Blackburn +branch nick: 1.6 +timestamp: Sat 2009-05-02 15:32:58 +0800 +message: + Updated INSTALL to use update_translations_py before get_translations +------------------------------------------------------------ +revno: 377 +committer: Adam Blackburn +branch nick: 1.6 +timestamp: Sat 2009-05-02 15:30:09 +0800 +message: + Added automatically generated translations.py +------------------------------------------------------------ +revno: 376 +committer: Adam Blackburn +branch nick: 1.6 +timestamp: Sat 2009-05-02 15:24:50 +0800 +message: + added support for automatically retrieving translations.py +------------------------------------------------------------ +revno: 375 +committer: Dan O'Reilly +branch nick: experimental +timestamp: Fri 2009-05-01 20:26:46 -0400 +message: + Fix bug where shared essid settings couldn't be disabled once they were turned on. +------------------------------------------------------------ +revno: 374 +committer: Dan O'Reilly +branch nick: experimental +timestamp: Fri 2009-05-01 20:20:40 -0400 +message: + Fix crash when saving settings for unencrypted networks. + Remove unneeded function in prefs.py +------------------------------------------------------------ +revno: 373 +committer: Adam Blackburn +branch nick: 1.6 +timestamp: Fri 2009-05-01 21:58:53 +0800 +message: + Merge 1.6-rworkman (thanks!) + ------------------------------------------------------------ + revno: 365.1.8 + committer: Robby Workman + branch nick: 1.6-rworkman + timestamp: Tue 2009-04-28 10:51:16 -0500 + message: + Tweaks to NEWS file. + ------------------------------------------------------------ + revno: 365.1.7 + committer: Robby Workman + branch nick: 1.6-rworkman + timestamp: Tue 2009-04-28 10:50:23 -0500 + message: + Merged mainline. This will require one more change to the NEWS file + to handle conflicts. + ------------------------------------------------------------ + revno: 365.1.6 + committer: Robby Workman + branch nick: 1.6-rworkman + timestamp: Sun 2009-04-26 21:38:10 -0500 + message: + Clarified some required versions in INSTALL + ------------------------------------------------------------ + revno: 365.1.5 + committer: Robby Workman + branch nick: 1.6-rworkman + timestamp: Sat 2009-04-25 23:17:33 -0500 + message: + Use set_icon_name() instead of set_icon_from_file() in gui.py ; this + allows gtk to use the themed icons (and presumably the correct size + and all that good stuff). + ------------------------------------------------------------ + revno: 365.1.4 + committer: Robby Workman + branch nick: 1.6-rworkman + timestamp: Sat 2009-04-25 22:55:12 -0500 + message: + Synced CHANGES file with mainline. + Minor tweaks to NEWS file (mostly formatting). + ------------------------------------------------------------ + revno: 365.1.3 + committer: Robby Workman + branch nick: 1.6-rworkman + timestamp: Wed 2009-04-22 19:53:08 -0500 + message: + Added NEWS file with major changes since 1.5.x. + Updated CHANGES file with 'bzr log' output as of r367. +------------------------------------------------------------ +revno: 372 +committer: Adam Blackburn +branch nick: 1.6 +timestamp: Fri 2009-05-01 13:41:13 +0800 +message: + Also catch AttributeErrors when guessing data types +------------------------------------------------------------ +revno: 371 +committer: Dan O'Reilly +branch nick: experimental +timestamp: Mon 2009-04-27 19:17:01 -0400 +message: + Correctly handle case where a key is all digits and starts with a '0'. + Remove some unused imports. + Simplfy code that checks for valid wpa_supplicant drivers. +------------------------------------------------------------ +revno: 370 +committer: Adam Blackburn +branch nick: 1.6 +timestamp: Sun 2009-04-26 08:03:59 +0900 +message: + Updated version numbers +------------------------------------------------------------ revno: 369 committer: Adam Blackburn branch nick: 1.6 diff --git a/NEWS b/NEWS index 536b3f1..e3b0eaf 100644 --- a/NEWS +++ b/NEWS @@ -11,6 +11,7 @@ Major Changes: - Reworked the Preferences menu to be more in line with GNOME standards - Added support for global scripts - Made it possible to have optional entries in encryption templates +- Added ability to show libnotify notifications on status change Minor Changes and Other Enchancements: - Better autoconnection behavior From 4317cb0cda3aab784fb7bee4839b01c5ad8086ed Mon Sep 17 00:00:00 2001 From: Adam Blackburn Date: Tue, 5 May 2009 12:55:35 +0800 Subject: [PATCH 092/186] Added code to debug why pynotify fails --- wicd/wicd-client.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/wicd/wicd-client.py b/wicd/wicd-client.py index dc306de..b1115dc 100755 --- a/wicd/wicd-client.py +++ b/wicd/wicd-client.py @@ -49,8 +49,10 @@ try: pygtk.require('2.0') import pynotify if not pynotify.init("Wicd"): + print 'could not initalize pynotify' HAS_NOTIFY = False except ImportError: + print 'import failed HAS_NOTIFY = False # Wicd specific imports From e323bbaf7369d29568d392d7b284ac9b3512d19c Mon Sep 17 00:00:00 2001 From: Adam Blackburn Date: Tue, 5 May 2009 12:56:09 +0800 Subject: [PATCH 093/186] Updated translations.py --- wicd/translations.py | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/wicd/translations.py b/wicd/translations.py index 2047a30..e5e72f1 100644 --- a/wicd/translations.py +++ b/wicd/translations.py @@ -55,7 +55,7 @@ def get_gettext(): _ = lang.gettext return _ -# Generated automatically on Sun, 03 May 2009 04:19:52 CDT +# Generated automatically on Mon, 04 May 2009 23:56:04 CDT _ = get_gettext() language = {} language['resetting_ip_address'] = _('''Resetting IP address...''') @@ -215,4 +215,3 @@ language['disconnected'] = _('''Disconnected''') language['establishing_connection'] = _('''Establishing connection...''') language['association_failed'] = _('''Connection failed: Could not contact the wireless access point.''') language['access_denied'] = _('''Unable to contact the wicd dameon due to an access denied error from DBus. Please check your DBus configuration.''') -language['script_settings'] = _('''Scripts''') From a66a9b59461afd4c91eabf40d401f6a4cb108ca9 Mon Sep 17 00:00:00 2001 From: Andrew Psaltis Date: Wed, 6 May 2009 15:33:12 -0400 Subject: [PATCH 094/186] Made scans asynchronous so that users can actually access preferences while the daemon is scanning. --- curses/wicd-curses.py | 37 +++++++++++++++++++++++-------------- 1 file changed, 23 insertions(+), 14 deletions(-) diff --git a/curses/wicd-curses.py b/curses/wicd-curses.py index b188b16..c24dd8c 100755 --- a/curses/wicd-curses.py +++ b/curses/wicd-curses.py @@ -586,6 +586,7 @@ class appGUI(): self.connecting = False self.screen_locked = False self.do_diag_lock = False + self.scanning = False self.pref = None @@ -593,6 +594,11 @@ class appGUI(): #self.dialog = PrefOverlay(self.frame,self.size) + def doScan(self, sync=False): + self.scanning = True + wireless.Scan(False) + + def init_other_optcols(self): # The "tabbed" preferences dialog self.prefCols = OptCols( [('meta enter','OK'), @@ -631,7 +637,7 @@ class appGUI(): # That dialog will sit there for a while if I don't get rid of it self.update_ui() wireless.SetHiddenNetworkESSID(misc.noneToString(hidden)) - wireless.Scan(True) + wireless.Scan(False) wireless.SetHiddenNetworkESSID("") def update_focusloc(self): @@ -815,14 +821,16 @@ class appGUI(): #if not self.connecting: # gobject.idle_add(self.refresh_networks, None, False, None) self.unlock_screen() + self.scanning = False # Same, same, same, same, same, same #@wrap_exceptions() def dbus_scan_started(self): + self.scanning = True self.lock_screen() def restore_primary(self): - if self.do_diag_lock: + if self.do_diag_lock or self.scanning: self.frame.set_body(self.screen_locker) self.do_diag_lock = False else: @@ -839,23 +847,24 @@ class appGUI(): #return False if "f5" in keys or 'R' in keys: self.lock_screen() - wireless.Scan(True) + self.doScan() if "D" in keys: # Disconnect from all networks. daemon.Disconnect() self.update_netlist() if 'right' in keys: - focus = self.thePile.get_focus() - self.frame.set_footer(urwid.Pile([self.confCols,self.footer2])) - if focus == self.wiredCB: - self.diag = WiredSettingsDialog(self.wiredCB.get_body().get_selected_profile()) - self.frame.set_body(self.diag) - else: - # wireless list only other option - wid,pos = self.thePile.get_focus().get_focus() - self.diag = WirelessSettingsDialog(pos,self.frame) - self.diag.ready_widgets(ui,self.frame) - self.frame.set_body(self.diag) + if not self.scanning: + focus = self.thePile.get_focus() + self.frame.set_footer(urwid.Pile([self.confCols,self.footer2])) + if focus == self.wiredCB: + self.diag = WiredSettingsDialog(self.wiredCB.get_body().get_selected_profile()) + self.frame.set_body(self.diag) + else: + # wireless list only other option + wid,pos = self.thePile.get_focus().get_focus() + self.diag = WirelessSettingsDialog(pos,self.frame) + self.diag.ready_widgets(ui,self.frame) + self.frame.set_body(self.diag) # Guess what! I actually need to put this here, else I'll have # tons of references to self.frame lying around. ^_^ if "enter" in keys: From d192f641825d115f9faf2f8c5a1aa67dd6e265e0 Mon Sep 17 00:00:00 2001 From: Andrew Psaltis Date: Wed, 6 May 2009 18:13:29 -0400 Subject: [PATCH 095/186] Fixed missing endquote in wicd-client.py. --- wicd/wicd-client.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/wicd/wicd-client.py b/wicd/wicd-client.py index b1115dc..7c9d100 100755 --- a/wicd/wicd-client.py +++ b/wicd/wicd-client.py @@ -52,7 +52,7 @@ try: print 'could not initalize pynotify' HAS_NOTIFY = False except ImportError: - print 'import failed + print 'import failed' HAS_NOTIFY = False # Wicd specific imports From dffed496a8a3975c72b017b0254835070442eba4 Mon Sep 17 00:00:00 2001 From: Andrew Psaltis Date: Thu, 7 May 2009 00:30:25 -0400 Subject: [PATCH 096/186] Added support for manual distro detection in setup.py. --- setup.py | 93 +++++++++++++++++++++++++++++++-------------- wicd/wicd-client.py | 2 +- 2 files changed, 66 insertions(+), 29 deletions(-) diff --git a/setup.py b/setup.py index fdee577..6c66449 100755 --- a/setup.py +++ b/setup.py @@ -2,6 +2,7 @@ # # Copyright (C) 2007 - 2009 Adam Blackburn # Copyright (C) 2007 - 2009 Dan O'Reilly +# Copyright (C) 2009 Andrew Psaltis # # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License Version 2 as @@ -84,6 +85,7 @@ class configure(Command): ('initfile=', None, 'set the init file to use'), ('initfilename=', None, "set the name of the init file (don't use)"), ('wicdgroup=', None, "set the name of the group used for wicd"), + ('distro=', None, 'set the distribution for which wicd will be installed'), # Configure switches ('no-install-init', None, "do not install the init file"), @@ -120,6 +122,7 @@ class configure(Command): self.docdir = '/usr/share/doc/wicd/' self.mandir = '/usr/share/man/' self.kdedir = '/usr/share/autostart/' + self.distro = 'auto' self.no_install_init = False self.no_install_man = False @@ -131,49 +134,38 @@ class configure(Command): self.no_use_notifications = False # Determine the default init file location on several different distros - self.distro_detect_failed = False self.initfile = 'init/default/wicd' + # ddistro is the detected distro if os.path.exists('/etc/redhat-release'): - self.init = '/etc/rc.d/init.d/' - self.initfile = 'init/redhat/wicd' + self.ddistro = 'redhat' elif os.path.exists('/etc/SuSE-release'): - self.init = '/etc/init.d/' - self.initfile = 'init/suse/wicd' + self.ddistro = 'suse' elif os.path.exists('/etc/fedora-release'): - self.init = '/etc/rc.d/init.d/' - self.initfile = 'init/redhat/wicd' + self.ddistro = 'redhat' elif os.path.exists('/etc/gentoo-release'): - self.init = '/etc/init.d/' - self.initfile = 'init/gentoo/wicd' + self.ddistro = 'gentoo' elif os.path.exists('/etc/debian_version'): - self.init = '/etc/init.d/' - self.initfile = 'init/debian/wicd' + self.ddistro = 'debian' elif os.path.exists('/etc/arch-release'): - self.init = '/etc/rc.d/' - self.initfile = 'init/arch/wicd' + self.ddistro = 'arch' elif os.path.exists('/etc/slackware-version') or \ - os.path.exists('/etc/slamd64-version'): - self.init = '/etc/rc.d/' - self.initfile = 'init/slackware/rc.wicd' - self.docdir = '/usr/doc/wicd-%s' % VERSION_NUM - self.mandir = '/usr/man/' - self.no_install_acpi = True + os.path.exists('/etc/slamd64-version') or \ + os.path.exists('/etc/bluewhite64-version'): + self.ddistro = 'slackware' elif os.path.exists('/etc/pld-release'): - self.init = '/etc/rc.d/init.d/' - self.initfile = 'init/pld/wicd' + self.ddistro = 'pld' elif os.path.exists('/usr/bin/crux'): - self.init = '/etc/rc.d/' + self.ddistro = 'crux' elif os.path.exists('/etc/lunar.release'): - self.init='/etc/init.d/' - self.initfile = 'init/lunar/wicd' + self.distro = 'lunar' else: - self.init = 'FAIL' - self.no_install_init = True - self.distro_detect_failed = True + self.ddistro = 'FAIL' + #self.no_install_init = True + #self.distro_detect_failed = True print 'WARNING: Unable to detect the distribution in use. ' + \ - 'If you have specified --init and --initfile, configure will continue. ' + \ + 'If you have specified --distro or --init and --initfile, configure will continue. ' + \ 'Please report this warning, along with the name of your ' + \ 'distribution, to the wicd developers.' @@ -229,7 +221,52 @@ class configure(Command): self.initfilename = os.path.basename(self.initfile) self.wicdgroup = 'users' + def distro_check(self): + print "Distro is: "+self.distro + if self.distro in ['sles','suse']: + self.init = '/etc/init.d/' + self.initfile = 'init/suse/wicd' + elif self.distro in ['redhat','centos','fedora']: + self.init = '/etc/rc.d/init.d/' + self.initfile = 'init/redhat/wicd' + elif self.distro in ['slackware','slamd64','bluewhite64']: + self.init = '/etc/rc.d/' + self.initfile = 'init/slackware/rc.wicd' + self.docdir = '/usr/doc/wicd-%s' % VERSION_NUM + self.mandir = '/usr/man/' + self.no_install_acpi = True + elif self.distro in ['debian']: + self.init = '/etc/init.d/' + self.initfile = 'init/debian/wicd' + elif self.distro in ['arch']: + self.init = '/etc/rc.d/' + self.initfile = 'init/arch/wicd' + elif self.distro in ['gentoo']: + self.init = '/etc/init.d/' + self.initfile = 'init/gentoo/wicd' + elif self.distro in ['pld']: + self.init = '/etc/rc.d/init.d/' + self.initfile = 'init/pld/wicd' + elif self.distro in ['crux']: + self.init = '/etc/rc.d/' + elif self.distro in ['lunar']: + self.init='/etc/init.d/' + self.initfile = 'init/lunar/wicd' + else : + if self.distro == 'auto': + print "NOTICE: Automatic distro detection found: "+self.ddistro+", retrying with that..." + self.distro = self.ddistro + self.distro_check() + else: + print "WARNING: Distro detection failed!" + self.init='init/default/wicd' + self.no_install_init = True + self.distro_detect_failed = True + + + def finalize_options(self): + self.distro_check() if self.distro_detect_failed and not self.no_install_init and \ 'FAIL' in [self.init, self.initfile]: print 'ERROR: Failed to detect distro. Configure cannot continue. ' + \ diff --git a/wicd/wicd-client.py b/wicd/wicd-client.py index b1115dc..7c9d100 100755 --- a/wicd/wicd-client.py +++ b/wicd/wicd-client.py @@ -52,7 +52,7 @@ try: print 'could not initalize pynotify' HAS_NOTIFY = False except ImportError: - print 'import failed + print 'import failed' HAS_NOTIFY = False # Wicd specific imports From f691f446f6d72274ab4011d4d5d204eb9bdd0ccc Mon Sep 17 00:00:00 2001 From: Andrew Psaltis Date: Thu, 7 May 2009 00:38:18 -0400 Subject: [PATCH 097/186] Redid the decorator to look like the other exception-catching decorators in wicd. --- curses/wicd-curses.py | 36 +++++++++++++++++------------------- 1 file changed, 17 insertions(+), 19 deletions(-) diff --git a/curses/wicd-curses.py b/curses/wicd-curses.py index c24dd8c..f053bfb 100755 --- a/curses/wicd-curses.py +++ b/curses/wicd-curses.py @@ -79,17 +79,11 @@ for i in language.keys(): ######################################## ##### SUPPORT CLASSES ######################################## -# A hack to get any errors that pop out of the program to appear ***AFTER*** the -# program exits. -# I also may have been a bit overkill about using this too, I guess I'll find -# that out soon enough. -# I learned about this from this example: -# http://blog.lutzky.net/2007/09/16/exception-handling-decorators-and-python/ -class wrap_exceptions: - def __call__(self, f): - def wrap_exceptions(*args, **kargs): +# Yay for decorators! +def wrap_exceptions(func): + def wrapper(*args, **kargs): try: - return f(*args, **kargs) + return func(*args, **kargs) except KeyboardInterrupt: #gobject.source_remove(redraw_tag) loop.quit() @@ -117,7 +111,11 @@ class wrap_exceptions: #sleep(2) raise - return wrap_exceptions + wrapper.__name__ = func.__name__ + wrapper.__module__ = func.__module__ + wrapper.__dict__ = func.__dict__ + wrapper.__doc__ = func.__doc__ + return wrapper ######################################## ##### SUPPORT FUNCTIONS @@ -125,7 +123,7 @@ class wrap_exceptions: # Look familiar? These two functions are clones of functions found in wicd's # gui.py file, except that now set_status is a function passed to them. -@wrap_exceptions() +@wrap_exceptions def check_for_wired(wired_ip,set_status): """ Determine if wired is active, and if yes, set the status. """ if wired_ip and wired.CheckPluggedIn(): @@ -134,7 +132,7 @@ def check_for_wired(wired_ip,set_status): else: return False -@wrap_exceptions() +@wrap_exceptions def check_for_wireless(iwconfig, wireless_ip, set_status): """ Determine if wireless is active, and if yes, set the status. """ if not wireless_ip: @@ -659,7 +657,7 @@ class appGUI(): # Be clunky until I get to a later stage of development. # Update the list of networks. Usually called by DBus. - @wrap_exceptions() + @wrap_exceptions def update_netlist(self,state=None, x=None, force_check=False,firstrun=False): # Don't even try to do this if we are running a dialog if self.diag: @@ -721,7 +719,7 @@ class appGUI(): # Update the footer/status bar conn_status = False - @wrap_exceptions() + @wrap_exceptions def update_status(self): wired_connecting = wired.CheckIfWiredConnecting() wireless_connecting = wireless.CheckIfWirelessConnecting() @@ -809,13 +807,13 @@ class appGUI(): # Make sure the screen is still working by providing a pretty counter. # Not necessary in the end, but I will be using footer1 for stuff in # the long run, so I might as well put something there. - #@wrap_exceptions() + #@wrap_exceptions def update_time(self): self.time_label.set_text(strftime('%H:%M:%S')) return True # Yeah, I'm copying code. Anything wrong with that? - #@wrap_exceptions() + #@wrap_exceptions def dbus_scan_finished(self): # I'm pretty sure that I'll need this later. #if not self.connecting: @@ -824,7 +822,7 @@ class appGUI(): self.scanning = False # Same, same, same, same, same, same - #@wrap_exceptions() + #@wrap_exceptions def dbus_scan_started(self): self.scanning = True self.lock_screen() @@ -954,7 +952,7 @@ class appGUI(): continue # Redraw the screen - @wrap_exceptions() + @wrap_exceptions def update_ui(self): #self.update_status() canvas = self.frame.render( (self.size),True ) From 8dc997548e1b447487002d3b9ab1ab10a6431c1a Mon Sep 17 00:00:00 2001 From: Dan O'Reilly Date: Sat, 9 May 2009 20:53:49 -0400 Subject: [PATCH 098/186] Make bitrates regex work when it's the last entry in a cell. --- wicd/wnettools.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/wicd/wnettools.py b/wicd/wnettools.py index d09e8f2..f5d720d 100644 --- a/wicd/wnettools.py +++ b/wicd/wnettools.py @@ -48,7 +48,7 @@ channel_pattern = re.compile('.*Channel:? ?(\d\d?)', _re_mode) strength_pattern = re.compile('.*Quality:?=? ?(\d+)\s*/?\s*(\d*)', _re_mode) altstrength_pattern = re.compile('.*Signal level:?=? ?(\d+)\s*/?\s*(\d*)', _re_mode) signaldbm_pattern = re.compile('.*Signal level:?=? ?(-\d\d*)', _re_mode) -bitrates_pattern = re.compile('.*Bit Rates:(.*?)E', _re_mode) +bitrates_pattern = re.compile('(\d+\s+\S+/s)', _re_mode) mode_pattern = re.compile('.*Mode:(.*?)\n', _re_mode) freq_pattern = re.compile('.*Frequency:(.*?)\n', _re_mode) wep_pattern = re.compile('.*Encryption key:(.*?)\n', _re_mode) @@ -1114,9 +1114,9 @@ class BaseWirelessInterface(BaseInterface): ap['channel'] = self._FreqToChannel(freq) # Bit Rate - ap['bitrates'] = misc.RunRegex(bitrates_pattern, cell).split('\n') - ap['bitrates'] = '; '.join(m.strip() for m in ap['bitrates']).rstrip('; ') - + ap['bitrates'] = misc.RunRegex(bitrates_pattern, + cell.split("Bit Rates")[-1]) + # BSSID ap['bssid'] = misc.RunRegex(ap_mac_pattern, cell) From 7bcd28d210ec68624a9d714bea0a1ced9928b437 Mon Sep 17 00:00:00 2001 From: Andrew Psaltis Date: Sun, 10 May 2009 09:40:38 -0400 Subject: [PATCH 099/186] Hopefully fixed bug 355693, related to focus positioning. --- curses/wicd-curses.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/curses/wicd-curses.py b/curses/wicd-curses.py index f053bfb..93ed4b4 100755 --- a/curses/wicd-curses.py +++ b/curses/wicd-curses.py @@ -682,7 +682,7 @@ class appGUI(): else: self.wlessLB.body = urwid.SimpleListWalker(wlessL) else: - self.wlessLB = self.no_wlan + self.wlesslb = self.no_wlan if daemon.GetAlwaysShowWiredInterface() or wired.CheckPluggedIn(): #if daemon.GetAlwaysShowWiredInterface(): #if firstrun: @@ -698,7 +698,7 @@ class appGUI(): if self.focusloc[0] == self.WIRED_IDX: self.thePile.get_focus().get_body().set_focus(self.focusloc[1]) else: - if self.wlessLB is not self.no_wlan: + if self.wlessLB != self.no_wlan: self.thePile.get_focus().set_focus(self.focusloc[1]) else: self.thePile.set_focus(self.wiredCB) @@ -995,7 +995,7 @@ def main(): if options.screen == 'raw': import urwid.raw_display ui = urwid.raw_display.Screen() - elif options.screen is 'curses': + elif options.screen == 'curses': import urwid.curses_display ui = urwid.curses_display.Screen() From 46798c4115dcfea02114a53cb2461f7aaf155390 Mon Sep 17 00:00:00 2001 From: Adam Blackburn Date: Sun, 10 May 2009 22:03:52 +0800 Subject: [PATCH 100/186] Removed italicized text from the GTK GUI --- wicd/guiutil.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/wicd/guiutil.py b/wicd/guiutil.py index 454f37d..cee52ed 100644 --- a/wicd/guiutil.py +++ b/wicd/guiutil.py @@ -146,5 +146,5 @@ class GreyLabel(gtk.Label): gtk.Label.__init__(self) def set_label(self, text): - self.set_markup("" + text + "") + self.set_markup("" + text + "") self.set_alignment(0, 0) From 6e8fde82746e5ef7d2abfd00626fd6dcf2836ef5 Mon Sep 17 00:00:00 2001 From: Adam Blackburn Date: Sun, 10 May 2009 22:51:49 +0800 Subject: [PATCH 101/186] Made the GUI look better with dark themes --- wicd/guiutil.py | 2 +- wicd/netentry.py | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/wicd/guiutil.py b/wicd/guiutil.py index cee52ed..169dcc8 100644 --- a/wicd/guiutil.py +++ b/wicd/guiutil.py @@ -146,5 +146,5 @@ class GreyLabel(gtk.Label): gtk.Label.__init__(self) def set_label(self, text): - self.set_markup("" + text + "") + self.set_markup(text) self.set_alignment(0, 0) diff --git a/wicd/netentry.py b/wicd/netentry.py index 161a45b..9765d57 100644 --- a/wicd/netentry.py +++ b/wicd/netentry.py @@ -555,7 +555,7 @@ class WiredNetworkEntry(NetworkEntry): self.image.show() self.connect_button.show() - self.name_label.set_label(language['wired_network']) + self.name_label.set_label("" + language['wired_network'] + "") self.is_full_gui = True @@ -756,7 +756,7 @@ class WirelessNetworkEntry(NetworkEntry): 'encryption_method')) self.set_channel(wireless.GetWirelessProperty(networkID, 'channel')) self.name_label.set_use_markup(True) - self.name_label.set_label("%s %s %s %s" % (self._escape(self.essid), + self.name_label.set_label("%s %s %s %s" % (self._escape(self.essid), self.lbl_strength.get_label(), self.lbl_encryption.get_label(), self.lbl_channel.get_label(), From 6f9ab0067309917b82ec0b73012349e1b4fc05d0 Mon Sep 17 00:00:00 2001 From: Dan O'Reilly Date: Sun, 10 May 2009 13:53:54 -0400 Subject: [PATCH 102/186] Don't use dbusmanager.DBusException--it doesn't exist. --- wicd/wicd-client.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/wicd/wicd-client.py b/wicd/wicd-client.py index 7c9d100..4934215 100755 --- a/wicd/wicd-client.py +++ b/wicd/wicd-client.py @@ -753,7 +753,7 @@ def on_exit(): if DBUS_AVAIL: try: daemon.SetGUIOpen(False) - except dbusmanager.DBusException: + except DBusException: pass def handle_no_dbus(): From 3a05d82a231b43db8be9762c9b7417d54e050e53 Mon Sep 17 00:00:00 2001 From: Andrew Psaltis Date: Tue, 12 May 2009 00:04:43 -0400 Subject: [PATCH 103/186] If the screen in wicd-curses is not up and an ui update is requested, abort the program. --- curses/wicd-curses.py | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/curses/wicd-curses.py b/curses/wicd-curses.py index 93ed4b4..315eb2b 100755 --- a/curses/wicd-curses.py +++ b/curses/wicd-curses.py @@ -962,6 +962,10 @@ class appGUI(): # the input. I'll try to get that working at a later time, if people # want that "feature". #canvaso = urwid.CanvasOverlay(self.dialog.render( (80,20),True),canvas,0,1) + # If the screen is turned off for some reason, don't even try to do the + # rest of the stuff. + if not ui._started: + return False ui.draw_screen((self.size),canvas) keys = ui.get_input() self.handle_keys(keys) From b2cbaf957d205b2647b16f32210c28801bda2b80 Mon Sep 17 00:00:00 2001 From: Andrew Psaltis Date: Wed, 13 May 2009 19:03:29 -0400 Subject: [PATCH 104/186] Fixed typo in wicd-curses.py. --- curses/wicd-curses.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/curses/wicd-curses.py b/curses/wicd-curses.py index 315eb2b..4485fed 100755 --- a/curses/wicd-curses.py +++ b/curses/wicd-curses.py @@ -682,7 +682,7 @@ class appGUI(): else: self.wlessLB.body = urwid.SimpleListWalker(wlessL) else: - self.wlesslb = self.no_wlan + self.wlessLB = self.no_wlan if daemon.GetAlwaysShowWiredInterface() or wired.CheckPluggedIn(): #if daemon.GetAlwaysShowWiredInterface(): #if firstrun: From 7ba44e3354b534e70d1708de3701a166bc1abdfc Mon Sep 17 00:00:00 2001 From: Adam Blackburn Date: Thu, 14 May 2009 19:37:20 +0800 Subject: [PATCH 105/186] Fix / tags --- wicd/netentry.py | 1 + 1 file changed, 1 insertion(+) diff --git a/wicd/netentry.py b/wicd/netentry.py index 9765d57..3df4f77 100644 --- a/wicd/netentry.py +++ b/wicd/netentry.py @@ -555,6 +555,7 @@ class WiredNetworkEntry(NetworkEntry): self.image.show() self.connect_button.show() + self.name_label.set_use_markup(True) self.name_label.set_label("" + language['wired_network'] + "") self.is_full_gui = True From 95a8261a49074c686f0c1b9e59fa477fad41ed6b Mon Sep 17 00:00:00 2001 From: Adam Blackburn Date: Thu, 14 May 2009 21:55:59 +0800 Subject: [PATCH 106/186] update CHANGES and NEWS --- CHANGES | 155 +++++++++++++++++++++++++++++++++++++++++++++++++++++++ NEWS | 12 ++--- setup.py | 2 +- 3 files changed, 162 insertions(+), 7 deletions(-) diff --git a/CHANGES b/CHANGES index 437cb5d..06b2a9b 100644 --- a/CHANGES +++ b/CHANGES @@ -1,4 +1,159 @@ ------------------------------------------------------------ +revno: 394 +committer: Andrew Psaltis +branch nick: 1.6 +timestamp: Thu 2009-05-14 09:44:28 -0400 +message: + Merged typo fix from r331 of experimental-nacl. + ------------------------------------------------------------ + revno: 202.2.40 + committer: Andrew Psaltis + branch nick: experimental-nacl + timestamp: Wed 2009-05-13 19:03:29 -0400 + message: + Fixed typo in wicd-curses.py. +------------------------------------------------------------ +revno: 393 +committer: Adam Blackburn +branch nick: 1.6 +timestamp: Thu 2009-05-14 19:37:20 +0800 +message: + Fix / tags +------------------------------------------------------------ +revno: 392 +committer: Andrew Psaltis +branch nick: 1.6 +timestamp: Tue 2009-05-12 00:06:38 -0400 +message: + Merged r330 of experimental-nacl. + ------------------------------------------------------------ + revno: 202.2.39 + committer: Andrew Psaltis + branch nick: experimental-nacl + timestamp: Tue 2009-05-12 00:04:43 -0400 + message: + If the screen in wicd-curses is not up and an ui update is requested, abort the + program. + ------------------------------------------------------------ + revno: 202.2.38 + committer: Andrew Psaltis + branch nick: experimental-nacl + timestamp: Mon 2009-05-11 23:52:43 -0400 + message: + Merged with r391 of mainline 1.6. +------------------------------------------------------------ +revno: 391 +committer: Dan O'Reilly +branch nick: experimental +timestamp: Sun 2009-05-10 13:53:54 -0400 +message: + Don't use dbusmanager.DBusException--it doesn't exist. +------------------------------------------------------------ +revno: 390 +committer: Adam Blackburn +branch nick: 1.6 +timestamp: Sun 2009-05-10 22:51:49 +0800 +message: + Made the GUI look better with dark themes +------------------------------------------------------------ +revno: 389 +committer: Adam Blackburn +branch nick: 1.6 +timestamp: Sun 2009-05-10 22:03:52 +0800 +message: + Removed italicized text from the GTK GUI +------------------------------------------------------------ +revno: 388 +committer: Andrew Psaltis +branch nick: 1.6 +timestamp: Sun 2009-05-10 09:51:01 -0400 +message: + Merged with r328 of experimental-nacl. + ------------------------------------------------------------ + revno: 202.2.37 + committer: Andrew Psaltis + branch nick: experimental-nacl + timestamp: Sun 2009-05-10 09:40:38 -0400 + message: + Hopefully fixed bug 355693, related to focus positioning. + ------------------------------------------------------------ + revno: 202.2.36 + committer: Andrew Psaltis + branch nick: experimental-nacl + timestamp: Thu 2009-05-07 00:38:18 -0400 + message: + Redid the decorator to look like the other exception-catching decorators in wicd. + ------------------------------------------------------------ + revno: 202.2.35 + committer: Andrew Psaltis + branch nick: experimental-nacl + timestamp: Thu 2009-05-07 00:37:28 -0400 + message: + Remerge with mainline, doing nothing. + ------------------------------------------------------------ + revno: 202.2.34 + committer: Andrew Psaltis + branch nick: experimental-nacl + timestamp: Thu 2009-05-07 00:30:25 -0400 + message: + Added support for manual distro detection in setup.py. + ------------------------------------------------------------ + revno: 202.2.33 + committer: Andrew Psaltis + branch nick: experimental-nacl + timestamp: Wed 2009-05-06 15:33:12 -0400 + message: + Made scans asynchronous so that users can actually access preferences while the daemon is scanning. + ------------------------------------------------------------ + revno: 202.2.32 + committer: Andrew Psaltis + branch nick: experimental-nacl + timestamp: Wed 2009-05-06 15:19:46 -0400 + message: + Merged r385 of mainline 1.6. + ------------------------------------------------------------ + revno: 202.2.31 + committer: Andrew Psaltis + branch nick: experimental-nacl + timestamp: Sat 2009-05-02 18:45:36 -0400 + message: + Merged r379 of mainline 1.6. +------------------------------------------------------------ +revno: 387 +committer: Dan O'Reilly +branch nick: experimental +timestamp: Sat 2009-05-09 20:53:49 -0400 +message: + Make bitrates regex work when it's the last entry in a cell. +------------------------------------------------------------ +revno: 386 +committer: Andrew Psaltis +branch nick: 1.6 +timestamp: Wed 2009-05-06 18:13:29 -0400 +message: + Fixed missing endquote in wicd-client.py. +------------------------------------------------------------ +revno: 385 +committer: Adam Blackburn +branch nick: 1.6 +timestamp: Tue 2009-05-05 12:56:09 +0800 +message: + Updated translations.py +------------------------------------------------------------ +revno: 384 +committer: Adam Blackburn +branch nick: 1.6 +timestamp: Tue 2009-05-05 12:55:35 +0800 +message: + Added code to debug why pynotify fails +------------------------------------------------------------ +revno: 383 +committer: Adam Blackburn +branch nick: 1.6 +timestamp: Tue 2009-05-05 12:00:22 +0800 +message: + updated CHANGES/NEWS +------------------------------------------------------------ revno: 382 committer: Adam Blackburn branch nick: 1.6 diff --git a/NEWS b/NEWS index e3b0eaf..719fb92 100644 --- a/NEWS +++ b/NEWS @@ -1,19 +1,19 @@ Wicd 1.6.x Branch Major Changes: -- Improved tray icon and gui images (thanks to Martin Sagastume) -- Reorganized network list in the gui for easier navigation +- Improved tray icon and GUI images (thanks to Martin Sagastume) +- Reorganized network list in the GUI for easier navigation - New experimental ioctl backend, which is more cpu-friendly than the previous one - Added a curses client (thanks to Andrew Psaltis) - Added a right-click connection menu to the tray icon -- Added options to specify a dns domain and search domain for static networks +- Added options to specify a DNS domain and search domain for static networks - Reworked the Preferences menu to be more in line with GNOME standards - Added support for global scripts - Made it possible to have optional entries in encryption templates - Added ability to show libnotify notifications on status change -Minor Changes and Other Enchancements: +Minor Changes and Other Enhancements: - Better autoconnection behavior - Tray/GUI will survive the daemon being killed - Reasons for connection failures will now bubble back to the GUI @@ -25,11 +25,11 @@ Minor Changes and Other Enchancements: - Moved scanning to its own thread, which makes GUI and daemon more responsive during scans - Made it possible to specify macros in script entries -- The gui will now display the encryption entry dialog if you attempt to +- The GUI will now display the encryption entry dialog if you attempt to connect to an encrypted network without entering a password - Static gateway entry is now optional - Passwords with leading or trailing whitespace are now stored properly - Many init/config script, man page, and setup.py fixes/updates, including better autodetection of file placement with regard to sleep hooks and - kde autostart files (thanks to Robby Workman) + KDE autostart files (thanks to Robby Workman) diff --git a/setup.py b/setup.py index 6c66449..5f4992c 100755 --- a/setup.py +++ b/setup.py @@ -25,7 +25,7 @@ import subprocess # Be sure to keep this updated! # VERSIONNUMBER -VERSION_NUM = '1.6.0a3' +VERSION_NUM = '1.6.0b1' # REVISION_NUM is automatically updated REVISION_NUM = 'unknown' CURSES_REVNO = 'uimod' From aa6a2d7ec9c06a2fe5042fdde75fbdd7590288c6 Mon Sep 17 00:00:00 2001 From: Andrew Psaltis Date: Fri, 15 May 2009 01:05:04 -0400 Subject: [PATCH 107/186] Added some deactivated options for enabling debug logs. --- curses/wicd-curses.py | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) diff --git a/curses/wicd-curses.py b/curses/wicd-curses.py index 4485fed..34559e4 100755 --- a/curses/wicd-curses.py +++ b/curses/wicd-curses.py @@ -69,6 +69,9 @@ from optparse import OptionParser #from grp import getgrgid #from os import getgroups,system +import logging +import logging.handler + CURSES_REVNO=wpath.curses_revision # Fix strings in wicd-curses @@ -989,7 +992,7 @@ class appGUI(): ######################################## def main(): - global ui + global ui, dlogger # We are _not_ python. misc.RenameProcess('wicd-curses') @@ -1003,6 +1006,11 @@ def main(): import urwid.curses_display ui = urwid.curses_display.Screen() + #if options.debug: + # dlogger = logging.getLogger("Debug") + # dlogger.setLevel(logging.DEBUG) + # dlogger.debug("wicd-curses debug logging started") + # Default Color scheme. # Other potential color schemes can be found at: # http://excess.org/urwid/wiki/RecommendedPalette @@ -1087,10 +1095,12 @@ setup_dbus() ######################################## if __name__ == '__main__': parser = OptionParser(version="wicd-curses-%s (using wicd %s)" % (CURSES_REVNO,daemon.Hello())) - parser.set_defaults(screen='raw') + parser.set_defaults(screen='raw',debug=False) parser.add_option("-r", "--raw-screen",action="store_const",const='raw' ,dest='screen',help="use urwid's raw screen controller (default)") parser.add_option("-c", "--curses-screen",action="store_const",const='curses',dest='screen',help="use urwid's curses screen controller") + parser.add_option("-d", "--debug",action="store_true", + ,dest='debug',help="enable logging of wicd-curses (currently does nothing)") (options,args) = parser.parse_args() main() # Make sure that the terminal does not try to overwrite the last line of From f609ff99fe760a7cb2e026c31251037da0f5ecd1 Mon Sep 17 00:00:00 2001 From: Adam Blackburn Date: Sat, 16 May 2009 20:50:20 +0800 Subject: [PATCH 108/186] Apply .desktop file patch from Debian (remove deprecated encoding line) --- other/wicd-tray.desktop | 1 - setup.py | 1 + 2 files changed, 1 insertion(+), 1 deletion(-) diff --git a/other/wicd-tray.desktop b/other/wicd-tray.desktop index a5f1f6d..d2cc87b 100644 --- a/other/wicd-tray.desktop +++ b/other/wicd-tray.desktop @@ -1,6 +1,5 @@ [Desktop Entry] Categories=Application;Network; -Encoding=UTF-8 Exec=wicd-client GenericName=Network Manager Icon=wicd-client diff --git a/setup.py b/setup.py index 5f4992c..f1cf96b 100755 --- a/setup.py +++ b/setup.py @@ -236,6 +236,7 @@ class configure(Command): self.mandir = '/usr/man/' self.no_install_acpi = True elif self.distro in ['debian']: + self.wicdgroup = "netdev" self.init = '/etc/init.d/' self.initfile = 'init/debian/wicd' elif self.distro in ['arch']: From 51f46c40a18131c1fd24d55cae34909bb71b3b2b Mon Sep 17 00:00:00 2001 From: Robby Workman Date: Tue, 19 May 2009 15:44:52 -0500 Subject: [PATCH 109/186] Make sure the /sys/class/net/whatever is actually a directory in GetWiredInterfaces() (similar to the check in GetWireless) --- wicd/wnettools.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/wicd/wnettools.py b/wicd/wnettools.py index f5d720d..848a4a9 100644 --- a/wicd/wnettools.py +++ b/wicd/wnettools.py @@ -121,8 +121,9 @@ def GetWirelessInterfaces(): def GetWiredInterfaces(): """ Returns a list of wired interfaces on the system. """ basedir = '/sys/class/net/' - return [iface for iface in os.listdir(basedir) if not 'wireless' - in os.listdir(basedir + iface) and + return [iface for iface in os.listdir(basedir) + if os.path.isdir(basedir + iface) and not 'wireless' + in os.listdir(basedir + iface) and open(basedir + iface + "/type").readlines()[0].strip() == "1"] def NeedsExternalCalls(): From d693839013a09ff9402a7b9b0be8c45a37bb8f78 Mon Sep 17 00:00:00 2001 From: Adam Blackburn Date: Wed, 20 May 2009 07:01:31 +0800 Subject: [PATCH 110/186] Changed DHCP client order to dhcpcd -> pump -> dhclient --- setup.py | 4 ++++ wicd/wnettools.py | 12 ++++++------ 2 files changed, 10 insertions(+), 6 deletions(-) diff --git a/setup.py b/setup.py index f1cf96b..041597b 100755 --- a/setup.py +++ b/setup.py @@ -86,6 +86,8 @@ class configure(Command): ('initfilename=', None, "set the name of the init file (don't use)"), ('wicdgroup=', None, "set the name of the group used for wicd"), ('distro=', None, 'set the distribution for which wicd will be installed'), + ('loggroup=', None, 'the group the log file belongs to'), + ('logperms=', None, 'the log file permissions'), # Configure switches ('no-install-init', None, "do not install the init file"), @@ -220,6 +222,8 @@ class configure(Command): self.pidfile = '/var/run/wicd/wicd.pid' self.initfilename = os.path.basename(self.initfile) self.wicdgroup = 'users' + self.loggroup = '' + self.logperms = '0600' def distro_check(self): print "Distro is: "+self.distro diff --git a/wicd/wnettools.py b/wicd/wnettools.py index f5d720d..6cd91d2 100644 --- a/wicd/wnettools.py +++ b/wicd/wnettools.py @@ -213,17 +213,17 @@ class BaseInterface(object): """ def get_client_name(cl): """ Converts the integer value for a dhcp client to a string. """ - if self.dhclient_cmd and cl in [misc.DHCLIENT, misc.AUTO]: - client = "dhclient" - cmd = self.dhclient_cmd - if self.dhclient_needs_verbose: - cmd += ' -v' - elif self.dhcpcd_cmd and cl in [misc.DHCPCD, misc.AUTO]: + if self.dhcpcd_cmd and cl in [misc.DHCPCD, misc.AUTO]: client = "dhcpcd" cmd = self.dhcpcd_cmd elif self.pump_cmd and cl in [misc.PUMP, misc.AUTO]: client = "pump" cmd = self.pump_cmd + elif self.dhclient_cmd and cl in [misc.DHCLIENT, misc.AUTO]: + client = "dhclient" + cmd = self.dhclient_cmd + if self.dhclient_needs_verbose: + cmd += ' -v' else: client = None cmd = "" From 5837a1228ea43dc2ea366195fef667b9f029f35b Mon Sep 17 00:00:00 2001 From: Adam Blackburn Date: Wed, 20 May 2009 07:09:42 +0800 Subject: [PATCH 111/186] changed DHCP client order in preferences dialog --- data/wicd.glade | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/data/wicd.glade b/data/wicd.glade index c42ddb1..258f6b8 100644 --- a/data/wicd.glade +++ b/data/wicd.glade @@ -1138,7 +1138,7 @@ is already active. False - 1 + 3 @@ -1153,7 +1153,7 @@ is already active. False - 2 + 1 @@ -1168,7 +1168,7 @@ is already active. False - 3 + 2 From a886d437b6178a40e8ec1455e14f03ab796180c0 Mon Sep 17 00:00:00 2001 From: Andrew Psaltis Date: Tue, 19 May 2009 21:18:30 -0400 Subject: [PATCH 112/186] Flipped the order of the dhcp clients in the prefs dialog and fixed a syntax error in wicd-curses.py. --- curses/prefs_curses.py | 7 +++++-- curses/wicd-curses.py | 6 +++--- 2 files changed, 8 insertions(+), 5 deletions(-) diff --git a/curses/prefs_curses.py b/curses/prefs_curses.py index d51c61d..43da851 100644 --- a/curses/prefs_curses.py +++ b/curses/prefs_curses.py @@ -177,7 +177,10 @@ class PrefsDialog(urwid.WidgetWrap): self.dhcp_header = urwid.Text(dhcp_header_t) self.dhcp_l = [] - # Automatic + + # Order of these is flipped in the actual interface, + # (2,3,1 -> dhcpcd, pump, dhclient), because dhclient often doesn't like + # to work on several distros. self.dhcp0 = urwid.RadioButton(self.dhcp_l,automatic_t) self.dhcp1 = DynRadioButton(self.dhcp_l,dhcp1_t) self.dhcp2 = DynRadioButton(self.dhcp_l,dhcp2_t) @@ -199,7 +202,7 @@ class PrefsDialog(urwid.WidgetWrap): self.flush_l = [self.flush0,self.flush1,self.flush2] externalLB = urwid.ListBox([self.dhcp_header, - self.dhcp0,self.dhcp1,self.dhcp2,self.dhcp3, + self.dhcp0,self.dhcp2,self.dhcp3,self.dhcp1, _blank, self.wired_detect_header, self.wired0,self.wired1,self.wired2, diff --git a/curses/wicd-curses.py b/curses/wicd-curses.py index 34559e4..93a83b1 100755 --- a/curses/wicd-curses.py +++ b/curses/wicd-curses.py @@ -69,8 +69,8 @@ from optparse import OptionParser #from grp import getgrgid #from os import getgroups,system -import logging -import logging.handler +#import logging +#import logging.handler CURSES_REVNO=wpath.curses_revision @@ -1099,7 +1099,7 @@ if __name__ == '__main__': parser.add_option("-r", "--raw-screen",action="store_const",const='raw' ,dest='screen',help="use urwid's raw screen controller (default)") parser.add_option("-c", "--curses-screen",action="store_const",const='curses',dest='screen',help="use urwid's curses screen controller") - parser.add_option("-d", "--debug",action="store_true", + parser.add_option("-d", "--debug",action="store_true" ,dest='debug',help="enable logging of wicd-curses (currently does nothing)") (options,args) = parser.parse_args() main() From c66383903d0883f86ddabcdda7ef9b7645a298eb Mon Sep 17 00:00:00 2001 From: Andrew Psaltis Date: Tue, 19 May 2009 21:20:29 -0400 Subject: [PATCH 113/186] Added wrap_exceptions to wicd-curses.py's run() function. --- curses/wicd-curses.py | 1 + 1 file changed, 1 insertion(+) diff --git a/curses/wicd-curses.py b/curses/wicd-curses.py index 93a83b1..4bc7b06 100755 --- a/curses/wicd-curses.py +++ b/curses/wicd-curses.py @@ -1041,6 +1041,7 @@ def main(): urwid.set_encoding('utf8') ui.run_wrapper(run) +@wrap_exceptions def run(): global loop loop = gobject.MainLoop() From b1933987d7fb29d4d52498dd7ccb6c1c57e0f94f Mon Sep 17 00:00:00 2001 From: Robby Workman Date: Thu, 21 May 2009 10:12:03 -0500 Subject: [PATCH 114/186] Clarify intent of INSTALL with respect to pm-utils version. --- INSTALL | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/INSTALL b/INSTALL index f29b3f0..9c3a257 100644 --- a/INSTALL +++ b/INSTALL @@ -10,7 +10,9 @@ are a few dependencies: 6. a graphical sudo application (gksu, kdesu, and ktsuss are supported), while optional, is strongly recommended 7. urwid (if you want to use the curses client - needs version >=0.9.8.3) - 8. pm-utils (optional for suspend/resume integration - needs version >=1.2.4) + 8. pm-utils (optional for suspend/resume integration) + Wicd supports using versions >=1.2.4 -- earlier versions may work just + fine, but they are completely unsupported here. If you are installing from a bzr pull and you want the native language translations, first run this: From bb7563a4af4f4114a087456fb02812177c76dd1f Mon Sep 17 00:00:00 2001 From: Adam Blackburn Date: Fri, 22 May 2009 11:29:12 +0800 Subject: [PATCH 115/186] Buttons are now activated correctly when using the keyboard --- wicd/gui.py | 18 +++++++++--------- wicd/netentry.py | 4 ++-- 2 files changed, 11 insertions(+), 11 deletions(-) diff --git a/wicd/gui.py b/wicd/gui.py index 3971c42..00d9c0a 100644 --- a/wicd/gui.py +++ b/wicd/gui.py @@ -511,11 +511,11 @@ class appGui(object): printLine = True # In this case we print a separator. wirednet = WiredNetworkEntry() self.network_list.pack_start(wirednet, False, False) - wirednet.connect_button.connect("button-press-event", self.connect, + wirednet.connect_button.connect("clicked", self.connect, "wired", 0, wirednet) - wirednet.disconnect_button.connect("button-press-event", self.disconnect, + wirednet.disconnect_button.connect("clicked", self.disconnect, "wired", 0, wirednet) - wirednet.advanced_button.connect("button-press-event", + wirednet.advanced_button.connect("clicked", self.edit_advanced, "wired", 0, wirednet) @@ -533,13 +533,13 @@ class appGui(object): printLine = True tempnet = WirelessNetworkEntry(x) self.network_list.pack_start(tempnet, False, False) - tempnet.connect_button.connect("button-press-event", + tempnet.connect_button.connect("clicked", self.connect, "wireless", x, tempnet) - tempnet.disconnect_button.connect("button-press-event", + tempnet.disconnect_button.connect("clicked", self.disconnect, "wireless", x, tempnet) - tempnet.advanced_button.connect("button-press-event", + tempnet.advanced_button.connect("clicked", self.edit_advanced, "wireless", x, tempnet) else: @@ -598,7 +598,7 @@ class appGui(object): return True - def edit_advanced(self, widget, event, ttype, networkid, networkentry): + def edit_advanced(self, widget, ttype, networkid, networkentry): """ Display the advanced settings dialog. Displays the advanced settings dialog and saves any changes made. @@ -649,7 +649,7 @@ class appGui(object): return False return True - def connect(self, widget, event, nettype, networkid, networkentry): + def connect(self, widget, nettype, networkid, networkentry): """ Initiates the connection process in the daemon. """ cancel_button = self.wTree.get_widget("cancel_button") cancel_button.set_sensitive(True) @@ -663,7 +663,7 @@ class appGui(object): wired.ConnectWired() self.update_statusbar() - def disconnect(self, widget, event, nettype, networkid, networkentry): + def disconnect(self, widget, nettype, networkid, networkentry): """ Disconnects from the given network. Keyword arguments: diff --git a/wicd/netentry.py b/wicd/netentry.py index 3df4f77..296fd46 100644 --- a/wicd/netentry.py +++ b/wicd/netentry.py @@ -238,7 +238,7 @@ class WiredSettingsDialog(AdvancedSettingsDialog): """ Build the wired settings dialog. """ AdvancedSettingsDialog.__init__(self) self.des = self.connect("destroy", self.destroy_called) - self.script_button.connect("button-press-event", self.edit_scripts) + self.script_button.connect("clicked", self.edit_scripts) self.prof_name = name def set_net_prop(self, option, value): @@ -335,7 +335,7 @@ class WirelessSettingsDialog(AdvancedSettingsDialog): # Connect signals. self.chkbox_encryption.connect("toggled", self.toggle_encryption) self.combo_encryption.connect("changed", self.change_encrypt_method) - self.script_button.connect("button-press-event", self.edit_scripts) + self.script_button.connect("clicked", self.edit_scripts) self.des = self.connect("destroy", self.destroy_called) def destroy_called(self, *args): From df065dc997979a3c74eb2e32005c68536afb1eb4 Mon Sep 17 00:00:00 2001 From: Dan O'Reilly Date: Fri, 22 May 2009 15:33:03 -0400 Subject: [PATCH 116/186] - Make the GUI behave better when a disconnect button is pushed. - Move some of the libnotify logic to guiutil.py and add support for displaying some error messages in a libnotify pop-up. - Apply some patches provided by sunseraph. Tweak to the channel regex and checking for a valid AP bssid when monitoring a wireless connection. Set essid, bssid, and channel in separate calls to iwconfig. - Add caching for ifconfig and iwconfig results in wnettools.py. That way we're not needlessly calling the same command a bunch of times in a short period of time (2 seconds). This removes the need for us to pass around iwconfig/ifconfig output elsewhere, though I've left it in for now. - Remove unneeded BackendManager instance from networking.py --- wicd/gui.py | 43 +++++++++++++++++++---- wicd/guiutil.py | 28 +++++++++++++++ wicd/misc.py | 2 +- wicd/monitor.py | 3 ++ wicd/networking.py | 1 - wicd/translations.py | 3 +- wicd/wicd-client.py | 24 ++++--------- wicd/wicd-daemon.py | 5 +++ wicd/wnettools.py | 81 ++++++++++++++++++++++++++++---------------- 9 files changed, 134 insertions(+), 56 deletions(-) diff --git a/wicd/gui.py b/wicd/gui.py index 00d9c0a..f49c3f9 100644 --- a/wicd/gui.py +++ b/wicd/gui.py @@ -286,7 +286,11 @@ class appGui(object): def disconnect_all(self, widget=None): """ Disconnects from any active network. """ - daemon.Disconnect() + def handler(*args): + gobject.idle_add(self.network_list.set_sensitive, True) + + self.network_list.set_sensitive(False) + daemon.Disconnect(reply_handler=handler, error_handler=handler) def about_dialog(self, widget, event=None): """ Displays an about dialog. """ @@ -649,19 +653,41 @@ class appGui(object): return False return True + def _wait_for_connect_thread_start(self): + self.wTree.get_widget("progressbar").pulse() + if not self._connect_thread_started: + return True + else: + misc.timeout_add(2, self.update_statusbar) + self.update_statusbar() + return False + def connect(self, widget, nettype, networkid, networkentry): """ Initiates the connection process in the daemon. """ + def handler(*args): + self._connect_thread_started = True + cancel_button = self.wTree.get_widget("cancel_button") cancel_button.set_sensitive(True) + self.network_list.set_sensitive(False) + if self.statusID: + gobject.idle_add(self.status_bar.remove, 1, self.statusID) + gobject.idle_add(self.set_status, language["disconnecting_active"]) + gobject.idle_add(self.status_area.show_all) + self.wait_for_events() + self._connect_thread_started = False if nettype == "wireless": if not self.check_encryption_valid(networkid, networkentry.advanced_dialog): self.edit_advanced(None, None, nettype, networkid, networkentry) return False - wireless.ConnectWireless(networkid) + wireless.ConnectWireless(networkid, reply_handler=handler, + error_handler=handler) elif nettype == "wired": - wired.ConnectWired() - self.update_statusbar() + wired.ConnectWired(reply_handler=handler, error_handler=handler) + + gobject.source_remove(self.update_cb) + misc.timeout_add(100, self._wait_for_connect_thread_start, milli=True) def disconnect(self, widget, nettype, networkid, networkentry): """ Disconnects from the given network. @@ -674,13 +700,18 @@ class appGui(object): networkentry -- The NetworkEntry containing the disconnect button. """ + def handler(*args): + gobject.idle_add(self.network_list.set_sensitive, True) + widget.hide() networkentry.connect_button.show() daemon.SetForcedDisconnect(True) + self.network_list.set_sensitive(False) if nettype == "wired": - wired.DisconnectWired() + wired.DisconnectWired(reply_handler=handler, error_handler=handler) else: - wireless.DisconnectWireless() + wireless.DisconnectWireless(reply_handler=handler, + error_handler=handler) def wait_for_events(self, amt=0): """ Wait for any pending gtk events to finish before moving on. diff --git a/wicd/guiutil.py b/wicd/guiutil.py index 169dcc8..6d103b9 100644 --- a/wicd/guiutil.py +++ b/wicd/guiutil.py @@ -17,11 +17,39 @@ # import gtk +import os.path +import wpath + +HAS_NOTIFY = True +try: + import pynotify + if not pynotify.init("Wicd"): + print 'Could not initalize pynotify' + HAS_NOTIFY = False +except ImportError: + print "Importing pynotify failed, notifications disabled." + HAS_NOTIFY = False + +print "Has notifications support", HAS_NOTIFY + +if wpath.no_use_notifications: + print 'Notifications disabled during setup.py configure' + +def can_use_notify(): + use_notify = os.path.exists(os.path.join(os.path.expanduser('~/.wicd'), + 'USE_NOTIFICATIONS') + ) + return use_notify and HAS_NOTIFY and not wpath.no_use_notifications + def error(parent, message, block=True): """ Shows an error dialog. """ def delete_event(dialog, id): dialog.destroy() + if can_use_notify() and not block: + notification = pynotify.Notification("ERROR", message, "error") + notification.show() + return dialog = gtk.MessageDialog(parent, gtk.DIALOG_MODAL, gtk.MESSAGE_ERROR, gtk.BUTTONS_OK) dialog.set_markup(message) diff --git a/wicd/misc.py b/wicd/misc.py index b5600b2..2dde1d4 100644 --- a/wicd/misc.py +++ b/wicd/misc.py @@ -492,7 +492,7 @@ def stringToNone(text): def checkboxTextboxToggle(checkbox, textboxes): for textbox in textboxes: textbox.set_sensitive(checkbox.get_active()) - + def threaded(f): """ A decorator that will make any function run in a new thread. """ diff --git a/wicd/monitor.py b/wicd/monitor.py index 4accb0e..2937360 100755 --- a/wicd/monitor.py +++ b/wicd/monitor.py @@ -174,6 +174,9 @@ class ConnectionStatus(object): self.iwconfig = '' # Reset this, just in case. self.tried_reconnect = False + bssid = wireless.GetApBssid() + if not bssid: + return False wifi_signal = self._get_printable_sig_strength() if wifi_signal == 0: diff --git a/wicd/networking.py b/wicd/networking.py index 6d439d8..8eaa454 100644 --- a/wicd/networking.py +++ b/wicd/networking.py @@ -154,7 +154,6 @@ class Controller(object): self.disconnect_script = None self.driver = None self.iface = None - self.backend_manager = BackendManager() def get_debug(self): return self._debug def set_debug(self, value): diff --git a/wicd/translations.py b/wicd/translations.py index e5e72f1..948b26d 100644 --- a/wicd/translations.py +++ b/wicd/translations.py @@ -55,7 +55,7 @@ def get_gettext(): _ = lang.gettext return _ -# Generated automatically on Mon, 04 May 2009 23:56:04 CDT +# Generated automatically on Sun, 17 May 2009 19:17:27 CDT _ = get_gettext() language = {} language['resetting_ip_address'] = _('''Resetting IP address...''') @@ -215,3 +215,4 @@ language['disconnected'] = _('''Disconnected''') language['establishing_connection'] = _('''Establishing connection...''') language['association_failed'] = _('''Connection failed: Could not contact the wireless access point.''') language['access_denied'] = _('''Unable to contact the wicd dameon due to an access denied error from DBus. Please check your DBus configuration.''') +language['disconnecting_active'] = _('''Disconnecting active connections...''') diff --git a/wicd/wicd-client.py b/wicd/wicd-client.py index 4934215..97f3095 100755 --- a/wicd/wicd-client.py +++ b/wicd/wicd-client.py @@ -43,16 +43,15 @@ import pango import atexit from dbus import DBusException +import pygtk +pygtk.require('2.0') + HAS_NOTIFY = True try: - import pygtk - pygtk.require('2.0') import pynotify if not pynotify.init("Wicd"): - print 'could not initalize pynotify' HAS_NOTIFY = False except ImportError: - print 'import failed' HAS_NOTIFY = False # Wicd specific imports @@ -60,7 +59,7 @@ from wicd import wpath from wicd import misc from wicd import gui from wicd import dbusmanager -from wicd.guiutil import error +from wicd.guiutil import error, can_use_notify from wicd.translations import language @@ -75,11 +74,6 @@ if not hasattr(gtk, "StatusIcon"): print 'Unable to load tray icon: Missing both egg.trayicon and gtk.StatusIcon modules.' ICON_AVAIL = False -print "Has notifications support", HAS_NOTIFY - -if wpath.no_use_notifications: - print 'Notifications disabled during setup.py configure' - misc.RenameProcess("wicd-client") if __name__ == '__main__': @@ -163,10 +157,6 @@ class TrayIcon(object): self.last_state = None self.should_notify = True - self.use_notify = os.path.exists(os.path.join( - os.path.expanduser('~/.wicd'), - 'USE_NOTIFICATIONS')) - if DBUS_AVAIL: self.update_tray_icon() else: @@ -272,10 +262,8 @@ class TrayIcon(object): [state, info] = daemon.GetConnectionStatus() # should this state change display a notification? - self.should_notify = not wpath.no_use_notifications and \ - (self.last_state != state) and \ - HAS_NOTIFY and \ - self.use_notify + self.should_notify = (can_use_notify() and + self.last_state != state) self.last_state = state diff --git a/wicd/wicd-daemon.py b/wicd/wicd-daemon.py index e0230d9..4b72e99 100644 --- a/wicd/wicd-daemon.py +++ b/wicd/wicd-daemon.py @@ -1300,6 +1300,7 @@ class WiredDaemon(dbus.service.Object): self.daemon = daemon self.wired = wired self._debug_mode = debug + self._cur_wired_prof_name = "" self.WiredNetwork = {} self.config = ConfigManager(os.path.join(wpath.etc, "wired-settings.conf"), @@ -1413,6 +1414,8 @@ class WiredDaemon(dbus.service.Object): self.wired.disconnect_script = self.GetWiredProperty("disconnectscript") self.daemon.wireless_bus.wifi.Disconnect() self.daemon.SetForcedDisconnect(False) + self.UnsetWiredLastUsed() + self.config.set(self._cur_wired_prof_name, "lastused", True, write=True) self.wired.Connect(self.WiredNetwork, debug=self.debug_mode) self.daemon.UpdateState() @@ -1511,8 +1514,10 @@ class WiredDaemon(dbus.service.Object): profile['use_global_dns'] = bool(profile.get('use_global_dns')) profile['use_static_dns'] = bool(profile.get('use_static_dns')) self.WiredNetwork = profile + self._cur_wired_prof_name = profilename return "100: Loaded Profile" else: + self._cur_wired_prof_name = "" self.WiredNetwork = {} return "500: Profile Not Found" diff --git a/wicd/wnettools.py b/wicd/wnettools.py index 317424a..113015f 100644 --- a/wicd/wnettools.py +++ b/wicd/wnettools.py @@ -44,7 +44,7 @@ from misc import find_path _re_mode = (re.I | re.M | re.S) essid_pattern = re.compile('.*ESSID:"?(.*?)"?\s*\n', _re_mode) ap_mac_pattern = re.compile('.*Address: (.*?)\n', _re_mode) -channel_pattern = re.compile('.*Channel:? ?(\d\d?)', _re_mode) +channel_pattern = re.compile('.*Channel:?=? ?(\d\d?)', _re_mode) strength_pattern = re.compile('.*Quality:?=? ?(\d+)\s*/?\s*(\d*)', _re_mode) altstrength_pattern = re.compile('.*Signal level:?=? ?(\d+)\s*/?\s*(\d*)', _re_mode) signaldbm_pattern = re.compile('.*Signal level:?=? ?(-\d\d*)', _re_mode) @@ -83,6 +83,31 @@ def _sanitize_string_strict(string): return translate(str(string), blank_trans, blacklist_strict) else: return string + +_cache = {} +def timedcache(duration=5): + """ A caching decorator for use with wnettools methods. + + Caches the results of a function for a given number of + seconds (defaults to 5). + + """ + def _timedcache(f): + def __timedcache(self, *args, **kwargs): + key = str(args) + str(kwargs) + str(f) + if hasattr(self, 'iface'): + key += self.iface + if (key in _cache and + (time.time() - _cache[key]['time']) < duration): + return _cache[key]['value'] + else: + value = f(self, *args, **kwargs) + _cache[key] = { 'time' : time.time(), 'value' : value } + return value + + return __timedcache + + return _timedcache def GetDefaultGateway(): """ Attempts to determine the default gateway by parsing route -n. """ @@ -349,6 +374,14 @@ class BaseInterface(object): if self.verbose: print cmd misc.Run(cmd) return True + + @timedcache(2) + @neediface("") + def GetIfconfig(self): + """ Runs ifconfig and returns the output. """ + cmd = "ifconfig %s" % self.iface + if self.verbose: print cmd + return misc.Run(cmd) @neediface("") def SetAddress(self, ip=None, netmask=None, broadcast=None): @@ -596,9 +629,7 @@ class BaseInterface(object): """ if not ifconfig: - cmd = 'ifconfig ' + self.iface - if self.verbose: print cmd - output = misc.Run(cmd) + output = self.GetIfconfig() else: output = ifconfig return misc.RunRegex(ip_pattern, output) @@ -635,9 +666,7 @@ class BaseInterface(object): def _slow_is_up(self, ifconfig=None): """ Determine if an interface is up using ifconfig. """ if not ifconfig: - cmd = "ifconfig " + self.iface - if self.verbose: print cmd - output = misc.Run(cmd) + output = self.GetIfconfig() else: output = ifconfig lines = output.split('\n') @@ -800,6 +829,7 @@ class BaseWirelessInterface(BaseInterface): return radiostatus + @timedcache(2) @neediface(False) def GetIwconfig(self): """ Returns the output of iwconfig for this interface. """ @@ -965,12 +995,17 @@ class BaseWirelessInterface(BaseInterface): """ cmd = ['iwconfig', self.iface, 'essid', essid] - if channel and str(channel).isdigit(): - cmd.extend(['channel', str(channel)]) - if bssid: - cmd.extend(['ap', bssid]) if self.verbose: print str(cmd) misc.Run(cmd) + base = "iwconfig %s" % self.iface + if channel and str(channel).isdigit(): + cmd = "%s channel %s" % (base, str(channel)) + if self.verbose: print cmd + misc.Run(cmd) + if bssid: + cmd = "%s ap %s" % (base, bssid) + if self.verbose: print cmd + misc.Run(cmd) def GeneratePSK(self, network): """ Generate a PSK using wpa_passphrase. @@ -1237,9 +1272,7 @@ class BaseWirelessInterface(BaseInterface): def GetBSSID(self, iwconfig=None): """ Get the MAC address for the interface. """ if not iwconfig: - cmd = 'iwconfig ' + self.iface - if self.verbose: print cmd - output = misc.Run(cmd) + output = self.GetIwconfig() else: output = iwconfig @@ -1250,9 +1283,7 @@ class BaseWirelessInterface(BaseInterface): def GetCurrentBitrate(self, iwconfig=None): """ Get the current bitrate for the interface. """ if not iwconfig: - cmd = 'iwconfig ' + self.iface - if self.verbose: print cmd - output = misc.Run(cmd) + output = self.GetIwconfig() else: output = iwconfig @@ -1263,9 +1294,7 @@ class BaseWirelessInterface(BaseInterface): def GetOperationalMode(self, iwconfig=None): """ Get the operational mode for the interface. """ if not iwconfig: - cmd = 'iwconfig ' + self.iface - if self.verbose: print cmd - output = misc.Run(cmd) + output = self.GetIwconfig() else: output = iwconfig @@ -1313,9 +1342,7 @@ class BaseWirelessInterface(BaseInterface): """ if not iwconfig: - cmd = 'iwconfig ' + self.iface - if self.verbose: print cmd - output = misc.Run(cmd) + output = self.GetIwconfig() else: output = iwconfig return self._get_link_quality(output) @@ -1329,9 +1356,7 @@ class BaseWirelessInterface(BaseInterface): """ if not iwconfig: - cmd = 'iwconfig ' + self.iface - if self.verbose: print cmd - output = misc.Run(cmd) + output = self.GetIwconfig() else: output = iwconfig signaldbm_pattern = re.compile('.*Signal level:?=? ?(-\d\d*)', @@ -1348,9 +1373,7 @@ class BaseWirelessInterface(BaseInterface): """ if not iwconfig: - cmd = 'iwconfig ' + self.iface - if self.verbose: print cmd - output = misc.Run(cmd) + output = self.GetIwconfig() else: output = iwconfig network = misc.RunRegex(re.compile('.*ESSID:"(.*?)"', From c334cac1c81d1ff8f8c6ab8b9db6bbc4d9a7f271 Mon Sep 17 00:00:00 2001 From: Dan O'Reilly Date: Fri, 22 May 2009 15:40:35 -0400 Subject: [PATCH 117/186] - Make the GUI behave better when a disconnect button is pushed. - Move some of the libnotify logic to guiutil.py and add support for displaying some error messages in a libnotify pop-up. - Apply some patches provided by sunseraph. Tweak to the channel regex and checking for a valid AP bssid when monitoring a wireless connection. Set essid, bssid, and channel in separate calls to iwconfig. - Add caching for ifconfig and iwconfig results in wnettools.py. That way we're not needlessly calling the same command a bunch of times in a short period of time (2 seconds). This removes the need for us to pass around iwconfig/ifconfig output elsewhere, though I've left it in for now. - Remove unneeded BackendManager instance from networking.py - Fix last used wired networking autoconnection method --- wicd/gui.py | 43 +++++++++++++++++++---- wicd/guiutil.py | 28 +++++++++++++++ wicd/misc.py | 2 +- wicd/monitor.py | 3 ++ wicd/networking.py | 1 - wicd/translations.py | 3 +- wicd/wicd-client.py | 24 ++++--------- wicd/wicd-daemon.py | 5 +++ wicd/wnettools.py | 81 ++++++++++++++++++++++++++++---------------- 9 files changed, 134 insertions(+), 56 deletions(-) diff --git a/wicd/gui.py b/wicd/gui.py index 00d9c0a..f49c3f9 100644 --- a/wicd/gui.py +++ b/wicd/gui.py @@ -286,7 +286,11 @@ class appGui(object): def disconnect_all(self, widget=None): """ Disconnects from any active network. """ - daemon.Disconnect() + def handler(*args): + gobject.idle_add(self.network_list.set_sensitive, True) + + self.network_list.set_sensitive(False) + daemon.Disconnect(reply_handler=handler, error_handler=handler) def about_dialog(self, widget, event=None): """ Displays an about dialog. """ @@ -649,19 +653,41 @@ class appGui(object): return False return True + def _wait_for_connect_thread_start(self): + self.wTree.get_widget("progressbar").pulse() + if not self._connect_thread_started: + return True + else: + misc.timeout_add(2, self.update_statusbar) + self.update_statusbar() + return False + def connect(self, widget, nettype, networkid, networkentry): """ Initiates the connection process in the daemon. """ + def handler(*args): + self._connect_thread_started = True + cancel_button = self.wTree.get_widget("cancel_button") cancel_button.set_sensitive(True) + self.network_list.set_sensitive(False) + if self.statusID: + gobject.idle_add(self.status_bar.remove, 1, self.statusID) + gobject.idle_add(self.set_status, language["disconnecting_active"]) + gobject.idle_add(self.status_area.show_all) + self.wait_for_events() + self._connect_thread_started = False if nettype == "wireless": if not self.check_encryption_valid(networkid, networkentry.advanced_dialog): self.edit_advanced(None, None, nettype, networkid, networkentry) return False - wireless.ConnectWireless(networkid) + wireless.ConnectWireless(networkid, reply_handler=handler, + error_handler=handler) elif nettype == "wired": - wired.ConnectWired() - self.update_statusbar() + wired.ConnectWired(reply_handler=handler, error_handler=handler) + + gobject.source_remove(self.update_cb) + misc.timeout_add(100, self._wait_for_connect_thread_start, milli=True) def disconnect(self, widget, nettype, networkid, networkentry): """ Disconnects from the given network. @@ -674,13 +700,18 @@ class appGui(object): networkentry -- The NetworkEntry containing the disconnect button. """ + def handler(*args): + gobject.idle_add(self.network_list.set_sensitive, True) + widget.hide() networkentry.connect_button.show() daemon.SetForcedDisconnect(True) + self.network_list.set_sensitive(False) if nettype == "wired": - wired.DisconnectWired() + wired.DisconnectWired(reply_handler=handler, error_handler=handler) else: - wireless.DisconnectWireless() + wireless.DisconnectWireless(reply_handler=handler, + error_handler=handler) def wait_for_events(self, amt=0): """ Wait for any pending gtk events to finish before moving on. diff --git a/wicd/guiutil.py b/wicd/guiutil.py index 169dcc8..6d103b9 100644 --- a/wicd/guiutil.py +++ b/wicd/guiutil.py @@ -17,11 +17,39 @@ # import gtk +import os.path +import wpath + +HAS_NOTIFY = True +try: + import pynotify + if not pynotify.init("Wicd"): + print 'Could not initalize pynotify' + HAS_NOTIFY = False +except ImportError: + print "Importing pynotify failed, notifications disabled." + HAS_NOTIFY = False + +print "Has notifications support", HAS_NOTIFY + +if wpath.no_use_notifications: + print 'Notifications disabled during setup.py configure' + +def can_use_notify(): + use_notify = os.path.exists(os.path.join(os.path.expanduser('~/.wicd'), + 'USE_NOTIFICATIONS') + ) + return use_notify and HAS_NOTIFY and not wpath.no_use_notifications + def error(parent, message, block=True): """ Shows an error dialog. """ def delete_event(dialog, id): dialog.destroy() + if can_use_notify() and not block: + notification = pynotify.Notification("ERROR", message, "error") + notification.show() + return dialog = gtk.MessageDialog(parent, gtk.DIALOG_MODAL, gtk.MESSAGE_ERROR, gtk.BUTTONS_OK) dialog.set_markup(message) diff --git a/wicd/misc.py b/wicd/misc.py index b5600b2..2dde1d4 100644 --- a/wicd/misc.py +++ b/wicd/misc.py @@ -492,7 +492,7 @@ def stringToNone(text): def checkboxTextboxToggle(checkbox, textboxes): for textbox in textboxes: textbox.set_sensitive(checkbox.get_active()) - + def threaded(f): """ A decorator that will make any function run in a new thread. """ diff --git a/wicd/monitor.py b/wicd/monitor.py index 4accb0e..2937360 100755 --- a/wicd/monitor.py +++ b/wicd/monitor.py @@ -174,6 +174,9 @@ class ConnectionStatus(object): self.iwconfig = '' # Reset this, just in case. self.tried_reconnect = False + bssid = wireless.GetApBssid() + if not bssid: + return False wifi_signal = self._get_printable_sig_strength() if wifi_signal == 0: diff --git a/wicd/networking.py b/wicd/networking.py index 6d439d8..8eaa454 100644 --- a/wicd/networking.py +++ b/wicd/networking.py @@ -154,7 +154,6 @@ class Controller(object): self.disconnect_script = None self.driver = None self.iface = None - self.backend_manager = BackendManager() def get_debug(self): return self._debug def set_debug(self, value): diff --git a/wicd/translations.py b/wicd/translations.py index e5e72f1..948b26d 100644 --- a/wicd/translations.py +++ b/wicd/translations.py @@ -55,7 +55,7 @@ def get_gettext(): _ = lang.gettext return _ -# Generated automatically on Mon, 04 May 2009 23:56:04 CDT +# Generated automatically on Sun, 17 May 2009 19:17:27 CDT _ = get_gettext() language = {} language['resetting_ip_address'] = _('''Resetting IP address...''') @@ -215,3 +215,4 @@ language['disconnected'] = _('''Disconnected''') language['establishing_connection'] = _('''Establishing connection...''') language['association_failed'] = _('''Connection failed: Could not contact the wireless access point.''') language['access_denied'] = _('''Unable to contact the wicd dameon due to an access denied error from DBus. Please check your DBus configuration.''') +language['disconnecting_active'] = _('''Disconnecting active connections...''') diff --git a/wicd/wicd-client.py b/wicd/wicd-client.py index 4934215..97f3095 100755 --- a/wicd/wicd-client.py +++ b/wicd/wicd-client.py @@ -43,16 +43,15 @@ import pango import atexit from dbus import DBusException +import pygtk +pygtk.require('2.0') + HAS_NOTIFY = True try: - import pygtk - pygtk.require('2.0') import pynotify if not pynotify.init("Wicd"): - print 'could not initalize pynotify' HAS_NOTIFY = False except ImportError: - print 'import failed' HAS_NOTIFY = False # Wicd specific imports @@ -60,7 +59,7 @@ from wicd import wpath from wicd import misc from wicd import gui from wicd import dbusmanager -from wicd.guiutil import error +from wicd.guiutil import error, can_use_notify from wicd.translations import language @@ -75,11 +74,6 @@ if not hasattr(gtk, "StatusIcon"): print 'Unable to load tray icon: Missing both egg.trayicon and gtk.StatusIcon modules.' ICON_AVAIL = False -print "Has notifications support", HAS_NOTIFY - -if wpath.no_use_notifications: - print 'Notifications disabled during setup.py configure' - misc.RenameProcess("wicd-client") if __name__ == '__main__': @@ -163,10 +157,6 @@ class TrayIcon(object): self.last_state = None self.should_notify = True - self.use_notify = os.path.exists(os.path.join( - os.path.expanduser('~/.wicd'), - 'USE_NOTIFICATIONS')) - if DBUS_AVAIL: self.update_tray_icon() else: @@ -272,10 +262,8 @@ class TrayIcon(object): [state, info] = daemon.GetConnectionStatus() # should this state change display a notification? - self.should_notify = not wpath.no_use_notifications and \ - (self.last_state != state) and \ - HAS_NOTIFY and \ - self.use_notify + self.should_notify = (can_use_notify() and + self.last_state != state) self.last_state = state diff --git a/wicd/wicd-daemon.py b/wicd/wicd-daemon.py index e0230d9..4b72e99 100644 --- a/wicd/wicd-daemon.py +++ b/wicd/wicd-daemon.py @@ -1300,6 +1300,7 @@ class WiredDaemon(dbus.service.Object): self.daemon = daemon self.wired = wired self._debug_mode = debug + self._cur_wired_prof_name = "" self.WiredNetwork = {} self.config = ConfigManager(os.path.join(wpath.etc, "wired-settings.conf"), @@ -1413,6 +1414,8 @@ class WiredDaemon(dbus.service.Object): self.wired.disconnect_script = self.GetWiredProperty("disconnectscript") self.daemon.wireless_bus.wifi.Disconnect() self.daemon.SetForcedDisconnect(False) + self.UnsetWiredLastUsed() + self.config.set(self._cur_wired_prof_name, "lastused", True, write=True) self.wired.Connect(self.WiredNetwork, debug=self.debug_mode) self.daemon.UpdateState() @@ -1511,8 +1514,10 @@ class WiredDaemon(dbus.service.Object): profile['use_global_dns'] = bool(profile.get('use_global_dns')) profile['use_static_dns'] = bool(profile.get('use_static_dns')) self.WiredNetwork = profile + self._cur_wired_prof_name = profilename return "100: Loaded Profile" else: + self._cur_wired_prof_name = "" self.WiredNetwork = {} return "500: Profile Not Found" diff --git a/wicd/wnettools.py b/wicd/wnettools.py index 317424a..113015f 100644 --- a/wicd/wnettools.py +++ b/wicd/wnettools.py @@ -44,7 +44,7 @@ from misc import find_path _re_mode = (re.I | re.M | re.S) essid_pattern = re.compile('.*ESSID:"?(.*?)"?\s*\n', _re_mode) ap_mac_pattern = re.compile('.*Address: (.*?)\n', _re_mode) -channel_pattern = re.compile('.*Channel:? ?(\d\d?)', _re_mode) +channel_pattern = re.compile('.*Channel:?=? ?(\d\d?)', _re_mode) strength_pattern = re.compile('.*Quality:?=? ?(\d+)\s*/?\s*(\d*)', _re_mode) altstrength_pattern = re.compile('.*Signal level:?=? ?(\d+)\s*/?\s*(\d*)', _re_mode) signaldbm_pattern = re.compile('.*Signal level:?=? ?(-\d\d*)', _re_mode) @@ -83,6 +83,31 @@ def _sanitize_string_strict(string): return translate(str(string), blank_trans, blacklist_strict) else: return string + +_cache = {} +def timedcache(duration=5): + """ A caching decorator for use with wnettools methods. + + Caches the results of a function for a given number of + seconds (defaults to 5). + + """ + def _timedcache(f): + def __timedcache(self, *args, **kwargs): + key = str(args) + str(kwargs) + str(f) + if hasattr(self, 'iface'): + key += self.iface + if (key in _cache and + (time.time() - _cache[key]['time']) < duration): + return _cache[key]['value'] + else: + value = f(self, *args, **kwargs) + _cache[key] = { 'time' : time.time(), 'value' : value } + return value + + return __timedcache + + return _timedcache def GetDefaultGateway(): """ Attempts to determine the default gateway by parsing route -n. """ @@ -349,6 +374,14 @@ class BaseInterface(object): if self.verbose: print cmd misc.Run(cmd) return True + + @timedcache(2) + @neediface("") + def GetIfconfig(self): + """ Runs ifconfig and returns the output. """ + cmd = "ifconfig %s" % self.iface + if self.verbose: print cmd + return misc.Run(cmd) @neediface("") def SetAddress(self, ip=None, netmask=None, broadcast=None): @@ -596,9 +629,7 @@ class BaseInterface(object): """ if not ifconfig: - cmd = 'ifconfig ' + self.iface - if self.verbose: print cmd - output = misc.Run(cmd) + output = self.GetIfconfig() else: output = ifconfig return misc.RunRegex(ip_pattern, output) @@ -635,9 +666,7 @@ class BaseInterface(object): def _slow_is_up(self, ifconfig=None): """ Determine if an interface is up using ifconfig. """ if not ifconfig: - cmd = "ifconfig " + self.iface - if self.verbose: print cmd - output = misc.Run(cmd) + output = self.GetIfconfig() else: output = ifconfig lines = output.split('\n') @@ -800,6 +829,7 @@ class BaseWirelessInterface(BaseInterface): return radiostatus + @timedcache(2) @neediface(False) def GetIwconfig(self): """ Returns the output of iwconfig for this interface. """ @@ -965,12 +995,17 @@ class BaseWirelessInterface(BaseInterface): """ cmd = ['iwconfig', self.iface, 'essid', essid] - if channel and str(channel).isdigit(): - cmd.extend(['channel', str(channel)]) - if bssid: - cmd.extend(['ap', bssid]) if self.verbose: print str(cmd) misc.Run(cmd) + base = "iwconfig %s" % self.iface + if channel and str(channel).isdigit(): + cmd = "%s channel %s" % (base, str(channel)) + if self.verbose: print cmd + misc.Run(cmd) + if bssid: + cmd = "%s ap %s" % (base, bssid) + if self.verbose: print cmd + misc.Run(cmd) def GeneratePSK(self, network): """ Generate a PSK using wpa_passphrase. @@ -1237,9 +1272,7 @@ class BaseWirelessInterface(BaseInterface): def GetBSSID(self, iwconfig=None): """ Get the MAC address for the interface. """ if not iwconfig: - cmd = 'iwconfig ' + self.iface - if self.verbose: print cmd - output = misc.Run(cmd) + output = self.GetIwconfig() else: output = iwconfig @@ -1250,9 +1283,7 @@ class BaseWirelessInterface(BaseInterface): def GetCurrentBitrate(self, iwconfig=None): """ Get the current bitrate for the interface. """ if not iwconfig: - cmd = 'iwconfig ' + self.iface - if self.verbose: print cmd - output = misc.Run(cmd) + output = self.GetIwconfig() else: output = iwconfig @@ -1263,9 +1294,7 @@ class BaseWirelessInterface(BaseInterface): def GetOperationalMode(self, iwconfig=None): """ Get the operational mode for the interface. """ if not iwconfig: - cmd = 'iwconfig ' + self.iface - if self.verbose: print cmd - output = misc.Run(cmd) + output = self.GetIwconfig() else: output = iwconfig @@ -1313,9 +1342,7 @@ class BaseWirelessInterface(BaseInterface): """ if not iwconfig: - cmd = 'iwconfig ' + self.iface - if self.verbose: print cmd - output = misc.Run(cmd) + output = self.GetIwconfig() else: output = iwconfig return self._get_link_quality(output) @@ -1329,9 +1356,7 @@ class BaseWirelessInterface(BaseInterface): """ if not iwconfig: - cmd = 'iwconfig ' + self.iface - if self.verbose: print cmd - output = misc.Run(cmd) + output = self.GetIwconfig() else: output = iwconfig signaldbm_pattern = re.compile('.*Signal level:?=? ?(-\d\d*)', @@ -1348,9 +1373,7 @@ class BaseWirelessInterface(BaseInterface): """ if not iwconfig: - cmd = 'iwconfig ' + self.iface - if self.verbose: print cmd - output = misc.Run(cmd) + output = self.GetIwconfig() else: output = iwconfig network = misc.RunRegex(re.compile('.*ESSID:"(.*?)"', From 511fc75aafd398e369a668e5a9abc7b66ddc09d5 Mon Sep 17 00:00:00 2001 From: Andrew Psaltis Date: Sat, 23 May 2009 00:02:58 -0400 Subject: [PATCH 118/186] Really fixed bug 355693. :) --- curses/wicd-curses.py | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/curses/wicd-curses.py b/curses/wicd-curses.py index 4bc7b06..e2df297 100755 --- a/curses/wicd-curses.py +++ b/curses/wicd-curses.py @@ -530,7 +530,8 @@ class appGUI(): #if wireless.GetNumberOfNetworks() == 0: # wireless.Scan() - self.focusloc = (1,0) + # FIXME: This should be two variables + self.focusloc = [1,0] # These are empty to make sure that things go my way. wiredL,wlessL = [],[]# = gen_network_list() @@ -656,7 +657,7 @@ class appGUI(): else: where = self.thePile.get_focus().get_focus()[1] #where = self.wlessLB.get_focus()[1] - self.focusloc = (wlessorwired,where) + self.focusloc = [wlessorwired,where] # Be clunky until I get to a later stage of development. # Update the list of networks. Usually called by DBus. @@ -710,7 +711,10 @@ class appGUI(): if not firstrun: self.frame.body = self.thePile #if self.focusloc[0] == self.wlessLB: - self.wlessLB.set_focus(self.focusloc[1]) + if self.focusloc[1] == None: + self.focusloc[1] = 0 + if self.wlessLB != self.no_wlan: + self.wlessLB.set_focus(self.focusloc[1]) #self.thePile.get_focus().set_focus(self.focusloc[1]) #self.always_show_wired = not self.always_show_wired self.prev_state = state From 650b451ce29c148752452e710ba7077528411806 Mon Sep 17 00:00:00 2001 From: Andrew Psaltis Date: Sat, 23 May 2009 00:23:11 -0400 Subject: [PATCH 119/186] Removed some comments from wicd-curses.py. --- curses/wicd-curses.py | 63 ++++--------------------------------------- 1 file changed, 5 insertions(+), 58 deletions(-) diff --git a/curses/wicd-curses.py b/curses/wicd-curses.py index e2df297..2d4d0ea 100755 --- a/curses/wicd-curses.py +++ b/curses/wicd-curses.py @@ -229,7 +229,7 @@ def help_dialog(body): # textJ = urwid.Text(('important','Nobody expects the Spanish Inquisition!')) blank = urwid.Text('') - # Pile containing a text and columns? + cols = urwid.Columns([text1,text2]) pile = urwid.Pile([textH,cols]) fill = urwid.Filler(pile) @@ -251,10 +251,6 @@ def help_dialog(body): dim = ui.get_cols_rows() elif keys: break - #elif keys != '': - # break - #help = TextDialog(theText,18,62,header=('header',"Wicd-Curses Help")) - #help.run(ui,body) def run_configscript(parent,netname,nettype): configfile = wpath.etc+netname+'-settings.conf' @@ -350,7 +346,6 @@ class NetLabel(urwid.WidgetWrap): def keypress(self,size,key): return self._w.keypress(size,key) def connect(self): - # This should work. wireless.ConnectWireless(self.id) class WiredComboBox(ComboBox): @@ -361,7 +356,6 @@ class WiredComboBox(ComboBox): self.ADD_PROFILE = '---'+language["add_new_profile"]+'---' self.__super.__init__(use_enter=False) self.set_list(list) - #self.set_focus(self.theList.index(wired.GetDefaultProfile())) def set_list(self,list): self.theList = list @@ -370,16 +364,10 @@ class WiredComboBox(ComboBox): is_active = wireless.GetWirelessIP('') == None and wired.GetWiredIP('') != None for profile in list: theString = '%4s %25s' % (id, profile) - #### THIS IS wired.blah() in experimental - #print config.GetLastUsedWiredNetwork() # Tag if no wireless IP present, and wired one is if is_active: theString = '>'+theString[1:] - #wiredL.append(urwid.AttrWrap(SelText(theString),'connected', - # 'connected focus')) - #else: - # wiredL.append(urwid.AttrWrap(SelText(theString),'body','focus')) wiredL.append(theString) id+=1 wiredL.append(self.ADD_PROFILE) @@ -393,8 +381,6 @@ class WiredComboBox(ComboBox): if self.theList != []: wired.ReadWiredNetworkProfile(self.get_selected_profile()) - #def rebuild_combobox(self): - # pass def keypress(self,size,key): prev_focus = self.get_focus()[1] key = self.__super.keypress(size,key) @@ -513,23 +499,17 @@ class appGUI(): self.size = ui.get_cols_rows() # Happy screen saying that you can't do anything because we're scanning # for networks. :-) - # Will need a translation sooner or later self.screen_locker = urwid.Filler(urwid.Text(('important',language['scanning_stand_by']), align='center')) self.no_wlan = urwid.Filler(urwid.Text(('important',language['no_wireless_networks_found']), align='center')) self.TITLE = language['wicd_curses'] self.WIRED_IDX = 1 self.WLESS_IDX = 3 - #wrap1 = urwid.AttrWrap(txt, 'black') - #fill = urwid.Filler(txt) - header = urwid.AttrWrap(urwid.Text(self.TITLE,align='right'), 'header') self.wiredH=urwid.Filler(urwid.Text("Wired Network(s)")) self.list_header=urwid.AttrWrap(urwid.Text(gen_list_header()),'listbar') self.wlessH=NSelListBox([urwid.Text("Wireless Network(s)"),self.list_header]) - #if wireless.GetNumberOfNetworks() == 0: - # wireless.Scan() # FIXME: This should be two variables self.focusloc = [1,0] @@ -543,14 +523,6 @@ class appGUI(): self.wlessLB = urwid.ListBox(wlessL) self.update_netlist(force_check=True,firstrun=True) - # Stuff I used to simulate large lists - #spam = SelText('spam') - #spamL = [ urwid.AttrWrap( w, None, 'focus' ) for w in [spam,spam,spam, - # spam,spam,spam,spam,spam,spam,spam,spam,spam,spam,spam,spam, - # spam,spam,spam,spam,spam,spam,spam,spam,spam,spam,spam,spam, - # spam,spam,spam,spam,spam,spam,spam,spam,spam,spam,spam,spam, - # spam,spam,spam,spam] ] - #self.spamLB = urwid.ListBox(spamL) # Keymappings proposed by nanotube in #wicd keys = [ ('H' ,'Help' ,None), @@ -566,14 +538,12 @@ class appGUI(): ] self.primaryCols = OptCols(keys,self.handle_keys) - #self.time_label = urwid.Text(strftime('%H:%M:%S')) self.time_label = \ urwid.AttrWrap(urwid.Text(strftime('%H:%M:%S')), 'timebar') self.status_label = urwid.AttrWrap(urwid.Text('blah'),'important') self.footer2 = urwid.Columns([self.status_label,('fixed', 8, self.time_label)]) self.footerList = urwid.Pile([self.primaryCols,self.footer2]) - # Pop takes a number! - #walker.pop(1) + self.frame = urwid.Frame(self.thePile, header=header, footer=self.footerList) @@ -594,8 +564,6 @@ class appGUI(): self.update_status() - #self.dialog = PrefOverlay(self.frame,self.size) - def doScan(self, sync=False): self.scanning = True wireless.Scan(False) @@ -646,7 +614,6 @@ class appGUI(): # Location of last known focus is remapped to current location. # This might need to be cleaned up later. - #self.set_status(str(self.frame.get_body().get_focus())+ ' '+ str(self.wiredCB)) if self.thePile.get_focus() == self.wiredCB: wlessorwired = self.WIRED_IDX where = self.thePile.get_focus().get_body().get_focus()[1] @@ -676,8 +643,7 @@ class appGUI(): state, x = daemon.GetConnectionStatus() if force_check or self.prev_state != state: wiredL,wlessL = gen_network_list() - #self.wiredCB = urwid.Filler(ComboBox(wiredL,self.frame,ui,3, - # use_enter=False)) + self.wiredCB.get_body().set_list(wiredL) self.wiredCB.get_body().build_combobox(self.frame,ui,3) if len(wlessL) != 0: @@ -688,16 +654,13 @@ class appGUI(): else: self.wlessLB = self.no_wlan if daemon.GetAlwaysShowWiredInterface() or wired.CheckPluggedIn(): - #if daemon.GetAlwaysShowWiredInterface(): - #if firstrun: self.thePile = urwid.Pile([('fixed',1,self.wiredH), ('fixed',1,self.wiredCB), ('fixed',2,self.wlessH), self.wlessLB] ) if not firstrun: self.frame.body = self.thePile - #self.focusloc = (self.thePile.get_focus(), - # self.thePile.get_focus().get_focus()[1]) + self.thePile.set_focus(self.focusloc[0]) if self.focusloc[0] == self.WIRED_IDX: self.thePile.get_focus().get_body().set_focus(self.focusloc[1]) @@ -710,13 +673,11 @@ class appGUI(): self.thePile = urwid.Pile([('fixed',2,self.wlessH),self.wlessLB] ) if not firstrun: self.frame.body = self.thePile - #if self.focusloc[0] == self.wlessLB: if self.focusloc[1] == None: self.focusloc[1] = 0 if self.wlessLB != self.no_wlan: self.wlessLB.set_focus(self.focusloc[1]) - #self.thePile.get_focus().set_focus(self.focusloc[1]) - #self.always_show_wired = not self.always_show_wired + self.prev_state = state if not firstrun: self.update_ui() @@ -735,9 +696,6 @@ class appGUI(): fast = not daemon.NeedsExternalCalls() if self.connecting: if not self.conn_status: - #self.lock_screen() - #if self.statusID: - # gobject.idle_add(self.status_bar.remove, 1, self.statusID) self.conn_status = True gobject.idle_add(self.set_connecting_status,fast) return True @@ -790,11 +748,8 @@ class appGUI(): # something, and we aren't connecting to something, return False # immediately. if from_idle and not self.connecting: - #self.update_netlist() self.update_status() self.conn_status=False - #self.tcount = 0 - #self.update_ui() return False toAppend = '' # If we are connecting and being called from the idle function, spin @@ -803,12 +758,7 @@ class appGUI(): # This is probably the wrong way to do this, but it works for now. self.tcount+=1 toAppend=self.twirl[self.tcount % 4] - #self.footer2 = urwid.Columns([ - # urwid.AttrWrap(urwid.Text(text+' '+toAppend),'important'), - # ('fixed',8,urwid.Text(str(self.time),align='right'))]) self.status_label.set_text(text+' '+toAppend) - #self.frame.set_footer(urwid.BoxAdapter( - # urwid.ListBox([self.footer1,self.footer2]),2)) return True # Make sure the screen is still working by providing a pretty counter. @@ -873,7 +823,6 @@ class appGUI(): # Guess what! I actually need to put this here, else I'll have # tons of references to self.frame lying around. ^_^ if "enter" in keys: - #pass focus = self.frame.body.get_focus() if focus == self.wiredCB: self.special = focus @@ -1067,8 +1016,6 @@ def run(): gobject.timeout_add(1500,app.update_status) # This will make sure that it is updated on the second. gobject.timeout_add(500,app.update_time) - # DEFUNCT: Terminate the loop if the UI is terminated. - #gobject.idle_add(app.stop_loop) loop.run() # Mostly borrowed from gui.py From 6d00df2675765f9c39fa80cd01bd8060147fda5a Mon Sep 17 00:00:00 2001 From: Andrew Psaltis Date: Sat, 23 May 2009 00:32:29 -0400 Subject: [PATCH 120/186] 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): From fce29234b3af3bbaa4ac587b2650b628e31dd008 Mon Sep 17 00:00:00 2001 From: Adam Blackburn Date: Sat, 23 May 2009 12:51:02 +0800 Subject: [PATCH 121/186] Updated version numbers and CHANGES --- CHANGES | 188 +++++++++++++++++++++++++++++++++++++++++++++++++++++++ setup.py | 2 +- 2 files changed, 189 insertions(+), 1 deletion(-) diff --git a/CHANGES b/CHANGES index 06b2a9b..b82d42e 100644 --- a/CHANGES +++ b/CHANGES @@ -1,4 +1,192 @@ ------------------------------------------------------------ +revno: 402 +committer: Andrew Psaltis +branch nick: 1.6 +timestamp: Sat 2009-05-23 00:40:52 -0400 +message: + Merged r340 of experimental-nacl. + ------------------------------------------------------------ + revno: 202.2.49 + committer: Andrew Psaltis + branch nick: experimental-nacl + timestamp: Sat 2009-05-23 00:36:54 -0400 + message: + Merged r401 of mainline 1.6. + ------------------------------------------------------------ + revno: 202.2.48 + committer: Andrew Psaltis + branch nick: experimental-nacl + timestamp: Sat 2009-05-23 00:32:29 -0400 + message: + Made M^ and C^ into Alt+ and Ctrl+ respectively in OptCols. + Rearranged the OptCols for the preferences dialog to match those in the others. + ------------------------------------------------------------ + revno: 202.2.47 + committer: Andrew Psaltis + branch nick: experimental-nacl + timestamp: Sat 2009-05-23 00:23:11 -0400 + message: + Removed some comments from wicd-curses.py. + ------------------------------------------------------------ + revno: 202.2.46 + committer: Andrew Psaltis + branch nick: experimental-nacl + timestamp: Sat 2009-05-23 00:02:58 -0400 + message: + Really fixed bug 355693. :) +------------------------------------------------------------ +revno: 401 +committer: Adam Blackburn +branch nick: 1.6 +timestamp: Fri 2009-05-22 11:29:12 +0800 +message: + Buttons are now activated correctly when using the keyboard +------------------------------------------------------------ +revno: 400 +committer: Adam Blackburn +branch nick: 1.6 +timestamp: Thu 2009-05-21 23:18:48 +0800 +message: + merged 1.6-rworkman + ------------------------------------------------------------ + revno: 365.1.15 + committer: Robby Workman + branch nick: 1.6-rworkman + timestamp: Thu 2009-05-21 10:12:03 -0500 + message: + Clarify intent of INSTALL with respect to pm-utils version. + ------------------------------------------------------------ + revno: 365.1.14 + committer: Robby Workman + branch nick: 1.6-rworkman + timestamp: Tue 2009-05-19 23:40:13 -0500 + message: + Merged mainline back in; no other changes. +------------------------------------------------------------ +revno: 399 +committer: Andrew Psaltis +branch nick: 1.6 +timestamp: Tue 2009-05-19 21:25:09 -0400 +message: + Merged r336 of experimental-nacl. + ------------------------------------------------------------ + revno: 202.2.45 + committer: Andrew Psaltis + branch nick: experimental-nacl + timestamp: Tue 2009-05-19 21:20:29 -0400 + message: + Added wrap_exceptions to wicd-curses.py's run() function. + ------------------------------------------------------------ + revno: 202.2.44 + committer: Andrew Psaltis + branch nick: experimental-nacl + timestamp: Tue 2009-05-19 21:18:30 -0400 + message: + Flipped the order of the dhcp clients in the prefs dialog and fixed a syntax + error in wicd-curses.py. + ------------------------------------------------------------ + revno: 202.2.43 + committer: Andrew Psaltis + branch nick: experimental-nacl + timestamp: Tue 2009-05-19 21:06:38 -0400 + message: + Merge r398 of mainline 1.6. + ------------------------------------------------------------ + revno: 202.2.42 + committer: Andrew Psaltis + branch nick: experimental-nacl + timestamp: Fri 2009-05-15 01:05:36 -0400 + message: + Merge r395 of mainline 1.6. + ------------------------------------------------------------ + revno: 202.2.41 + committer: Andrew Psaltis + branch nick: experimental-nacl + timestamp: Fri 2009-05-15 01:05:04 -0400 + message: + Added some deactivated options for enabling debug logs. +------------------------------------------------------------ +revno: 398 +committer: Adam Blackburn +branch nick: 1.6 +timestamp: Wed 2009-05-20 07:12:58 +0800 +message: + Merged 1.6-rworkman + ------------------------------------------------------------ + revno: 365.1.13 + committer: Robby Workman + branch nick: 1.6-rworkman + timestamp: Tue 2009-05-19 15:44:52 -0500 + message: + Make sure the /sys/class/net/whatever is actually a directory in + GetWiredInterfaces() (similar to the check in GetWireless) + ------------------------------------------------------------ + revno: 365.1.12 + committer: Robby Workman + branch nick: 1.6-rworkman + timestamp: Fri 2009-05-15 12:25:58 -0500 + message: + Merged mainline. No other changes to this branch; no need to merge + into mainline. + ------------------------------------------------------------ + revno: 365.1.11 + committer: Robby Workman + branch nick: 1.6-rworkman + timestamp: Fri 2009-05-08 14:27:46 -0500 + message: + Merged mainline; no other changes. + ------------------------------------------------------------ + revno: 365.1.10 + committer: Robby Workman + branch nick: 1.6-rworkman + timestamp: Sat 2009-05-02 20:25:25 -0500 + message: + Merged mainline back in to sync up this branch. + No need to re-merge into mainline, as there are no other changes + at this point. + ------------------------------------------------------------ + revno: 365.1.9 + committer: Robby Workman + branch nick: 1.6-rworkman + timestamp: Fri 2009-05-01 09:15:18 -0500 + message: + Merged mainline. +------------------------------------------------------------ +revno: 397 +committer: Adam Blackburn +branch nick: 1.6 +timestamp: Wed 2009-05-20 07:10:49 +0800 +message: + merge + ------------------------------------------------------------ + revno: 395.1.2 + committer: Adam Blackburn + branch nick: 1.6 + timestamp: Wed 2009-05-20 07:01:31 +0800 + message: + Changed DHCP client order to dhcpcd -> pump -> dhclient + ------------------------------------------------------------ + revno: 395.1.1 + committer: Adam Blackburn + branch nick: 1.6 + timestamp: Sat 2009-05-16 20:50:20 +0800 + message: + Apply .desktop file patch from Debian (remove deprecated encoding line) +------------------------------------------------------------ +revno: 396 +committer: Adam Blackburn +branch nick: 1.6 +timestamp: Wed 2009-05-20 07:09:42 +0800 +message: + changed DHCP client order in preferences dialog +------------------------------------------------------------ +revno: 395 +committer: Adam Blackburn +branch nick: 1.6 +timestamp: Thu 2009-05-14 21:55:59 +0800 +message: + update CHANGES and NEWS +------------------------------------------------------------ revno: 394 committer: Andrew Psaltis branch nick: 1.6 diff --git a/setup.py b/setup.py index 041597b..7a3ba06 100755 --- a/setup.py +++ b/setup.py @@ -25,7 +25,7 @@ import subprocess # Be sure to keep this updated! # VERSIONNUMBER -VERSION_NUM = '1.6.0b1' +VERSION_NUM = '1.6.0b2' # REVISION_NUM is automatically updated REVISION_NUM = 'unknown' CURSES_REVNO = 'uimod' From 1ee51fb74732306f07f81a49793ac2184a9601f8 Mon Sep 17 00:00:00 2001 From: Dan O'Reilly Date: Sun, 24 May 2009 17:11:14 -0400 Subject: [PATCH 122/186] Try to recover if we attempt to load a non-existent backend. --- wicd/wicd-daemon.py | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/wicd/wicd-daemon.py b/wicd/wicd-daemon.py index 4b72e99..24289ed 100644 --- a/wicd/wicd-daemon.py +++ b/wicd/wicd-daemon.py @@ -203,6 +203,16 @@ class WicdDaemon(dbus.service.Object): def SetBackend(self, backend): """ Sets a new backend. """ print "setting backend to %s" % backend + backends = networking.BACKEND_MGR.get_available_backends() + if backend not in backends: + print "backend %s not available, trying to fallback to another" % backend + try: + backend = backends[0] + except IndexError: + print "ERROR: no backends available!" + return + else: + print "Fell back to backend %s" % backend self.config.set("Settings", "backend", backend, write=True) if backend != self.GetCurrentBackend(): self.suspended = True From d4b5830f9d88b973482315824f72b59c876c09f0 Mon Sep 17 00:00:00 2001 From: Adam Blackburn Date: Thu, 28 May 2009 11:10:10 +0800 Subject: [PATCH 123/186] updated CHANGES and setup.py version --- CHANGES | 51 +++++++++++++++++++++++++++++++++++++++++++++++++++ setup.py | 2 +- 2 files changed, 52 insertions(+), 1 deletion(-) diff --git a/CHANGES b/CHANGES index b82d42e..aa96b08 100644 --- a/CHANGES +++ b/CHANGES @@ -1,4 +1,55 @@ ------------------------------------------------------------ +revno: 404 +committer: Dan O'Reilly +branch nick: 1.6 +timestamp: Wed 2009-05-27 22:25:32 -0400 +message: + Merge 1.6-dan + ------------------------------------------------------------ + revno: 401.1.3 + committer: Dan O'Reilly + branch nick: experimental + timestamp: Sun 2009-05-24 17:11:14 -0400 + message: + Try to recover if we attempt to load a non-existent backend. + ------------------------------------------------------------ + revno: 401.1.2 + committer: Dan O'Reilly + branch nick: experimental + timestamp: Fri 2009-05-22 15:43:14 -0400 + message: + Merge + ------------------------------------------------------------ + revno: 401.2.1 + committer: Dan O'Reilly + branch nick: experimental + timestamp: Fri 2009-05-22 15:33:03 -0400 + message: + - Make the GUI behave better when a disconnect button is pushed. + - Move some of the libnotify logic to guiutil.py and add support for displaying some error messages in a libnotify pop-up. + - Apply some patches provided by sunseraph. Tweak to the channel regex and checking for a valid AP bssid when monitoring a wireless connection. Set essid, bssid, and channel in separate calls to iwconfig. + - Add caching for ifconfig and iwconfig results in wnettools.py. That way we're not needlessly calling the same command a bunch of times in a short period of time (2 seconds). This removes the need for us to pass around iwconfig/ifconfig output elsewhere, though I've left it in for now. + - Remove unneeded BackendManager instance from networking.py + ------------------------------------------------------------ + revno: 401.1.1 + committer: Dan O'Reilly + branch nick: experimental + timestamp: Fri 2009-05-22 15:40:35 -0400 + message: + - Make the GUI behave better when a disconnect button is pushed. + - Move some of the libnotify logic to guiutil.py and add support for displaying some error messages in a libnotify pop-up. + - Apply some patches provided by sunseraph. Tweak to the channel regex and checking for a valid AP bssid when monitoring a wireless connection. Set essid, bssid, and channel in separate calls to iwconfig. + - Add caching for ifconfig and iwconfig results in wnettools.py. That way we're not needlessly calling the same command a bunch of times in a short period of time (2 seconds). This removes the need for us to pass around iwconfig/ifconfig output elsewhere, though I've left it in for now. + - Remove unneeded BackendManager instance from networking.py + - Fix last used wired networking autoconnection method +------------------------------------------------------------ +revno: 403 +committer: Adam Blackburn +branch nick: 1.6 +timestamp: Sat 2009-05-23 12:51:02 +0800 +message: + Updated version numbers and CHANGES +------------------------------------------------------------ revno: 402 committer: Andrew Psaltis branch nick: 1.6 diff --git a/setup.py b/setup.py index 7a3ba06..14650f3 100755 --- a/setup.py +++ b/setup.py @@ -25,7 +25,7 @@ import subprocess # Be sure to keep this updated! # VERSIONNUMBER -VERSION_NUM = '1.6.0b2' +VERSION_NUM = '1.6.0b3' # REVISION_NUM is automatically updated REVISION_NUM = 'unknown' CURSES_REVNO = 'uimod' From 49a2dd04f677b42c1d94bac03f9541a38ab04771 Mon Sep 17 00:00:00 2001 From: Andrew Psaltis Date: Sat, 30 May 2009 23:12:53 -0400 Subject: [PATCH 124/186] Increased time between wireless scans to 2 seconds. --- curses/wicd-curses.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/curses/wicd-curses.py b/curses/wicd-curses.py index a2e0b51..34da866 100755 --- a/curses/wicd-curses.py +++ b/curses/wicd-curses.py @@ -1010,7 +1010,7 @@ def run(): # Update what the interface looks like as an idle function gobject.idle_add(app.update_ui) # Update the connection status on the bottom every 1.5 s. - gobject.timeout_add(1500,app.update_status) + gobject.timeout_add(2000,app.update_status) # This will make sure that it is updated on the second. gobject.timeout_add(500,app.update_time) loop.run() From e8f0376a693837e3ec5da3c82610cebc1fc7e9a0 Mon Sep 17 00:00:00 2001 From: Adam Blackburn Date: Thu, 4 Jun 2009 21:39:36 +0800 Subject: [PATCH 125/186] updated CHANGES, setup.py version, and NEWS --- CHANGES | 28 ++++++++++++++++++++++++++++ NEWS | 2 +- setup.py | 2 +- 3 files changed, 30 insertions(+), 2 deletions(-) diff --git a/CHANGES b/CHANGES index aa96b08..8517745 100644 --- a/CHANGES +++ b/CHANGES @@ -1,4 +1,32 @@ ------------------------------------------------------------ +revno: 406 +committer: Andrew Psaltis +branch nick: 1.6 +timestamp: Sat 2009-05-30 23:18:22 -0400 +message: + Merge r342 of experimental-nacl. + ------------------------------------------------------------ + revno: 202.2.51 + committer: Andrew Psaltis + branch nick: experimental-nacl + timestamp: Sat 2009-05-30 23:12:53 -0400 + message: + Increased time between wireless scans to 2 seconds. + ------------------------------------------------------------ + revno: 202.2.50 + committer: Andrew Psaltis + branch nick: experimental-nacl + timestamp: Sat 2009-05-30 23:11:37 -0400 + message: + Merged with r405 of mainline 1.6 +------------------------------------------------------------ +revno: 405 +committer: Adam Blackburn +branch nick: 1.6 +timestamp: Thu 2009-05-28 11:10:10 +0800 +message: + updated CHANGES and setup.py version +------------------------------------------------------------ revno: 404 committer: Dan O'Reilly branch nick: 1.6 diff --git a/NEWS b/NEWS index 719fb92..701ff67 100644 --- a/NEWS +++ b/NEWS @@ -17,7 +17,7 @@ Minor Changes and Other Enhancements: - Better autoconnection behavior - Tray/GUI will survive the daemon being killed - Reasons for connection failures will now bubble back to the GUI -- Add/Remove wired profile system is now more user-friendly +- Add/remove wired profile system is now more user-friendly - Support for using resolvconf instead of directly editing /etc/resolv.conf - Wicd won't blindly kill dhcp clients / wpa_supplicant any more - Added an option to automatically switch from a wireless network to a wired diff --git a/setup.py b/setup.py index 14650f3..dbae429 100755 --- a/setup.py +++ b/setup.py @@ -25,7 +25,7 @@ import subprocess # Be sure to keep this updated! # VERSIONNUMBER -VERSION_NUM = '1.6.0b3' +VERSION_NUM = '1.6.0' # REVISION_NUM is automatically updated REVISION_NUM = 'unknown' CURSES_REVNO = 'uimod' From b10c959e9a78103aa5599310a0d9879fe270bd2f Mon Sep 17 00:00:00 2001 From: Adam Blackburn Date: Thu, 4 Jun 2009 22:24:14 +0800 Subject: [PATCH 126/186] add .sourceforge.net to the URLs in the translator --- setup.py | 33 ++++++++++++++++----------------- 1 file changed, 16 insertions(+), 17 deletions(-) diff --git a/setup.py b/setup.py index dbae429..c2f67cc 100755 --- a/setup.py +++ b/setup.py @@ -20,6 +20,7 @@ from distutils.core import setup, Command from distutils.extension import Extension import os +import sys import shutil import subprocess @@ -411,28 +412,26 @@ class get_translations(Command): import urllib, shutil shutil.rmtree('translations/') os.makedirs('translations') - filename, headers = urllib.urlretrieve('http://wicd.net/translator/idlist') + filename, headers = urllib.urlretrieve('http://wicd.sourceforge.net/translator/idlist/') id_file = open(filename, 'r') lines = id_file.readlines() # remove the \n from the end of lines, and remove blank entries lines = [ x.strip() for x in lines if not x.strip() is '' ] for id in lines: - # http://wicd.net/translator/download_po.php?language=11 - pofile, poheaders = urllib.urlretrieve('http://wicd.net/translator/download/'+str(id)) - #for i in `cat ids`; do - #wget "http://wicd.sourceforge.net/translator/download_po.php?language=$i&version=$1" -O "language_$i" - #iden=`python -c "import sys; print open('language_$i','r').readlines()[1].strip()[2:]"` - #mv "language_$i" po/$iden.po - #mkdir -p $iden/LC_MESSAGES/ - #msgfmt --output-file=$iden/LC_MESSAGES/wicd.mo po/$iden.po - lang_identifier = open(pofile,'r').readlines()[0].strip() - lang_identifier = lang_identifier[lang_identifier.rindex('(')+1:lang_identifier.rindex(')')] - shutil.move(pofile, lang_identifier+'.po') - print 'Got',lang_identifier - os.makedirs('translations/'+lang_identifier+'/LC_MESSAGES') - os.system('msgfmt --output-file=translations/' + lang_identifier + - '/LC_MESSAGES/wicd.mo ' + lang_identifier + '.po') - os.remove(lang_identifier+'.po') + pofile, poheaders = urllib.urlretrieve('http://wicd.sourceforge.net/translator/download/'+str(id)+'/') + try: + lang_identifier = open(pofile,'r').readlines()[0].strip() + first_line = lang_identifier + lang_identifier = lang_identifier[lang_identifier.rindex('(')+1:lang_identifier.rindex(')')] + print first_line + except: + print >> sys.stderr, 'error downloading language %s' % id + else: + shutil.move(pofile, lang_identifier+'.po') + os.makedirs('translations/'+lang_identifier+'/LC_MESSAGES') + os.system('msgfmt --output-file=translations/' + lang_identifier + + '/LC_MESSAGES/wicd.mo ' + lang_identifier + '.po') + os.remove(lang_identifier+'.po') class uninstall(Command): From 8f6d807d8720c2fd5dc36d5b4770f6c9e1b8d6ca Mon Sep 17 00:00:00 2001 From: Andrew Psaltis Date: Thu, 4 Jun 2009 22:19:33 -0400 Subject: [PATCH 127/186] If a network dialog is up when a scan is initiated externally, drop the dialog. --- curses/netentry_curses.py | 4 ++-- curses/wicd-curses.py | 12 ++++++++---- 2 files changed, 10 insertions(+), 6 deletions(-) diff --git a/curses/netentry_curses.py b/curses/netentry_curses.py index 8711ed3..b74eec4 100644 --- a/curses/netentry_curses.py +++ b/curses/netentry_curses.py @@ -171,7 +171,7 @@ class WiredSettingsDialog(AdvancedSettingsDialog): self._w.body.body.append(self.set_default) self.prof_name = name - title = ">"+language['configuring_wired'].replace('$A',self.prof_name) + title = language['configuring_wired'].replace('$A',self.prof_name) self._w.header = urwid.Text( ('header',title),align='right' ) self.set_values() @@ -241,7 +241,7 @@ class WirelessSettingsDialog(AdvancedSettingsDialog): self.encrypt_types = misc.LoadEncryptionMethods() self.set_values() - title = ">"+language['configuring_wireless'].replace('$A',wireless.GetWirelessProperty(networkID,'essid')).replace('$B',wireless.GetWirelessProperty(networkID,'bssid')) + title = language['configuring_wireless'].replace('$A',wireless.GetWirelessProperty(networkID,'essid')).replace('$B',wireless.GetWirelessProperty(networkID,'bssid')) self._w.header = urwid.Text(('header',title),align='right' ) def encryption_toggle(self,chkbox,new_state,user_data=None): diff --git a/curses/wicd-curses.py b/curses/wicd-curses.py index 34da866..042a224 100755 --- a/curses/wicd-curses.py +++ b/curses/wicd-curses.py @@ -557,7 +557,8 @@ class appGUI(): self.prev_state = False self.connecting = False self.screen_locked = False - self.do_diag_lock = False + self.do_diag_lock = False #Whether the screen is locked beneath a dialog + self.diag_type = 'none' # The type of dialog that is up self.scanning = False self.pref = None @@ -568,7 +569,6 @@ class appGUI(): self.scanning = True wireless.Scan(False) - def init_other_optcols(self): # The "tabbed" preferences dialog self.prefCols = OptCols( [ ('meta enter','OK'), @@ -580,7 +580,7 @@ class appGUI(): # Does what it says it does def lock_screen(self): - if self.diag: + if self.diag_type == 'pref': self.do_diag_lock = True return True self.frame.set_body(self.screen_locker) @@ -779,9 +779,12 @@ class appGUI(): #@wrap_exceptions def dbus_scan_started(self): self.scanning = True + if self.diag_type == 'conf': + self.restore_primary() self.lock_screen() def restore_primary(self): + self.diag_type = 'none' if self.do_diag_lock or self.scanning: self.frame.set_body(self.screen_locker) self.do_diag_lock = False @@ -817,6 +820,7 @@ class appGUI(): self.diag = WirelessSettingsDialog(pos,self.frame) self.diag.ready_widgets(ui,self.frame) self.frame.set_body(self.diag) + self.diag_type = 'conf' # Guess what! I actually need to put this here, else I'll have # tons of references to self.frame lying around. ^_^ if "enter" in keys: @@ -843,13 +847,13 @@ class appGUI(): self.pref.ready_widgets(ui,self.frame) self.frame.set_footer(urwid.Pile([self.prefCols,self.footer2])) self.diag = self.pref + self.diag_type = 'pref' self.frame.set_body(self.diag) # Halt here, keypress gets passed to the dialog otherwise return True if "A" in keys: about_dialog(self.frame) if "C" in keys: - # Same as "enter" for now focus = self.frame.body.get_focus() if focus == self.wiredCB: self.special = focus From 7d184bfd243cf5ae708bb965630d789fcd0e21dc Mon Sep 17 00:00:00 2001 From: Adam Blackburn Date: Fri, 5 Jun 2009 15:20:58 +0800 Subject: [PATCH 128/186] updated CHANGES --- CHANGES | 35 +++++++++++++++++++++++++++++++++++ 1 file changed, 35 insertions(+) diff --git a/CHANGES b/CHANGES index 8517745..8946d49 100644 --- a/CHANGES +++ b/CHANGES @@ -1,4 +1,39 @@ ------------------------------------------------------------ +revno: 409 +committer: Adam Blackburn +branch nick: 1.6 +timestamp: Fri 2009-06-05 15:08:47 +0800 +message: + merged experimental-nacl + ------------------------------------------------------------ + revno: 202.2.53 + committer: Andrew Psaltis + branch nick: experimental-nacl + timestamp: Thu 2009-06-04 22:19:33 -0400 + message: + If a network dialog is up when a scan is initiated externally, drop the dialog. + ------------------------------------------------------------ + revno: 202.2.52 + committer: Andrew Psaltis + branch nick: experimental-nacl + timestamp: Thu 2009-06-04 22:10:05 -0400 + message: + Merge r408 of mainline 1.6. +------------------------------------------------------------ +revno: 408 +committer: Adam Blackburn +branch nick: 1.6 +timestamp: Thu 2009-06-04 22:24:14 +0800 +message: + add .sourceforge.net to the URLs in the translator +------------------------------------------------------------ +revno: 407 +committer: Adam Blackburn +branch nick: 1.6 +timestamp: Thu 2009-06-04 21:39:36 +0800 +message: + updated CHANGES, setup.py version, and NEWS +------------------------------------------------------------ revno: 406 committer: Andrew Psaltis branch nick: 1.6 From 99d025c4c54e1f3b7fdd2ce40323d97ebfce94d3 Mon Sep 17 00:00:00 2001 From: Adam Blackburn Date: Fri, 5 Jun 2009 16:13:38 +0800 Subject: [PATCH 129/186] Updated translations.py --- wicd/translations.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/wicd/translations.py b/wicd/translations.py index 948b26d..77d232d 100644 --- a/wicd/translations.py +++ b/wicd/translations.py @@ -55,7 +55,7 @@ def get_gettext(): _ = lang.gettext return _ -# Generated automatically on Sun, 17 May 2009 19:17:27 CDT +# Generated automatically on Fri, 05 Jun 2009 03:13:27 CDT _ = get_gettext() language = {} language['resetting_ip_address'] = _('''Resetting IP address...''') @@ -214,5 +214,5 @@ language['connection_established'] = _('''Connection established''') language['disconnected'] = _('''Disconnected''') language['establishing_connection'] = _('''Establishing connection...''') language['association_failed'] = _('''Connection failed: Could not contact the wireless access point.''') -language['access_denied'] = _('''Unable to contact the wicd dameon due to an access denied error from DBus. Please check your DBus configuration.''') +language['access_denied'] = _('''Unable to contact the Wicd daemon due to an access denied error from DBus. Please check your DBus configuration.''') language['disconnecting_active'] = _('''Disconnecting active connections...''') From d2d2bae6d8e34bf00a7e5ed4c97774ded227c037 Mon Sep 17 00:00:00 2001 From: Adam Blackburn Date: Tue, 9 Jun 2009 13:25:02 +0800 Subject: [PATCH 130/186] display the ESSID/Wired Network in the title of the settings dialog --- wicd/netentry.py | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) diff --git a/wicd/netentry.py b/wicd/netentry.py index 296fd46..979832d 100644 --- a/wicd/netentry.py +++ b/wicd/netentry.py @@ -45,14 +45,20 @@ def setup_dbus(): wired = dbusmanager.get_interface('wired') class AdvancedSettingsDialog(gtk.Dialog): - def __init__(self): + def __init__(self, network_name=None): """ Build the base advanced settings dialog. This class isn't used by itself, instead it is used as a parent for the WiredSettingsDialog and WirelessSettingsDialog. """ - gtk.Dialog.__init__(self, title=language['properties'], + # if no network name was passed, just use Properties as the title + if network_name: + title = '%s - %s' % (network_name, language['properties']) + else: + title = language['properties'] + + gtk.Dialog.__init__(self, title=title, flags=gtk.DIALOG_MODAL, buttons=(gtk.STOCK_CANCEL, gtk.RESPONSE_REJECT, gtk.STOCK_OK, @@ -236,7 +242,7 @@ class AdvancedSettingsDialog(gtk.Dialog): class WiredSettingsDialog(AdvancedSettingsDialog): def __init__(self, name): """ Build the wired settings dialog. """ - AdvancedSettingsDialog.__init__(self) + AdvancedSettingsDialog.__init__(self, language['wired_network']) self.des = self.connect("destroy", self.destroy_called) self.script_button.connect("clicked", self.edit_scripts) self.prof_name = name @@ -294,7 +300,7 @@ class WiredSettingsDialog(AdvancedSettingsDialog): class WirelessSettingsDialog(AdvancedSettingsDialog): def __init__(self, networkID): """ Build the wireless settings dialog. """ - AdvancedSettingsDialog.__init__(self) + AdvancedSettingsDialog.__init__(self, wireless.GetWirelessProperty(networkID, 'essid')) # Set up encryption stuff self.networkID = networkID self.combo_encryption = gtk.combo_box_new_text() From 858c75fe12a00453ca912b0b31e13b7cdc7b24e2 Mon Sep 17 00:00:00 2001 From: David Paleino Date: Sat, 13 Jun 2009 22:05:10 +0200 Subject: [PATCH 131/186] Remove deprecated Encoding field --- other/wicd.desktop | 1 - 1 file changed, 1 deletion(-) diff --git a/other/wicd.desktop b/other/wicd.desktop index 7221c15..a0f334f 100644 --- a/other/wicd.desktop +++ b/other/wicd.desktop @@ -1,6 +1,5 @@ [Desktop Entry] Categories=Application;Network; -Encoding=UTF-8 Exec=wicd-client --no-tray GenericName=Network Manager Icon=wicd-client From 8fd7855b3cdf6084974df77b33c50e3e3e6609d2 Mon Sep 17 00:00:00 2001 From: David Paleino Date: Sat, 13 Jun 2009 22:06:08 +0200 Subject: [PATCH 132/186] Update manpage with an appropriate WHATIS entry --- man/wicd-client.1 | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/man/wicd-client.1 b/man/wicd-client.1 index 6d86469..a2e71ad 100644 --- a/man/wicd-client.1 +++ b/man/wicd-client.1 @@ -1,6 +1,6 @@ -.TH WICD-CLIENT "1" "February 2009" "wicd-client " "User Commands" +.TH WICD-CLIENT "1" "June 2009" "wicd-client " "User Commands" .SH NAME -wicd-client \- manual page for wicd-client +wicd-client \- frontend to the WICD daemon .SH DESCRIPTION wireless (and wired) connection daemon front\-end. From c95ede898a64a90e96e67eb6425712c1e0403878 Mon Sep 17 00:00:00 2001 From: David Paleino Date: Sat, 13 Jun 2009 22:07:49 +0200 Subject: [PATCH 133/186] Support udhcpc, this is needed to smoothly run on the OpenMoko FreeRunner. Thanks to Luca Capello for porting the patch to 1.5.9, and to "madmo" from the linked forum for making the patch. Patch originally taken from http://wicd.net/punbb/viewtopic.php?id=132 Patch ported to 1.6.0 code by David Paleino . --- curses/prefs_curses.py | 10 +++++--- data/wicd.glade | 15 ++++++++++++ wicd/misc.py | 1 + wicd/prefs.py | 7 ++++-- wicd/wnettools.py | 53 +++++++++++++++++++++++++++++++++++------- 5 files changed, 72 insertions(+), 14 deletions(-) diff --git a/curses/prefs_curses.py b/curses/prefs_curses.py index 43da851..bf1eb74 100644 --- a/curses/prefs_curses.py +++ b/curses/prefs_curses.py @@ -93,6 +93,7 @@ class PrefsDialog(urwid.WidgetWrap): dhcp1_t = 'dhclient' dhcp2_t = 'dhcpcd' dhcp3_t = 'pump' + dhcp4_t = 'udhcpc' wired_detect_header_t = ('header',language["wired_detect"]) wired1_t = 'ethtool' @@ -185,7 +186,8 @@ class PrefsDialog(urwid.WidgetWrap): self.dhcp1 = DynRadioButton(self.dhcp_l,dhcp1_t) self.dhcp2 = DynRadioButton(self.dhcp_l,dhcp2_t) self.dhcp3 = DynRadioButton(self.dhcp_l,dhcp3_t) - self.dhcp_l = [self.dhcp0,self.dhcp1,self.dhcp2,self.dhcp3] + self.dhcp4 = DynRadioButton(self.dhcp_l,dhcp4_t) + self.dhcp_l = [self.dhcp0,self.dhcp1,self.dhcp2,self.dhcp3,self.dhcp4] self.wired_l = [] self.wired_detect_header = urwid.Text(wired_detect_header_t) @@ -202,7 +204,7 @@ class PrefsDialog(urwid.WidgetWrap): self.flush_l = [self.flush0,self.flush1,self.flush2] externalLB = urwid.ListBox([self.dhcp_header, - self.dhcp0,self.dhcp2,self.dhcp3,self.dhcp1, + self.dhcp0,self.dhcp2,self.dhcp3,self.dhcp1,self.dhcp4, _blank, self.wired_detect_header, self.wired0,self.wired1,self.wired2, @@ -351,8 +353,10 @@ class PrefsDialog(urwid.WidgetWrap): dhcp_client = misc.DHCLIENT elif self.dhcp2.get_state(): dhcp_client = misc.DHCPCD - else: + elif self.dhcp3.get_state(): dhcp_client = misc.PUMP + else: + dhcp_client = misc.UDHCPC daemon.SetDHCPClient(dhcp_client) if self.wired0.get_state(): diff --git a/data/wicd.glade b/data/wicd.glade index 258f6b8..f37be7e 100644 --- a/data/wicd.glade +++ b/data/wicd.glade @@ -1171,6 +1171,21 @@ is already active. 2 + + + udhcpc + True + True + False + True + True + dhclient_radio + + + False + 4 + + diff --git a/wicd/misc.py b/wicd/misc.py index 2dde1d4..1ed4e33 100644 --- a/wicd/misc.py +++ b/wicd/misc.py @@ -49,6 +49,7 @@ AUTO = 0 DHCLIENT = 1 DHCPCD = 2 PUMP = 3 +UDHCPC = 4 # Link detection tools ETHTOOL = 1 diff --git a/wicd/prefs.py b/wicd/prefs.py index a8da776..6072f8d 100644 --- a/wicd/prefs.py +++ b/wicd/prefs.py @@ -82,7 +82,7 @@ class PreferencesDialog(object): self.preferwiredcheckbox.set_active(daemon.GetPreferWiredNetwork()) dhcp_list = [self.dhcpautoradio, self.dhclientradio, self.dhcpcdradio, - self.pumpradio] + self.pumpradio, self.udhcpcradio] self._setup_external_app_radios(dhcp_list, daemon.GetDHCPClient, daemon.SetDHCPClient) @@ -210,8 +210,10 @@ class PreferencesDialog(object): dhcp_client = misc.DHCLIENT elif self.dhcpcdradio.get_active(): dhcp_client = misc.DHCPCD - else: + elif self.pumpradio.get_active(): dhcp_client = misc.PUMP + else: + dhcp_client = misc.UDHCPC daemon.SetDHCPClient(dhcp_client) if self.linkautoradio.get_active(): @@ -347,6 +349,7 @@ class PreferencesDialog(object): self.dhclientradio = self.wTree.get_widget("dhclient_radio") self.pumpradio = self.wTree.get_widget("pump_radio") self.dhcpcdradio = self.wTree.get_widget("dhcpcd_radio") + self.udhcpcradio = self.wTree.get_widget("udhcpc_radio") # Wired Link Detection Apps self.linkautoradio = setup_label("link_auto_radio", 'wicd_auto_config') diff --git a/wicd/wnettools.py b/wicd/wnettools.py index 113015f..f1b2eda 100644 --- a/wicd/wnettools.py +++ b/wicd/wnettools.py @@ -250,6 +250,9 @@ class BaseInterface(object): cmd = self.dhclient_cmd if self.dhclient_needs_verbose: cmd += ' -v' + elif self.udhcpc_cmd and cl in [misc.UDHCPC, misc.AUTO]: + client = "udhcpc" + cmd = self.udhcpc_cmd else: client = None cmd = "" @@ -257,20 +260,25 @@ class BaseInterface(object): client_dict = { "dhclient" : - {'connect' : r"%s %s", - 'release' : r"%s -r %s", + {'connect' : r"%(cmd)s %(iface)s", + 'release' : r"%(cmd)s -r %(iface)s", 'id' : misc.DHCLIENT, }, "pump" : - { 'connect' : r"%s -i %s", - 'release' : r"%s -r -i %s", + { 'connect' : r"%(cmd)s -i %(iface)s", + 'release' : r"%(cmd)s -r -i %(iface)s", 'id' : misc.PUMP, }, "dhcpcd" : - {'connect' : r"%s %s", - 'release' : r"%s -k %s", + {'connect' : r"%(cmd)s %(iface)s", + 'release' : r"%(cmd)s -k %(iface)s", 'id' : misc.DHCPCD, }, + "udhcpc": + {'connect' : r"%(cmd)s -n -i %(iface)s", + 'release' : r"killall -SIGUSR2 %(cmd)s", + 'id' : misc.UDHCPC, + }, } (client_name, cmd) = get_client_name(self.DHCP_CLIENT) if not client_name or not cmd: @@ -278,9 +286,9 @@ class BaseInterface(object): return "" if flavor == "connect": - return client_dict[client_name]['connect'] % (cmd, self.iface) + return client_dict[client_name]['connect'] % {"cmd":cmd, "iface":self.iface} elif flavor == "release": - return client_dict[client_name]['release'] % (cmd, self.iface) + return client_dict[client_name]['release'] % {"cmd":cmd, "iface":self.iface} else: return client_dict[client_name]['id'] @@ -327,6 +335,7 @@ class BaseInterface(object): self.dhclient_needs_verbose = False self.dhcpcd_cmd = self._find_program_path("dhcpcd") self.pump_cmd = self._find_program_path("pump") + self.udhcpc_cmd = self._find_program_path("udhcpc") def CheckWiredTools(self): """ Check for the existence of ethtool and mii-tool. """ @@ -485,7 +494,31 @@ class BaseInterface(object): print line return self._check_dhcp_result(dhcpcd_success) - + + def _parse_udhcpc(self, pipe): + """ Determines if obtaining an IP using udhcpc succeeded. + + Keyword arguments: + pipe -- stdout pipe to the dhcpcd process. + + Returns: + 'success' if successful, an error code string otherwise. + + """ + udhcpc_complete = False + udhcpc_success = True + + while not udhcpc_complete: + line = pipe.readline() + if line.endswith("failing"): + udhcpc_success = False + udhcpc_complete = True + elif line == '': + udhcpc_complete = True + print line + + return self._check_dhcp_result(udhcpc_success) + def _check_dhcp_result(self, success): """ Print and return the correct DHCP connection result. @@ -524,6 +557,8 @@ class BaseInterface(object): return self._parse_pump(pipe) elif DHCP_CLIENT == misc.DHCPCD: return self._parse_dhcpcd(pipe) + elif DHCP_CLIENT == misc.UDHCPC: + return self._parse_udhcpc(pipe) else: print 'ERROR no dhclient found!' From 355a8bca1c0cf282ea7e0f7a57030b3850d11944 Mon Sep 17 00:00:00 2001 From: David Paleino Date: Sat, 13 Jun 2009 22:59:03 +0200 Subject: [PATCH 134/186] Support --loggroup and --logperms arguments to setup.py --- .bzrignore | 1 + wicd/wicd-daemon.py => in/wicd=wicd-daemon.py.in | 8 ++++++-- in/wicd=wpath.py.in | 2 ++ setup.py | 2 ++ 4 files changed, 11 insertions(+), 2 deletions(-) rename wicd/wicd-daemon.py => in/wicd=wicd-daemon.py.in (99%) diff --git a/.bzrignore b/.bzrignore index 29a8142..0cfc4e1 100644 --- a/.bzrignore +++ b/.bzrignore @@ -22,5 +22,6 @@ scripts/wicd scripts/wicd-client scripts/wicd-curses translations/* +wicd/wicd-daemon.py wicd/wpath.py *tags diff --git a/wicd/wicd-daemon.py b/in/wicd=wicd-daemon.py.in similarity index 99% rename from wicd/wicd-daemon.py rename to in/wicd=wicd-daemon.py.in index 24289ed..32abcbe 100644 --- a/wicd/wicd-daemon.py +++ b/in/wicd=wicd-daemon.py.in @@ -1671,9 +1671,13 @@ def main(argv): output = ManagedStdio(logpath) if os.path.exists(logpath): try: - os.chmod(logpath, 0600) + os.chmod(logpath, %LOGPERMS%) + if "%LOGGROUP%": + import grp + group = grp.getgrnam("%LOGGROUP%") + os.chown(logpath, 0, group[2]) except: - print 'unable to chmod log file to 0600' + print 'unable to chmod log file to %LOGPERMS%' if redirect_stdout: sys.stdout = output if redirect_stderr: sys.stderr = output diff --git a/in/wicd=wpath.py.in b/in/wicd=wpath.py.in index d1fbbc1..b441ba5 100755 --- a/in/wicd=wpath.py.in +++ b/in/wicd=wpath.py.in @@ -62,6 +62,8 @@ initfile = '%INITFILE%' # stores only the file name, i.e. wicd initfilename = '%INITFILENAME%' wicd_group = '%WICDGROUP%' +log_group = '%LOGGROUP%' +log_perms = '%LOGPERMS%' # BOOLEANS no_install_pmutils = %NO_INSTALL_PMUTILS% diff --git a/setup.py b/setup.py index c2f67cc..13508b8 100755 --- a/setup.py +++ b/setup.py @@ -242,6 +242,8 @@ class configure(Command): self.no_install_acpi = True elif self.distro in ['debian']: self.wicdgroup = "netdev" + self.loggroup = "adm" + self.logperms = "0640" self.init = '/etc/init.d/' self.initfile = 'init/debian/wicd' elif self.distro in ['arch']: From d07dea23903dd8e557630ff676ffdc197866b97d Mon Sep 17 00:00:00 2001 From: Dan O'Reilly Date: Sun, 14 Jun 2009 14:25:06 -0400 Subject: [PATCH 135/186] Convert strings being prints out by dhclients to utf-8 before trying to log them. When iwscan displays two entries for a hidden network, only display the one with the essid included. --- wicd/networking.py | 11 +++++++++-- wicd/wnettools.py | 16 +++++++++++----- 2 files changed, 20 insertions(+), 7 deletions(-) diff --git a/wicd/networking.py b/wicd/networking.py index 8eaa454..937f323 100644 --- a/wicd/networking.py +++ b/wicd/networking.py @@ -315,6 +315,13 @@ class ConnectThread(threading.Thread): self.SetStatus('interface_down') + def run(self): + self.connect_result = "Failed" + try: + self._connect() + finally: + self.is_connecting = False + def set_should_die(self, val): self.lock.acquire() try: @@ -794,7 +801,7 @@ class WirelessConnectThread(ConnectThread): self.wpa_driver = wpa_driver - def run(self): + def _connect(self): """ The main function of the connection thread. This function performs the necessary calls to connect to the @@ -1006,7 +1013,7 @@ class WiredConnectThread(ConnectThread): after_script, disconnect_script, gdns1, gdns2, gdns3, gdns_dom, gsearch_dom, liface, debug) - def run(self): + def _connect(self): """ The main function of the connection thread. This function performs the necessary calls to connect to the diff --git a/wicd/wnettools.py b/wicd/wnettools.py index 113015f..5864941 100644 --- a/wicd/wnettools.py +++ b/wicd/wnettools.py @@ -431,7 +431,7 @@ class BaseInterface(object): if line == '': # Empty string means dhclient is done. dhclient_complete = True else: - print line.strip('\n') + print misc.to_unicode(line.strip('\n')) if line.startswith('bound'): dhclient_success = True dhclient_complete = True @@ -458,7 +458,7 @@ class BaseInterface(object): elif line.strip().lower().startswith('Operation failed.'): pump_success = False pump_complete = True - print line + print misc.to_unicode(line) return self._check_dhcp_result(pump_success) @@ -482,7 +482,7 @@ class BaseInterface(object): dhcpcd_complete = True elif line == '': dhcpcd_complete = True - print line + print misc.to_unicode(line) return self._check_dhcp_result(dhcpcd_success) @@ -1106,15 +1106,21 @@ class BaseWirelessInterface(BaseInterface): # An array for the access points access_points = [] + access_points = {} for cell in networks: # Only use sections where there is an ESSID. if 'ESSID:' in cell: # Add this network to the list of networks entry = self._ParseAccessPoint(cell, ralink_info) if entry is not None: - access_points.append(entry) + # Normally we only get duplicate bssids with hidden + # networks. If we hit this, we only want the entry + # with the real essid to be in the network list. + if (entry['bssid'] not in access_points + or not entry['hidden']): + access_points[entry['bssid']] = entry - return access_points + return access_points.values() def _ParseAccessPoint(self, cell, ralink_info): """ Parse a single cell from the output of iwlist. From 73a08c5c55adcb98f2eafd2d55b9c06c6f3607dc Mon Sep 17 00:00:00 2001 From: Adam Blackburn Date: Tue, 16 Jun 2009 07:44:27 +0800 Subject: [PATCH 136/186] disable automatically disconnecting when Automatically reconnect is False --- wicd/monitor.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/wicd/monitor.py b/wicd/monitor.py index 2937360..6dcb0a0 100755 --- a/wicd/monitor.py +++ b/wicd/monitor.py @@ -185,7 +185,7 @@ class ConnectionStatus(object): # try to reconnect. self.connection_lost_counter += 1 print self.connection_lost_counter - if self.connection_lost_counter >= 4: + if self.connection_lost_counter >= 4 and daemon.GetAutoReconnect(): wireless.DisconnectWireless() self.connection_lost_counter = 0 return False From 0c1c6c107ceb859cc0e49ec96d1cdfaf6269cb9f Mon Sep 17 00:00:00 2001 From: Adam Blackburn Date: Tue, 16 Jun 2009 23:08:52 +0800 Subject: [PATCH 137/186] moved wicd-daemon.py back to wicd/ and changed wpath replacement values to use the wpath module --- in/wicd=wicd-daemon.py.in => wicd/wicd-daemon.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) rename in/wicd=wicd-daemon.py.in => wicd/wicd-daemon.py (99%) diff --git a/in/wicd=wicd-daemon.py.in b/wicd/wicd-daemon.py similarity index 99% rename from in/wicd=wicd-daemon.py.in rename to wicd/wicd-daemon.py index 32abcbe..8d7805b 100644 --- a/in/wicd=wicd-daemon.py.in +++ b/wicd/wicd-daemon.py @@ -1671,13 +1671,13 @@ def main(argv): output = ManagedStdio(logpath) if os.path.exists(logpath): try: - os.chmod(logpath, %LOGPERMS%) - if "%LOGGROUP%": + os.chmod(logpath, wpath.logperms) + if wpath.loggroup: import grp - group = grp.getgrnam("%LOGGROUP%") + group = grp.getgrnam(wpath.loggroup) os.chown(logpath, 0, group[2]) except: - print 'unable to chmod log file to %LOGPERMS%' + print 'unable to chmod log file to %s' % wpath.logperms if redirect_stdout: sys.stdout = output if redirect_stderr: sys.stderr = output From 46bce8ea5e11b324afb463b696a25fe5af0d5898 Mon Sep 17 00:00:00 2001 From: David Paleino Date: Tue, 16 Jun 2009 17:13:41 +0200 Subject: [PATCH 138/186] Provide a pre-/post-down script mechanism WICD currently only provides pre-/post-connection scripts, and only one disconnection script, that is run before actually disconnecting. This provides pre-/post-disconnection scripts, thus increasing configuration flexibility. --- curses/configscript_curses.py | 20 ++++++--- curses/wicd-curses.py | 2 +- data/wicd.glade | 39 ++++++++++++++-- in/man=wicd-wired-settings.conf.5.in | 8 +++- in/man=wicd-wireless-settings.conf.5.in | 7 ++- in/wicd=wpath.py.in | 3 +- setup.py | 3 +- wicd/configscript.py | 30 ++++++++----- wicd/networking.py | 60 ++++++++++++++++--------- wicd/translations.py | 3 +- wicd/wicd-daemon.py | 21 ++++++--- 11 files changed, 139 insertions(+), 57 deletions(-) diff --git a/curses/configscript_curses.py b/curses/configscript_curses.py index 46f1e60..a93ad99 100755 --- a/curses/configscript_curses.py +++ b/curses/configscript_curses.py @@ -38,7 +38,8 @@ language = {} language['configure_scripts'] = _("Configure Scripts") language['before_script'] = _("Pre-connection Script") language['after_script'] = _("Post-connection Script") -language['disconnect_script'] = _("Disconnection Script") +language['pre_disconnect_script'] = _("Pre-disconnection Script") +language['post_disconnect_script'] = _("Post-disconnection Script") def main(argv): global ui,frame @@ -62,16 +63,19 @@ def main(argv): blank = urwid.Text('') pre_entry_t = ('body',language['before_script']+': ') post_entry_t = ('body',language['after_script']+': ') - disconnect_entry_t = ('body',language['disconnect_script']+': ') + pre_disconnect_entry_t = ('body',language['pre_disconnect_script']+': ') + post_disconnect_entry_t = ('body',language['post_disconnect_script']+': ') - global pre_entry,post_entry,disconnect_entry + global pre_entry,post_entry,pre_disconnect_entry,post_disconnect_entry pre_entry = urwid.AttrWrap(urwid.Edit(pre_entry_t, none_to_blank(script_info.get('pre_entry'))),'editbx','editfc' ) post_entry = urwid.AttrWrap(urwid.Edit(post_entry_t, none_to_blank(script_info.get('post_entry'))),'editbx','editfc' ) - disconnect_entry = urwid.AttrWrap(urwid.Edit(disconnect_entry_t, - none_to_blank(script_info.get('disconnect_entry'))),'editbx','editfc' ) + pre_disconnect_entry = urwid.AttrWrap(urwid.Edit(pre_disconnect_entry_t, + none_to_blank(script_info.get('pre_disconnect_entry'))),'editbx','editfc' ) + post_disconnect_entry = urwid.AttrWrap(urwid.Edit(post_disconnect_entry_t, + none_to_blank(script_info.get('post_disconnect_entry'))),'editbx','editfc' ) # The buttons ok_button = urwid.AttrWrap(urwid.Button('OK',ok_callback),'body','focus') @@ -82,7 +86,8 @@ def main(argv): lbox = urwid.Pile([('fixed',2,urwid.Filler(pre_entry)), #('fixed',urwid.Filler(blank),1), ('fixed',2,urwid.Filler(post_entry)), - ('fixed',2,urwid.Filler(disconnect_entry)), + ('fixed',2,urwid.Filler(pre_disconnect_entry)), + ('fixed',2,urwid.Filler(post_disconnect_entry)), #blank,blank,blank,blank,blank, urwid.Filler(button_cols,'bottom') ]) @@ -92,7 +97,8 @@ def main(argv): if result == True: script_info["pre_entry"] = blank_to_none(pre_entry.get_edit_text()) script_info["post_entry"] = blank_to_none(post_entry.get_edit_text()) - script_info["disconnect_entry"] = blank_to_none(disconnect_entry.get_edit_text()) + script_info["pre_disconnect_entry"] = blank_to_none(pre_disconnect_entry.get_edit_text()) + script_info["post_disconnect_entry"] = blank_to_none(post_disconnect_entry.get_edit_text()) write_scripts(network, network_type, script_info) OK_PRESSED = False diff --git a/curses/wicd-curses.py b/curses/wicd-curses.py index 042a224..744cd15 100755 --- a/curses/wicd-curses.py +++ b/curses/wicd-curses.py @@ -263,7 +263,7 @@ def run_configscript(parent,netname,nettype): # Translation needs to be changed to accomidate this text below. """You can also configure the wireless networks by looking for the "[]" field in the config file. -Once there, you can adjust (or add) the "beforescript", "afterscript", and "disconnectscript" variables as needed, to change the preconnect, postconnect, and disconnect scripts respectively. Note that you will be specifying the full path to the scripts - not the actual script contents. You will need to add/edit the script contents separately. Refer to the wicd manual page for more information."""] +Once there, you can adjust (or add) the "beforescript", "afterscript", "predisconnectscript" and "postdisconnectscript" variables as needed, to change the preconnect, postconnect, predisconnect and postdisconnect scripts respectively. Note that you will be specifying the full path to the scripts - not the actual script contents. You will need to add/edit the script contents separately. Refer to the wicd manual page for more information."""] dialog = TextDialog(theText,20,80) dialog.run(ui,parent) # This code works with many distributions, but not all of them. So, to diff --git a/data/wicd.glade b/data/wicd.glade index f37be7e..5dbbc0b 100644 --- a/data/wicd.glade +++ b/data/wicd.glade @@ -342,18 +342,18 @@ True GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK - + 150 True GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK - Disconnection Script: + Pre-disconnection Script: 0 - + True True GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK @@ -370,6 +370,39 @@ 3 + + + True + GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK + + + 150 + True + GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK + Post-disconnection Script: + + + 0 + + + + + True + True + GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK + + + 1 + + + + + False + False + 5 + 4 + + 1 diff --git a/in/man=wicd-wired-settings.conf.5.in b/in/man=wicd-wired-settings.conf.5.in index 6d0b06c..31b33c3 100644 --- a/in/man=wicd-wired-settings.conf.5.in +++ b/in/man=wicd-wired-settings.conf.5.in @@ -33,8 +33,12 @@ The script should be a Bourne-compatible script and should be executable. IMPORTANT - scripts should ONLY be writable by root and located in a directory that is only writable by root. .TP -.BI "disconnectscript = " -This defines a script to run when Wicd disconnects the interface. +.BI "predisconnectscript = " +This defines a script to run before Wicd disconnects the interface. +The script should be a Bourne-compatible script and should be executable. +.TP +.BI "postdisconnectscript = " +This defines a script to run after Wicd disconnects the interface. The script should be a Bourne-compatible script and should be executable. .br IMPORTANT - scripts should ONLY be writable by root and located in a diff --git a/in/man=wicd-wireless-settings.conf.5.in b/in/man=wicd-wireless-settings.conf.5.in index 79ac751..dd567df 100644 --- a/in/man=wicd-wireless-settings.conf.5.in +++ b/in/man=wicd-wireless-settings.conf.5.in @@ -99,8 +99,11 @@ This defines a script to run after Wicd brings up the connection. IMPORTANT - scripts should ONLY be writable by root and located in a directory that is writable by only root. .TP -.BI "disconnectscript = " -This defines a script to run when Wicd disconnects the interface. +.BI "predisconnectscript = " +This defines a script to run before Wicd disconnects the interface. +.TP +.BI "postdisconnectscript = " +This defines a script to run after Wicd disconnects the interface. .br IMPORTANT - scripts should ONLY be writable by root and located in a directory that is writable by only root. diff --git a/in/wicd=wpath.py.in b/in/wicd=wpath.py.in index d1fbbc1..99937d0 100755 --- a/in/wicd=wpath.py.in +++ b/in/wicd=wpath.py.in @@ -27,7 +27,8 @@ lib = '%LIB%' share = '%SHARE%' etc = '%ETC%' scripts = '%SCRIPTS%' -disconnectscripts = '%SCRIPTS%disconnect' +predisconnectscripts = '%SCRIPTS%predisconnect' +postdisconnectscripts = '%SCRIPTS%postdisconnect' preconnectscripts = '%SCRIPTS%preconnect' postconnectscripts = '%SCRIPTS%postconnect' images = '%IMAGES%' diff --git a/setup.py b/setup.py index c2f67cc..1fff4ab 100755 --- a/setup.py +++ b/setup.py @@ -488,7 +488,8 @@ try: (wpath.backends, ['wicd/backends/be-external.py', 'wicd/backends/be-ioctl.py']), (wpath.autostart, ['other/wicd-tray.desktop', ]), (wpath.scripts, []), - (wpath.disconnectscripts, []), + (wpath.predisconnectscripts, []), + (wpath.postdisconnectscripts, []), (wpath.preconnectscripts, []), (wpath.postconnectscripts, []), ] diff --git a/wicd/configscript.py b/wicd/configscript.py index b574d04..cf10596 100755 --- a/wicd/configscript.py +++ b/wicd/configscript.py @@ -42,7 +42,8 @@ language = {} language['configure_scripts'] = _("Configure Scripts") language['before_script'] = _("Pre-connection Script") language['after_script'] = _("Post-connection Script") -language['disconnect_script'] = _("Disconnection Script") +language['pre_disconnect_script'] = _("Pre-disconnection Script") +language['post_disconnect_script'] = _("Post-disconnection Script") dbus = dbusmanager.DBusManager() dbus.connect_to_dbus() @@ -100,14 +101,16 @@ def get_script_info(network, network_type): if con.has_section(network): info["pre_entry"] = get_val(con, network, "beforescript") info["post_entry"] = get_val(con, network, "afterscript") - info["disconnect_entry"] = get_val(con, network, "disconnectscript") + info["pre_disconnect_entry"] = get_val(con, network, "predisconnectscript") + info["post_disconnect_entry"] = get_val(con, network, "postdisconnectscript") else: bssid = wireless.GetWirelessProperty(int(network), "bssid") con.read(wireless_conf) if con.has_section(bssid): info["pre_entry"] = get_val(con, bssid, "beforescript") info["post_entry"] = get_val(con, bssid, "afterscript") - info["disconnect_entry"] = get_val(con, bssid, "disconnectscript") + info["pre_disconnect_entry"] = get_val(con, bssid, "predisconnectscript") + info["post_disconnect_entry"] = get_val(con, bssid, "postdisconnectscript") return info def write_scripts(network, network_type, script_info): @@ -120,7 +123,8 @@ def write_scripts(network, network_type, script_info): con.add_section(network) con.set(network, "beforescript", script_info["pre_entry"]) con.set(network, "afterscript", script_info["post_entry"]) - con.set(network, "disconnectscript", script_info["disconnect_entry"]) + con.set(network, "predisconnectscript", script_info["pre_disconnect_entry"]) + con.set(network, "postdisconnectscript", script_info["post_disconnect_entry"]) con.write(open(wired_conf, "w")) wired.ReloadConfig() wired.ReadWiredNetworkProfile(network) @@ -132,7 +136,8 @@ def write_scripts(network, network_type, script_info): con.add_section(bssid) con.set(bssid, "beforescript", script_info["pre_entry"]) con.set(bssid, "afterscript", script_info["post_entry"]) - con.set(bssid, "disconnectscript", script_info["disconnect_entry"]) + con.set(bssid, "predisconnectscript", script_info["pre_disconnect_entry"]) + con.set(bssid, "postdisconnectscript", script_info["post_disconnect_entry"]) con.write(open(wireless_conf, "w")) wireless.ReloadConfig() wireless.ReadWirelessNetworkProfile(int(network)) @@ -155,25 +160,30 @@ def main (argv): dialog = wTree.get_widget("configure_script_dialog") wTree.get_widget("pre_label").set_label(language['before_script'] + ":") wTree.get_widget("post_label").set_label(language['after_script'] + ":") - wTree.get_widget("disconnect_label").set_label(language['disconnect_script'] + wTree.get_widget("pre_disconnect_label").set_label(language['pre_disconnect_script'] + + ":") + wTree.get_widget("post_disconnect_label").set_label(language['post_disconnect_script'] + ":") wTree.get_widget("window1").hide() pre_entry = wTree.get_widget("pre_entry") post_entry = wTree.get_widget("post_entry") - disconnect_entry = wTree.get_widget("disconnect_entry") + pre_disconnect_entry = wTree.get_widget("pre_disconnect_entry") + post_disconnect_entry = wTree.get_widget("post_disconnect_entry") pre_entry.set_text(none_to_blank(script_info.get("pre_entry"))) post_entry.set_text(none_to_blank(script_info.get("post_entry"))) - disconnect_entry.set_text(none_to_blank(script_info.get("disconnect_entry"))) - + pre_disconnect_entry.set_text(none_to_blank(script_info.get("pre_disconnect_entry"))) + post_disconnect_entry.set_text(none_to_blank(script_info.get("post_disconnect_entry"))) + dialog.show_all() result = dialog.run() if result == 1: script_info["pre_entry"] = blank_to_none(pre_entry.get_text()) script_info["post_entry"] = blank_to_none(post_entry.get_text()) - script_info["disconnect_entry"] = blank_to_none(disconnect_entry.get_text()) + script_info["pre_disconnect_entry"] = blank_to_none(pre_disconnect_entry.get_text()) + script_info["post_disconnect_entry"] = blank_to_none(post_disconnect_entry.get_text()) write_scripts(network, network_type, script_info) dialog.destroy() diff --git a/wicd/networking.py b/wicd/networking.py index 937f323..c9eb8ca 100644 --- a/wicd/networking.py +++ b/wicd/networking.py @@ -151,7 +151,8 @@ class Controller(object): self.connecting_thread = None self.before_script = None self.after_script = None - self.disconnect_script = None + self.pre_disconnect_script = None + self.post_disconnect_script = None self.driver = None self.iface = None @@ -203,17 +204,23 @@ class Controller(object): def Disconnect(self, *args, **kargs): """ Disconnect from the network. """ iface = self.iface - misc.ExecuteScripts(wpath.disconnectscripts, self.debug) - if self.disconnect_script: - print 'Running disconnect script' - misc.ExecuteScript(expand_script_macros(self.disconnect_script, - 'disconnection', *args), + misc.ExecuteScripts(wpath.predisconnectscripts, self.debug) + if self.pre_disconnect_script: + print 'Running pre-disconnect script' + misc.ExecuteScript(expand_script_macros(self.pre_disconnect_script, + 'pre-disconnection', *args), self.debug) iface.ReleaseDHCP() iface.SetAddress('0.0.0.0') iface.FlushRoutes() iface.Down() iface.Up() + misc.ExecuteScripts(wpath.postdisconnectscripts, self.debug) + if self.post_disconnect_script: + print 'Running post-disconnect script' + misc.ExecuteScript(expand_script_macros(self.post_disconnect_script, + 'post-disconnection', *args), + self.debug) def ReleaseDHCP(self): """ Release the DHCP lease for this interface. """ @@ -273,8 +280,8 @@ class ConnectThread(threading.Thread): lock = threading.Lock() def __init__(self, network, interface_name, before_script, after_script, - disconnect_script, gdns1, gdns2, gdns3, gdns_dom, gsearch_dom, - iface, debug): + pre_disconnect_script, post_disconnect_script, gdns1, + gdns2, gdns3, gdns_dom, gsearch_dom, iface, debug): """ Initialise the required object variables and the thread. Keyword arguments: @@ -283,7 +290,8 @@ class ConnectThread(threading.Thread): wired -- name of the wired interface before_script -- script to run before bringing up the interface after_script -- script to run after bringing up the interface - disconnect_script -- script to run after disconnection + pre_disconnect_script -- script to run before disconnection + post_disconnect_script -- script to run after disconnection gdns1 -- global DNS server 1 gdns2 -- global DNS server 2 gdns3 -- global DNS server 3 @@ -297,7 +305,8 @@ class ConnectThread(threading.Thread): self.connect_result = None self.before_script = before_script self.after_script = after_script - self.disconnect_script = disconnect_script + self.pre_disconnect_script = pre_disconnect_script + self.post_disconnect_script = post_disconnect_script self._should_die = False self.abort_reason = "" self.connect_result = "" @@ -607,7 +616,8 @@ class Wireless(Controller): self.connecting_thread = WirelessConnectThread(network, self.wireless_interface, self.wpa_driver, self.before_script, - self.after_script, self.disconnect_script, self.global_dns_1, + self.after_script, self.pre_disconnect_script, + self.post_disconnect_script, self.global_dns_1, self.global_dns_2, self.global_dns_3, self.global_dns_dom, self.global_search_dom, self.wiface, debug) self.connecting_thread.setDaemon(True) @@ -779,8 +789,9 @@ class WirelessConnectThread(ConnectThread): """ def __init__(self, network, wireless, wpa_driver, before_script, - after_script, disconnect_script, gdns1, gdns2, gdns3, - gdns_dom, gsearch_dom, wiface, debug=False): + after_script, pre_disconnect_script, post_disconnect_script, + gdns1, gdns2, gdns3, gdns_dom, gsearch_dom, wiface, + debug=False): """ Initialise the thread with network information. Keyword arguments: @@ -789,14 +800,16 @@ class WirelessConnectThread(ConnectThread): wpa_driver -- type of wireless interface before_script -- script to run before bringing up the interface after_script -- script to run after bringing up the interface - disconnect_script -- script to run after disconnection + pre_disconnect_script -- script to run before disconnection + post_disconnect_script -- script to run after disconnection gdns1 -- global DNS server 1 gdns2 -- global DNS server 2 gdns3 -- global DNS server 3 """ ConnectThread.__init__(self, network, wireless, before_script, - after_script, disconnect_script, gdns1, gdns2, + after_script, pre_disconnect_script, + post_disconnect_script, gdns1, gdns2, gdns3, gdns_dom, gsearch_dom, wiface, debug) self.wpa_driver = wpa_driver @@ -967,9 +980,10 @@ class Wired(Controller): if not self.liface: return False self.connecting_thread = WiredConnectThread(network, self.wired_interface, self.before_script, self.after_script, - self.disconnect_script, self.global_dns_1, self.global_dns_2, - self.global_dns_3, self.global_dns_dom, self.global_search_dom, - self.liface, debug) + self.pre_disconnect_script, self.post_disconnect_script, + self.global_dns_1, self.global_dns_2, self.global_dns_3, + self.global_dns_dom, self.global_search_dom, self.liface, + debug) self.connecting_thread.setDaemon(True) self.connecting_thread.start() return self.connecting_thread @@ -993,8 +1007,8 @@ class WiredConnectThread(ConnectThread): """ def __init__(self, network, wired, before_script, after_script, - disconnect_script, gdns1, gdns2, gdns3, gdns_dom, gsearch_dom, - liface, debug=False): + pre_disconnect_script, post_disconnect_script, gdns1, + gdns2, gdns3, gdns_dom, gsearch_dom, liface, debug=False): """ Initialise the thread with network information. Keyword arguments: @@ -1003,14 +1017,16 @@ class WiredConnectThread(ConnectThread): wired -- name of the wired interface before_script -- script to run before bringing up the interface after_script -- script to run after bringing up the interface - disconnect_script -- script to run after disconnection + pre_disconnect_script -- script to run before disconnection + post_disconnect_script -- script to run after disconnection gdns1 -- global DNS server 1 gdns2 -- global DNS server 2 gdns3 -- global DNS server 3 """ ConnectThread.__init__(self, network, wired, before_script, - after_script, disconnect_script, gdns1, gdns2, + after_script, pre_disconnect_script, + post_disconnect_script, gdns1, gdns2, gdns3, gdns_dom, gsearch_dom, liface, debug) def _connect(self): diff --git a/wicd/translations.py b/wicd/translations.py index 77d232d..f101385 100644 --- a/wicd/translations.py +++ b/wicd/translations.py @@ -74,7 +74,8 @@ language['wired_networks'] = _('''Wired Networks''') language['backend_alert'] = _('''Changes to your backend won't occur until the daemon is restarted.''') language['about_help'] = _('''Stop a network connection in progress''') language['connecting'] = _('''Connecting''') -language['disconnect_script'] = _('''Run disconnect script''') +language['pre_disconnect_script'] = _('''Run pre-disconnect script''') +language['post_disconnect_script'] = _('''Run post-disconnect script''') language['cannot_edit_scripts_1'] = _('''To avoid various complications, wicd-curses does not support directly editing the scripts directly. However, you can edit them manually. First, (as root)", open the "$A" config file, and look for the section labeled by the $B in question. In this case, this is:''') language['cannot_edit_scripts_3'] = _('''You can also configure the wireless networks by looking for the "[]" field in the config file.''') language['cannot_edit_scripts_2'] = _('''Once there, you can adjust (or add) the "beforescript", "afterscript", and "disconnectscript" variables as needed, to change the preconnect, postconnect, and disconnect scripts respectively. Note that you will be specifying the full path to the scripts - not the actual script contents. You will need to add/edit the script contents separately. Refer to the wicd manual page for more information.''') diff --git a/wicd/wicd-daemon.py b/wicd/wicd-daemon.py index 24289ed..233525e 100644 --- a/wicd/wicd-daemon.py +++ b/wicd/wicd-daemon.py @@ -1134,8 +1134,10 @@ class WirelessDaemon(dbus.service.Object): # is done. self.wifi.before_script = self.GetWirelessProperty(id, 'beforescript') self.wifi.after_script = self.GetWirelessProperty(id, 'afterscript') - self.wifi.disconnect_script = self.GetWirelessProperty(id, - 'disconnectscript') + self.wifi.pre_disconnect_script = self.GetWirelessProperty(id, + 'predisconnectscript') + self.wifi.post_disconnect_script = self.GetWirelessProperty(id, + 'postdisconnectscript') print 'Connecting to wireless network ' + self.LastScan[id]['essid'] self.daemon.wired_bus.wired.Disconnect() self.daemon.SetForcedDisconnect(False) @@ -1222,12 +1224,14 @@ class WirelessDaemon(dbus.service.Object): write_script_ent(bssid_key, "beforescript") write_script_ent(bssid_key, "afterscript") - write_script_ent(bssid_key, "disconnectscript") + write_script_ent(bssid_key, "predisconnectscript") + write_script_ent(bssid_key, "postdisconnectscript") if cur_network["use_settings_globally"]: write_script_ent(essid_key, "beforescript") write_script_ent(essid_key, "afterscript") - write_script_ent(essid_key, "disconnectscript") + write_script_ent(essid_key, "predisconnectscript") + write_script_ent(essid_key, "postdisconnectscript") self.config.write() @@ -1421,7 +1425,8 @@ class WiredDaemon(dbus.service.Object): """ Connects to a wired network. """ self.wired.before_script = self.GetWiredProperty("beforescript") self.wired.after_script = self.GetWiredProperty("afterscript") - self.wired.disconnect_script = self.GetWiredProperty("disconnectscript") + self.wired.pre_disconnect_script = self.GetWiredProperty("predisconnectscript") + self.wired.post_disconnect_script = self.GetWiredProperty("postdisconnectscript") self.daemon.wireless_bus.wifi.Disconnect() self.daemon.SetForcedDisconnect(False) self.UnsetWiredLastUsed() @@ -1439,7 +1444,8 @@ class WiredDaemon(dbus.service.Object): for option in ["ip", "broadcast", "netmask","gateway", "search_domain", "dns_domain", "dns1", "dns2", "dns3", "beforescript", - "afterscript", "disconnectscript"]: + "afterscript", "predisconnectscript", + "postdisconnectscript"]: self.config.set(profilename, option, None) self.config.set(profilename, "default", default) self.config.write() @@ -1507,7 +1513,8 @@ class WiredDaemon(dbus.service.Object): write_script_ent(profilename, "beforescript") write_script_ent(profilename, "afterscript") - write_script_ent(profilename, "disconnectscript") + write_script_ent(profilename, "predisconnectscript") + write_script_ent(profilename, "postdisconnectscript") self.config.write() return "100: Profile Written" From 6b7bfed11ffdbfe8a0c6d06bad94fcc827f7e211 Mon Sep 17 00:00:00 2001 From: Adam Blackburn Date: Tue, 16 Jun 2009 23:22:40 +0800 Subject: [PATCH 139/186] removed wicd-daemon.py from .bzrignore --- .bzrignore | 1 - 1 file changed, 1 deletion(-) diff --git a/.bzrignore b/.bzrignore index 0cfc4e1..29a8142 100644 --- a/.bzrignore +++ b/.bzrignore @@ -22,6 +22,5 @@ scripts/wicd scripts/wicd-client scripts/wicd-curses translations/* -wicd/wicd-daemon.py wicd/wpath.py *tags From 5adf46811d7cd63a292619212d7a645d889572d7 Mon Sep 17 00:00:00 2001 From: Adam Blackburn Date: Tue, 16 Jun 2009 23:36:58 +0800 Subject: [PATCH 140/186] fix a small typo in misc.py -- thanks to David Paleino --- wicd/misc.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/wicd/misc.py b/wicd/misc.py index 1ed4e33..bc5a2bd 100644 --- a/wicd/misc.py +++ b/wicd/misc.py @@ -447,7 +447,7 @@ def choose_sudo_prog(prog_num=0): paths = [] if desktop_env == "kde": - progs = ["kdesu", "kdesudo", "ktusss"] + progs = ["kdesu", "kdesudo", "ktsuss"] else: progs = ["gksudo", "gksu", "ktsuss"] From 99fd8ee4d4633f3e6604efbd976a804b06dc0954 Mon Sep 17 00:00:00 2001 From: David Paleino Date: Tue, 16 Jun 2009 17:56:21 +0200 Subject: [PATCH 141/186] Add "status" to /etc/init.d/wicd (Debian/Ubuntu) --- in/init=debian=wicd.in | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/in/init=debian=wicd.in b/in/init=debian=wicd.in index f08e836..879695b 100755 --- a/in/init=debian=wicd.in +++ b/in/init=debian=wicd.in @@ -153,9 +153,12 @@ case "$1" in ;; esac ;; + status) + status_of_proc -p $PIDFILE $DAEMON $NAME + ;; *) #echo "Usage: $SCRIPTNAME {start|stop|restart|reload|force-reload}" >&2 - echo "Usage: $SCRIPTNAME {start|stop|restart|force-reload}" >&2 + echo "Usage: $SCRIPTNAME {start|stop|restart|force-reload|status}" >&2 exit 3 ;; esac From 1c761ca232e1710be1776b189c5cb43e6c18d338 Mon Sep 17 00:00:00 2001 From: Adam Blackburn Date: Tue, 16 Jun 2009 23:57:02 +0800 Subject: [PATCH 142/186] added forgotten underscores --- wicd/wicd-daemon.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/wicd/wicd-daemon.py b/wicd/wicd-daemon.py index 8d7805b..3488483 100644 --- a/wicd/wicd-daemon.py +++ b/wicd/wicd-daemon.py @@ -1671,13 +1671,13 @@ def main(argv): output = ManagedStdio(logpath) if os.path.exists(logpath): try: - os.chmod(logpath, wpath.logperms) - if wpath.loggroup: + os.chmod(logpath, wpath.log_perms) + if wpath.log_group: import grp - group = grp.getgrnam(wpath.loggroup) + group = grp.getgrnam(wpath.log_group) os.chown(logpath, 0, group[2]) except: - print 'unable to chmod log file to %s' % wpath.logperms + print 'unable to chmod log file to %s' % wpath.log_perms if redirect_stdout: sys.stdout = output if redirect_stderr: sys.stderr = output From 8de0e98010ca9c7e9962891a5ec78b7c141b32a8 Mon Sep 17 00:00:00 2001 From: Adam Blackburn Date: Thu, 18 Jun 2009 14:56:25 +0800 Subject: [PATCH 143/186] fixed crash that occured when clicking to connect to a secured network but without entering the security information --- wicd/gui.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/wicd/gui.py b/wicd/gui.py index f49c3f9..0023b73 100644 --- a/wicd/gui.py +++ b/wicd/gui.py @@ -679,7 +679,7 @@ class appGui(object): if nettype == "wireless": if not self.check_encryption_valid(networkid, networkentry.advanced_dialog): - self.edit_advanced(None, None, nettype, networkid, networkentry) + self.edit_advanced(None, nettype, networkid, networkentry) return False wireless.ConnectWireless(networkid, reply_handler=handler, error_handler=handler) From 3578e338e66711454f85fae5c8803fbd9aabcace Mon Sep 17 00:00:00 2001 From: Adam Blackburn Date: Thu, 18 Jun 2009 15:16:29 +0800 Subject: [PATCH 144/186] allow user to cancel preferences dialog if they chose not to connect after clicking connect and showing the preferences dialog --- wicd/gui.py | 24 ++++++++++++++---------- 1 file changed, 14 insertions(+), 10 deletions(-) diff --git a/wicd/gui.py b/wicd/gui.py index 0023b73..03da45b 100644 --- a/wicd/gui.py +++ b/wicd/gui.py @@ -666,24 +666,28 @@ class appGui(object): """ Initiates the connection process in the daemon. """ def handler(*args): self._connect_thread_started = True - - cancel_button = self.wTree.get_widget("cancel_button") - cancel_button.set_sensitive(True) - self.network_list.set_sensitive(False) - if self.statusID: - gobject.idle_add(self.status_bar.remove, 1, self.statusID) - gobject.idle_add(self.set_status, language["disconnecting_active"]) - gobject.idle_add(self.status_area.show_all) - self.wait_for_events() - self._connect_thread_started = False + + def setup_interface_for_connection(): + cancel_button = self.wTree.get_widget("cancel_button") + cancel_button.set_sensitive(True) + self.network_list.set_sensitive(False) + if self.statusID: + gobject.idle_add(self.status_bar.remove, 1, self.statusID) + gobject.idle_add(self.set_status, language["disconnecting_active"]) + gobject.idle_add(self.status_area.show_all) + self.wait_for_events() + self._connect_thread_started = False + if nettype == "wireless": if not self.check_encryption_valid(networkid, networkentry.advanced_dialog): self.edit_advanced(None, nettype, networkid, networkentry) return False + setup_interface_for_connection() wireless.ConnectWireless(networkid, reply_handler=handler, error_handler=handler) elif nettype == "wired": + setup_interface_for_connection() wired.ConnectWired(reply_handler=handler, error_handler=handler) gobject.source_remove(self.update_cb) From fa626d2ac455519e753fa76344c762be22c8f120 Mon Sep 17 00:00:00 2001 From: Andrew Psaltis Date: Fri, 19 Jun 2009 17:29:25 -0400 Subject: [PATCH 145/186] Made wicd-curses.py spit out an error if a dbus access denied error appears on startup. --- curses/wicd-curses.py | 16 +++++++++++++--- 1 file changed, 13 insertions(+), 3 deletions(-) diff --git a/curses/wicd-curses.py b/curses/wicd-curses.py index 042a224..fdce9ce 100755 --- a/curses/wicd-curses.py +++ b/curses/wicd-curses.py @@ -38,7 +38,6 @@ at least get a network connection. Or those who don't like using X. ;-) import warnings warnings.filterwarnings("ignore","The popen2 module is deprecated. Use the subprocess module.") # UI stuff -# This library is the only reason why I wrote this program. import urwid # DBus communication stuff @@ -64,6 +63,7 @@ import netentry_curses from netentry_curses import WirelessSettingsDialog, WiredSettingsDialog,AdvancedSettingsDialog from optparse import OptionParser +from os import system # Stuff about getting the script configurer running #from grp import getgrgid @@ -72,7 +72,7 @@ from optparse import OptionParser #import logging #import logging.handler -CURSES_REVNO=wpath.curses_revision +CURSES_REV=wpath.curses_revision # Fix strings in wicd-curses from wicd.translations import language @@ -1047,7 +1047,17 @@ setup_dbus() ##### MAIN ENTRY POINT ######################################## if __name__ == '__main__': - parser = OptionParser(version="wicd-curses-%s (using wicd %s)" % (CURSES_REVNO,daemon.Hello())) + try: + parser = OptionParser(version="wicd-curses-%s (using wicd %s)" % (CURSES_REV,daemon.Hello())) + except Exception as ex: + if "Rejected send message" in ex.args[0]: + print "" + system("\ +echo ERROR: wicd-curses was denied access to the wicd daemon, make sure that \ +your user is in the group \\'$(tput bold)$(tput setaf 4)"+ wpath.wicd_group+"$(tput sgr0)\\'.") + sys.exit(1) + else: + raise parser.set_defaults(screen='raw',debug=False) parser.add_option("-r", "--raw-screen",action="store_const",const='raw' ,dest='screen',help="use urwid's raw screen controller (default)") From 94e02277f35ea98b32de7271d3bed5996c5f6fda Mon Sep 17 00:00:00 2001 From: Andrew Psaltis Date: Fri, 19 Jun 2009 18:48:39 -0400 Subject: [PATCH 146/186] Updated wicd-curses to use DBusException.get_dbus_name() instead of the exception arguments. --- curses/wicd-curses.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/curses/wicd-curses.py b/curses/wicd-curses.py index fdce9ce..b06202a 100755 --- a/curses/wicd-curses.py +++ b/curses/wicd-curses.py @@ -1049,11 +1049,11 @@ setup_dbus() if __name__ == '__main__': try: parser = OptionParser(version="wicd-curses-%s (using wicd %s)" % (CURSES_REV,daemon.Hello())) - except Exception as ex: - if "Rejected send message" in ex.args[0]: + except Exception as e: + if "DBus.Error.AccessDenied" in e.get_dbus_name(): print "" system("\ -echo ERROR: wicd-curses was denied access to the wicd daemon, make sure that \ +echo ERROR: wicd-curses was denied access to the wicd daemon, please check that \ your user is in the group \\'$(tput bold)$(tput setaf 4)"+ wpath.wicd_group+"$(tput sgr0)\\'.") sys.exit(1) else: From 1142a1d084e6cd2eda9921bb18ed5fd6b6652287 Mon Sep 17 00:00:00 2001 From: Andrew Psaltis Date: Fri, 19 Jun 2009 18:59:30 -0400 Subject: [PATCH 147/186] Fixed wicd-client to actually show the error dialog, by checking e.get_dbus_name() instead of just e. --- wicd/wicd-client.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/wicd/wicd-client.py b/wicd/wicd-client.py index 97f3095..c7b9114 100755 --- a/wicd/wicd-client.py +++ b/wicd/wicd-client.py @@ -86,9 +86,10 @@ def catchdbus(func): def wrapper(*args, **kwargs): try: return func(*args, **kwargs) - except DBusException, e: - if "DBus.Error.AccessDenied" in e: + except DBusException as e: + if e.get_dbus_name() != None and "DBus.Error.AccessDenied" in e.get_dbus_name(): error(None, language['access_denied']) + #raise raise DBusException(e) else: print "warning: ignoring exception %s" % e From 5eee87cf80b400f57bd4fa290bb8abda77f5c8e0 Mon Sep 17 00:00:00 2001 From: Andrew Psaltis Date: Fri, 19 Jun 2009 20:07:10 -0400 Subject: [PATCH 148/186] Use the ANSI escape sequences to print colors instead of fetching them using tput(1) in wicd-curses. --- curses/wicd-curses.py | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/curses/wicd-curses.py b/curses/wicd-curses.py index b06202a..691b402 100755 --- a/curses/wicd-curses.py +++ b/curses/wicd-curses.py @@ -1051,10 +1051,9 @@ if __name__ == '__main__': parser = OptionParser(version="wicd-curses-%s (using wicd %s)" % (CURSES_REV,daemon.Hello())) except Exception as e: if "DBus.Error.AccessDenied" in e.get_dbus_name(): - print "" - system("\ + print "\ echo ERROR: wicd-curses was denied access to the wicd daemon, please check that \ -your user is in the group \\'$(tput bold)$(tput setaf 4)"+ wpath.wicd_group+"$(tput sgr0)\\'.") +your user is in the group \'\033[1;34m"+ wpath.wicd_group+"\033[0m\'." sys.exit(1) else: raise From e10969637a60a2077fbaf62f0a56530a4028bbbf Mon Sep 17 00:00:00 2001 From: Andrew Psaltis Date: Fri, 19 Jun 2009 23:03:42 -0400 Subject: [PATCH 149/186] Made the wicd-curses "access denied" string translatable, and updated wicd-curses.py to use it. --- curses/wicd-curses.py | 4 +--- wicd/translations.py | 3 ++- 2 files changed, 3 insertions(+), 4 deletions(-) diff --git a/curses/wicd-curses.py b/curses/wicd-curses.py index 691b402..659b880 100755 --- a/curses/wicd-curses.py +++ b/curses/wicd-curses.py @@ -1051,9 +1051,7 @@ if __name__ == '__main__': parser = OptionParser(version="wicd-curses-%s (using wicd %s)" % (CURSES_REV,daemon.Hello())) except Exception as e: if "DBus.Error.AccessDenied" in e.get_dbus_name(): - print "\ -echo ERROR: wicd-curses was denied access to the wicd daemon, please check that \ -your user is in the group \'\033[1;34m"+ wpath.wicd_group+"\033[0m\'." + print language['access_denied_wc'].replace('$A','\033[1;34m'+wpath.wicd_group+'\033[0m') sys.exit(1) else: raise diff --git a/wicd/translations.py b/wicd/translations.py index 77d232d..ef1206d 100644 --- a/wicd/translations.py +++ b/wicd/translations.py @@ -55,7 +55,7 @@ def get_gettext(): _ = lang.gettext return _ -# Generated automatically on Fri, 05 Jun 2009 03:13:27 CDT +# Generated automatically on Fri, 19 Jun 2009 21:59:18 CDT _ = get_gettext() language = {} language['resetting_ip_address'] = _('''Resetting IP address...''') @@ -216,3 +216,4 @@ language['establishing_connection'] = _('''Establishing connection...''') language['association_failed'] = _('''Connection failed: Could not contact the wireless access point.''') language['access_denied'] = _('''Unable to contact the Wicd daemon due to an access denied error from DBus. Please check your DBus configuration.''') language['disconnecting_active'] = _('''Disconnecting active connections...''') +language['access_denied_wc'] = _('''ERROR: wicd-curses was denied access to the wicd daemon, please check that your user is in the group "$A".''') From 1e97b34205164a320bce7d5783a9df0aa31f786a Mon Sep 17 00:00:00 2001 From: Adam Blackburn Date: Fri, 19 Jun 2009 22:08:32 -0500 Subject: [PATCH 150/186] seperated chmod and chown try/excepts --- wicd/wicd-daemon.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/wicd/wicd-daemon.py b/wicd/wicd-daemon.py index 3488483..a04a3d4 100644 --- a/wicd/wicd-daemon.py +++ b/wicd/wicd-daemon.py @@ -1672,12 +1672,16 @@ def main(argv): if os.path.exists(logpath): try: os.chmod(logpath, wpath.log_perms) + except: + print 'unable to chmod log file to %s' % wpath.log_perms + + try: if wpath.log_group: import grp group = grp.getgrnam(wpath.log_group) os.chown(logpath, 0, group[2]) except: - print 'unable to chmod log file to %s' % wpath.log_perms + print 'unable to chown log file to %s' % group[2] if redirect_stdout: sys.stdout = output if redirect_stderr: sys.stderr = output From 340f84613aed2d3d5992edac20eb8623e2e7b5e1 Mon Sep 17 00:00:00 2001 From: Adam Blackburn Date: Sat, 20 Jun 2009 07:58:15 -0500 Subject: [PATCH 151/186] fix crash resulting from encryption info missing when connecting --- wicd/gui.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/wicd/gui.py b/wicd/gui.py index 03da45b..2c426f9 100644 --- a/wicd/gui.py +++ b/wicd/gui.py @@ -642,7 +642,7 @@ class appGui(object): for entry_info in encryption_info.itervalues(): if entry_info[0].entry.get_text() == "" and \ entry_info[1] == 'required': - error(self, "%s (%s)" % (language['encrypt_info_missing'], + error(self.window, "%s (%s)" % (language['encrypt_info_missing'], entry_info[0].label.get_label()) ) return False From 96a7d07bca6dba459d32791872d18e7acd05a1df Mon Sep 17 00:00:00 2001 From: Adam Blackburn Date: Sat, 20 Jun 2009 13:42:21 -0500 Subject: [PATCH 152/186] return 101 as the signal strength if altstrenth_pattern fails to find the strength --- wicd/wnettools.py | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/wicd/wnettools.py b/wicd/wnettools.py index 65a2018..ac6d1c8 100644 --- a/wicd/wnettools.py +++ b/wicd/wnettools.py @@ -1366,7 +1366,14 @@ class BaseWirelessInterface(BaseInterface): (strength, max_strength) = (None, None) if strength in ['', None]: - [(strength, max_strength)] = altstrength_pattern.findall(output) + try: + [(strength, max_strength)] = altstrength_pattern.findall(output) + except ValueError: + # if the pattern was unable to match anything + # we'll return 101, which will allow us to stay + # connected even though we don't know the strength + # it also allows us to tell if + return 101 if strength not in ['', None] and max_strength: return (100 * int(strength) // int(max_strength)) elif strength not in ["", None]: From c93f3696bc08c699f50b9a0c699336d05e8e4fc9 Mon Sep 17 00:00:00 2001 From: Adam Blackburn Date: Sat, 20 Jun 2009 14:40:30 -0500 Subject: [PATCH 153/186] update FormatSignalForPrinting to return ??% instead of 101% --- wicd/wicd-daemon.py | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/wicd/wicd-daemon.py b/wicd/wicd-daemon.py index 24289ed..cf180d2 100644 --- a/wicd/wicd-daemon.py +++ b/wicd/wicd-daemon.py @@ -309,7 +309,13 @@ class WicdDaemon(dbus.service.Object): if self.GetSignalDisplayType() == 1: return (signal + " dBm") else: - return (signal + "%") + try: + if int(signal) == 101: + return '??%' + else: + return (signal + "%") + except ValueError: + return (signal + "%") @dbus.service.method('org.wicd.daemon') def SetSuspend(self, val): From 9ec96c1254484ebc9eb2900d12f53f6325920a73 Mon Sep 17 00:00:00 2001 From: Andrew Psaltis Date: Sat, 20 Jun 2009 21:41:17 -0400 Subject: [PATCH 154/186] Restore python 2.5 compatibility in both clients. --- curses/wicd-curses.py | 2 +- wicd/wicd-client.py | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/curses/wicd-curses.py b/curses/wicd-curses.py index 659b880..84fbdc9 100755 --- a/curses/wicd-curses.py +++ b/curses/wicd-curses.py @@ -1049,7 +1049,7 @@ setup_dbus() if __name__ == '__main__': try: parser = OptionParser(version="wicd-curses-%s (using wicd %s)" % (CURSES_REV,daemon.Hello())) - except Exception as e: + except Exception, e: if "DBus.Error.AccessDenied" in e.get_dbus_name(): print language['access_denied_wc'].replace('$A','\033[1;34m'+wpath.wicd_group+'\033[0m') sys.exit(1) diff --git a/wicd/wicd-client.py b/wicd/wicd-client.py index c7b9114..6cc453b 100755 --- a/wicd/wicd-client.py +++ b/wicd/wicd-client.py @@ -86,7 +86,7 @@ def catchdbus(func): def wrapper(*args, **kwargs): try: return func(*args, **kwargs) - except DBusException as e: + except DBusException, e: if e.get_dbus_name() != None and "DBus.Error.AccessDenied" in e.get_dbus_name(): error(None, language['access_denied']) #raise From 5fa03d54aa2470eecde25aad8a55878a3eb3b71b Mon Sep 17 00:00:00 2001 From: Adam Blackburn Date: Sat, 20 Jun 2009 21:59:45 -0500 Subject: [PATCH 155/186] updated translations.py --- wicd/translations.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/wicd/translations.py b/wicd/translations.py index 695a1c1..e5d1092 100644 --- a/wicd/translations.py +++ b/wicd/translations.py @@ -55,7 +55,7 @@ def get_gettext(): _ = lang.gettext return _ -# Generated automatically on Sat, 20 Jun 2009 21:40:39 CDT +# Generated automatically on Sat, 20 Jun 2009 21:58:21 CDT _ = get_gettext() language = {} language['resetting_ip_address'] = _('''Resetting IP address...''') @@ -74,7 +74,7 @@ language['wired_networks'] = _('''Wired Networks''') language['backend_alert'] = _('''Changes to your backend won't occur until the daemon is restarted.''') language['about_help'] = _('''Stop a network connection in progress''') language['connecting'] = _('''Connecting''') -language['disconnect_script'] = _('''Run disconnect script''') +language['pre_disconnect_script'] = _('''Run pre-disconnect script''') language['cannot_edit_scripts_1'] = _('''To avoid various complications, wicd-curses does not support directly editing the scripts directly. However, you can edit them manually. First, (as root)", open the "$A" config file, and look for the section labeled by the $B in question. In this case, this is:''') language['cannot_edit_scripts_3'] = _('''You can also configure the wireless networks by looking for the "[]" field in the config file.''') language['cannot_edit_scripts_2'] = _('''Once there, you can adjust (or add) the "beforescript", "afterscript", and "disconnectscript" variables as needed, to change the preconnect, postconnect, and disconnect scripts respectively. Note that you will be specifying the full path to the scripts - not the actual script contents. You will need to add/edit the script contents separately. Refer to the wicd manual page for more information.''') @@ -217,3 +217,4 @@ language['association_failed'] = _('''Connection failed: Could not contact the w language['access_denied'] = _('''Unable to contact the Wicd daemon due to an access denied error from DBus. Please check your DBus configuration.''') language['disconnecting_active'] = _('''Disconnecting active connections...''') language['access_denied_wc'] = _('''ERROR: wicd-curses was denied access to the wicd daemon: please check that your user is in the "$A" group.''') +language['post_disconnect_script'] = _('''Run post-disconnect script''') From 868f5bb328059892735c9592c464008de4f8850d Mon Sep 17 00:00:00 2001 From: Andrew Psaltis Date: Sat, 20 Jun 2009 23:46:38 -0400 Subject: [PATCH 156/186] Fix the log file chmodding (os.chmod() can't accept a string, apparently). --- wicd/wicd-daemon.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/wicd/wicd-daemon.py b/wicd/wicd-daemon.py index 2c17100..2274b57 100644 --- a/wicd/wicd-daemon.py +++ b/wicd/wicd-daemon.py @@ -1684,7 +1684,7 @@ def main(argv): output = ManagedStdio(logpath) if os.path.exists(logpath): try: - os.chmod(logpath, wpath.log_perms) + os.chmod(logpath, int(wpath.log_perms,8)) except: print 'unable to chmod log file to %s' % wpath.log_perms From 42caa8af87091e68ecbb2302957d1af0bfa00a6e Mon Sep 17 00:00:00 2001 From: Adam Blackburn Date: Sat, 20 Jun 2009 23:02:23 -0500 Subject: [PATCH 157/186] updated setup.py version and CHANGES --- CHANGES | 279 +++++++++++++++++++++++++++++++++++++++++++++++++++++++ setup.py | 2 +- 2 files changed, 280 insertions(+), 1 deletion(-) diff --git a/CHANGES b/CHANGES index 8946d49..e187896 100644 --- a/CHANGES +++ b/CHANGES @@ -1,4 +1,283 @@ ------------------------------------------------------------ +revno: 425 +committer: Andrew Psaltis +branch nick: 1.6 +timestamp: Sat 2009-06-20 23:46:38 -0400 +message: + Fix the log file chmodding (os.chmod() can't accept a string, apparently). +------------------------------------------------------------ +revno: 424 +committer: Adam Blackburn +branch nick: 1.6 +timestamp: Sat 2009-06-20 21:59:45 -0500 +message: + updated translations.py +------------------------------------------------------------ +revno: 423 +committer: Adam Blackburn +branch nick: 1.6 +timestamp: Sat 2009-06-20 21:44:32 -0500 +message: + merged lp:~nacl/wicd/1.6-access-denied to display an error message if access to the daemon via DBus is denied + ------------------------------------------------------------ + revno: 417.2.6 + committer: Andrew Psaltis + branch nick: 1.6-access-denied + timestamp: Sat 2009-06-20 21:41:17 -0400 + message: + Restore python 2.5 compatibility in both clients. + ------------------------------------------------------------ + revno: 417.2.5 + committer: Andrew Psaltis + branch nick: 1.6-access-denied + timestamp: Fri 2009-06-19 23:03:42 -0400 + message: + Made the wicd-curses "access denied" string translatable, and updated wicd-curses.py to use it. + ------------------------------------------------------------ + revno: 417.2.4 + committer: Andrew Psaltis + branch nick: 1.6-access-denied + timestamp: Fri 2009-06-19 20:07:10 -0400 + message: + Use the ANSI escape sequences to print colors instead of fetching them using tput(1) in wicd-curses. + ------------------------------------------------------------ + revno: 417.2.3 + committer: Andrew Psaltis + branch nick: 1.6-access-denied + timestamp: Fri 2009-06-19 18:59:30 -0400 + message: + Fixed wicd-client to actually show the error dialog, by checking e.get_dbus_name() instead of just e. + ------------------------------------------------------------ + revno: 417.2.2 + committer: Andrew Psaltis + branch nick: 1.6-access-denied + timestamp: Fri 2009-06-19 18:48:39 -0400 + message: + Updated wicd-curses to use DBusException.get_dbus_name() instead of the exception arguments. + ------------------------------------------------------------ + revno: 417.2.1 + committer: Andrew Psaltis + branch nick: 1.6-access-denied + timestamp: Fri 2009-06-19 17:29:25 -0400 + message: + Made wicd-curses.py spit out an error if a dbus access denied error appears on startup. +------------------------------------------------------------ +revno: 422 +committer: Adam Blackburn +branch nick: 1.6 +timestamp: Sat 2009-06-20 19:25:10 -0500 +message: + merged lp:~adamblackburn/wicd/1.6-return-101-if-no-strength to allow cards that don't report signal strength to work with Wicd's default settings + ------------------------------------------------------------ + revno: 418.1.2 + committer: Adam Blackburn + branch nick: 1.6 + timestamp: Sat 2009-06-20 14:40:30 -0500 + message: + update FormatSignalForPrinting to return ??% instead of 101% + ------------------------------------------------------------ + revno: 418.1.1 + committer: Adam Blackburn + branch nick: 1.6 + timestamp: Sat 2009-06-20 13:42:21 -0500 + message: + return 101 as the signal strength if altstrenth_pattern fails to find the strength +------------------------------------------------------------ +revno: 421 +committer: Adam Blackburn +branch nick: 1.6 +timestamp: Sat 2009-06-20 19:24:07 -0500 +message: + merged lp:~dpaleino/wicd/pre-post-down to allow having pre/post disconnection scripts + ------------------------------------------------------------ + revno: 415.2.1 + committer: David Paleino + branch nick: wicd + timestamp: Tue 2009-06-16 17:13:41 +0200 + message: + Provide a pre-/post-down script mechanism + + WICD currently only provides pre-/post-connection scripts, and + only one disconnection script, that is run before actually + disconnecting. This provides pre-/post-disconnection scripts, + thus increasing configuration flexibility. +------------------------------------------------------------ +revno: 420 +committer: Adam Blackburn +branch nick: 1.6 +timestamp: Sat 2009-06-20 19:22:36 -0500 +message: + merged lp:~adamblackburn/wicd/loggroup to allow passing the preferred log group and permissions to setup.py configure -- thanks to David Paleino + ------------------------------------------------------------ + revno: 412.3.6 + committer: Adam Blackburn + branch nick: loggroup + timestamp: Fri 2009-06-19 22:08:32 -0500 + message: + seperated chmod and chown try/excepts + ------------------------------------------------------------ + revno: 412.3.5 + committer: Adam Blackburn + branch nick: loggroup + timestamp: Tue 2009-06-16 23:57:02 +0800 + message: + added forgotten underscores + ------------------------------------------------------------ + revno: 412.3.4 + committer: Adam Blackburn + branch nick: loggroup + timestamp: Tue 2009-06-16 23:22:40 +0800 + message: + removed wicd-daemon.py from .bzrignore + ------------------------------------------------------------ + revno: 412.3.3 + committer: Adam Blackburn + branch nick: loggroup + timestamp: Tue 2009-06-16 23:15:05 +0800 + message: + merge 1.6 r415 + ------------------------------------------------------------ + revno: 412.3.2 + committer: Adam Blackburn + branch nick: loggroup + timestamp: Tue 2009-06-16 23:08:52 +0800 + message: + moved wicd-daemon.py back to wicd/ and changed wpath replacement values to use the wpath module + ------------------------------------------------------------ + revno: 412.3.1 + committer: David Paleino + branch nick: wicd + timestamp: Sat 2009-06-13 22:59:03 +0200 + message: + Support --loggroup and --logperms arguments to setup.py +------------------------------------------------------------ +revno: 419 +committer: Adam Blackburn +branch nick: 1.6 +timestamp: Sat 2009-06-20 19:20:42 -0500 +message: + merged lp:~adamblackburn/wicd/1.6-cancel-edit-settings to allow canceling the edit settings dialog that appears when attempting to connect to an encrypted network without entering the encryption details + ------------------------------------------------------------ + revno: 417.1.2 + committer: Adam Blackburn + branch nick: 1.6 + timestamp: Sat 2009-06-20 07:58:15 -0500 + message: + fix crash resulting from encryption info missing when connecting + ------------------------------------------------------------ + revno: 417.1.1 + committer: Adam Blackburn + branch nick: 1.6 + timestamp: Thu 2009-06-18 15:16:29 +0800 + message: + allow user to cancel preferences dialog if they chose not to connect after clicking connect and showing the preferences dialog +------------------------------------------------------------ +revno: 418 +committer: Adam Blackburn +branch nick: 1.6 +timestamp: Sat 2009-06-20 10:33:23 -0500 +message: + merged David Paleino's Debian init script that includes a status command + ------------------------------------------------------------ + revno: 415.1.1 + committer: David Paleino + branch nick: wicd + timestamp: Tue 2009-06-16 17:56:21 +0200 + message: + Add "status" to /etc/init.d/wicd (Debian/Ubuntu) +------------------------------------------------------------ +revno: 417 +committer: Adam Blackburn +branch nick: 1.6 +timestamp: Thu 2009-06-18 14:56:25 +0800 +message: + fixed crash that occured when clicking to connect to a secured network but without entering the security information +------------------------------------------------------------ +revno: 416 +committer: Adam Blackburn +branch nick: 1.6 +timestamp: Tue 2009-06-16 23:36:58 +0800 +message: + fix a small typo in misc.py -- thanks to David Paleino +------------------------------------------------------------ +revno: 415 +committer: Adam Blackburn +branch nick: 1.6 +timestamp: Tue 2009-06-16 07:44:27 +0800 +message: + disable automatically disconnecting when Automatically reconnect is False +------------------------------------------------------------ +revno: 414 +committer: Dan O'Reilly +branch nick: trunk +timestamp: Sun 2009-06-14 14:27:21 -0400 +message: + Merge. + ------------------------------------------------------------ + revno: 412.2.1 + committer: Adam Blackburn + branch nick: 1.6 + timestamp: Sun 2009-06-14 12:27:36 +0800 + message: + merged David's Debian patches branch + ------------------------------------------------------------ + revno: 412.1.3 + committer: David Paleino + branch nick: wicd + timestamp: Sat 2009-06-13 22:07:49 +0200 + message: + Support udhcpc, this is needed to smoothly run on the OpenMoko FreeRunner. + + Thanks to Luca Capello for porting the patch to 1.5.9, and + to "madmo" from the linked forum for making the patch. + + Patch originally taken from http://wicd.net/punbb/viewtopic.php?id=132 + + Patch ported to 1.6.0 code by David Paleino . + ------------------------------------------------------------ + revno: 412.1.2 + committer: David Paleino + branch nick: wicd + timestamp: Sat 2009-06-13 22:06:08 +0200 + message: + Update manpage with an appropriate WHATIS entry + ------------------------------------------------------------ + revno: 412.1.1 + committer: David Paleino + branch nick: wicd + timestamp: Sat 2009-06-13 22:05:10 +0200 + message: + Remove deprecated Encoding field +------------------------------------------------------------ +revno: 413 +committer: Dan O'Reilly +branch nick: trunk +timestamp: Sun 2009-06-14 14:25:06 -0400 +message: + Convert strings being prints out by dhclients to utf-8 before trying to log them. + When iwscan displays two entries for a hidden network, only display the one with the essid included. +------------------------------------------------------------ +revno: 412 +committer: Adam Blackburn +branch nick: wicd +timestamp: Tue 2009-06-09 13:25:02 +0800 +message: + display the ESSID/Wired Network in the title of the settings dialog +------------------------------------------------------------ +revno: 411 +committer: Adam Blackburn +branch nick: 1.6 +timestamp: Fri 2009-06-05 16:13:38 +0800 +message: + Updated translations.py +------------------------------------------------------------ +revno: 410 +committer: Adam Blackburn +branch nick: 1.6 +timestamp: Fri 2009-06-05 15:20:58 +0800 +message: + updated CHANGES +------------------------------------------------------------ revno: 409 committer: Adam Blackburn branch nick: 1.6 diff --git a/setup.py b/setup.py index ca9017c..ee9feb2 100755 --- a/setup.py +++ b/setup.py @@ -26,7 +26,7 @@ import subprocess # Be sure to keep this updated! # VERSIONNUMBER -VERSION_NUM = '1.6.0' +VERSION_NUM = '1.6.1' # REVISION_NUM is automatically updated REVISION_NUM = 'unknown' CURSES_REVNO = 'uimod' From 6d1f75f5521161046a99a20898206272a8c47d4f Mon Sep 17 00:00:00 2001 From: Andrew Psaltis Date: Sun, 21 Jun 2009 14:45:44 -0400 Subject: [PATCH 158/186] Fix typo that crashes wicd-curses on attempting to bring up the help dialog. --- curses/wicd-curses.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/curses/wicd-curses.py b/curses/wicd-curses.py index 34d52ff..63fb43d 100755 --- a/curses/wicd-curses.py +++ b/curses/wicd-curses.py @@ -202,7 +202,7 @@ def about_dialog(body): # Modeled after htop's help def help_dialog(body): textT = urwid.Text(('header','wicd-curses help'),'right') - textSH = urwid.Text(['This is ',('blue','wicd-curses-'+CURSES_REVNO),' using wicd ',unicode(daemon.Hello()),'\n']) + textSH = urwid.Text(['This is ',('blue','wicd-curses-'+CURSES_REV),' using wicd ',unicode(daemon.Hello()),'\n']) textH = urwid.Text([ "For more detailed help, consult the wicd-curses(8) man page.\n", From 1cd377f15f396835ccd5f7126a9d7988f5c69f7e Mon Sep 17 00:00:00 2001 From: Andrew Psaltis Date: Wed, 24 Jun 2009 18:44:29 -0400 Subject: [PATCH 159/186] Do nothing in wicd-curses if there are no networks present. --- curses/wicd-curses.py | 21 +++++---------------- 1 file changed, 5 insertions(+), 16 deletions(-) diff --git a/curses/wicd-curses.py b/curses/wicd-curses.py index 63fb43d..9799a7f 100755 --- a/curses/wicd-curses.py +++ b/curses/wicd-curses.py @@ -821,18 +821,16 @@ class appGUI(): self.diag.ready_widgets(ui,self.frame) self.frame.set_body(self.diag) self.diag_type = 'conf' - # Guess what! I actually need to put this here, else I'll have - # tons of references to self.frame lying around. ^_^ - if "enter" in keys: + if "enter" in keys or 'C' in keys: focus = self.frame.body.get_focus() if focus == self.wiredCB: self.special = focus self.connect("wired",0) else: - # wless list only other option - wid,pos = self.thePile.get_focus().get_focus() - self.connect("wireless",pos) - + # wless list only other option, if it is around + if self.wlessLB != self.no_wlan: + wid,pos = self.thePile.get_focus().get_focus() + self.connect("wireless",pos) if "esc" in keys: # Force disconnect here if connection in progress if self.connecting: @@ -853,15 +851,6 @@ class appGUI(): return True if "A" in keys: about_dialog(self.frame) - if "C" in keys: - focus = self.frame.body.get_focus() - if focus == self.wiredCB: - self.special = focus - self.connect("wired",0) - else: - # wless list only other option - wid,pos = self.thePile.get_focus().get_focus() - self.connect("wireless",pos) if "I" in keys: self.raise_hidden_network_dialog() if "H" in keys or 'h' in keys or '?' in keys: From 5f14b7a7fab3ec4ac0d05dfe2791c60acee59539 Mon Sep 17 00:00:00 2001 From: Andrew Psaltis Date: Wed, 24 Jun 2009 19:10:30 -0400 Subject: [PATCH 160/186] Do nothing if the user makes a connection attempt while scanning. --- curses/wicd-curses.py | 19 ++++++++++--------- 1 file changed, 10 insertions(+), 9 deletions(-) diff --git a/curses/wicd-curses.py b/curses/wicd-curses.py index 9799a7f..da1b1f4 100755 --- a/curses/wicd-curses.py +++ b/curses/wicd-curses.py @@ -822,15 +822,16 @@ class appGUI(): self.frame.set_body(self.diag) self.diag_type = 'conf' if "enter" in keys or 'C' in keys: - focus = self.frame.body.get_focus() - if focus == self.wiredCB: - self.special = focus - self.connect("wired",0) - else: - # wless list only other option, if it is around - if self.wlessLB != self.no_wlan: - wid,pos = self.thePile.get_focus().get_focus() - self.connect("wireless",pos) + if not self.scanning: + focus = self.frame.body.get_focus() + if focus == self.wiredCB: + self.special = focus + self.connect("wired",0) + else: + # wless list only other option, if it is around + if self.wlessLB != self.no_wlan: + wid,pos = self.thePile.get_focus().get_focus() + self.connect("wireless",pos) if "esc" in keys: # Force disconnect here if connection in progress if self.connecting: From 289f32d38739f226fbbc1949239ae29a57954f03 Mon Sep 17 00:00:00 2001 From: Andrew Psaltis Date: Tue, 30 Jun 2009 21:51:33 -0400 Subject: [PATCH 161/186] Fix a small unicode problem in wicd-curses that caused a crash in Debian Lenny. --- curses/wicd-curses.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/curses/wicd-curses.py b/curses/wicd-curses.py index da1b1f4..4a0c041 100755 --- a/curses/wicd-curses.py +++ b/curses/wicd-curses.py @@ -145,7 +145,7 @@ def check_for_wireless(iwconfig, wireless_ip, set_status): if not network: return False - network = str(network) + network = unicode(network) if daemon.GetSignalDisplayType() == 0: strength = wireless.GetCurrentSignalStrength(iwconfig) else: From 2e650c7a44e2cf74632fc41504c33fcbef0ce5ba Mon Sep 17 00:00:00 2001 From: Andrew Psaltis Date: Tue, 30 Jun 2009 22:43:17 -0400 Subject: [PATCH 162/186] Background wicd's startup in Slackware's initscript. --- in/init=slackware=rc.wicd.in | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/in/init=slackware=rc.wicd.in b/in/init=slackware=rc.wicd.in index 10b3317..69c3f77 100755 --- a/in/init=slackware=rc.wicd.in +++ b/in/init=slackware=rc.wicd.in @@ -16,8 +16,8 @@ wicd_start() { echo "$PIDFILE and try again..." exit 1 else - echo "Starting wicd daemon: $DAEMON" - wicd 2>/dev/null 1>&2 + echo "Starting wicd daemon: $DAEMON &" + wicd 2>/dev/null 1>&2 & fi } From 27f2890c12e1de289628cca24702c3d4a80efd7f Mon Sep 17 00:00:00 2001 From: Dan O'Reilly Date: Thu, 2 Jul 2009 16:50:48 -0400 Subject: [PATCH 163/186] Fix crash when trying to create an ad-hoc network. --- wicd/networking.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/wicd/networking.py b/wicd/networking.py index c9eb8ca..13ec635 100644 --- a/wicd/networking.py +++ b/wicd/networking.py @@ -719,7 +719,7 @@ class Wireless(Controller): wiface = self.wiface print 'Creating ad-hoc network' print 'Stopping dhcp client and wpa_supplicant' - BACKEND.ReleaseDHCP() + wiface.ReleaseDHCP() wiface.StopWPA() print 'Putting wireless interface down' wiface.Down() From 6cedaf01993a4565a30566fba151774ebd7b2e44 Mon Sep 17 00:00:00 2001 From: Dan O'Reilly Date: Thu, 2 Jul 2009 18:26:37 -0400 Subject: [PATCH 164/186] Make sure we run to_unicode on all properties we read from disk or get from the user (bug 390680). Don't try to run global scripts of the global script directory doesn't exist (bug 386244). --- wicd/configmanager.py | 2 +- wicd/misc.py | 2 ++ wicd/wicd-daemon.py | 8 ++++---- 3 files changed, 7 insertions(+), 5 deletions(-) diff --git a/wicd/configmanager.py b/wicd/configmanager.py index 8862bc8..c61faff 100644 --- a/wicd/configmanager.py +++ b/wicd/configmanager.py @@ -116,7 +116,7 @@ class ConfigManager(RawConfigParser): Int32(ret) except OverflowError: ret = long(ret) - return ret + return to_unicode(ret) def get(self, *args, **kargs): """ Calls the get_option method """ diff --git a/wicd/misc.py b/wicd/misc.py index bc5a2bd..64a877d 100644 --- a/wicd/misc.py +++ b/wicd/misc.py @@ -182,6 +182,8 @@ def WriteLine(my_file, text): def ExecuteScripts(scripts_dir, verbose=False): """ Execute every executable file in a given directory. """ + if not os.path.exists(scripts_dir): + return for obj in os.listdir(scripts_dir): obj = os.path.abspath(os.path.join(scripts_dir, obj)) if os.path.isfile(obj) and os.access(obj, os.X_OK): diff --git a/wicd/wicd-daemon.py b/wicd/wicd-daemon.py index 2274b57..ae38208 100644 --- a/wicd/wicd-daemon.py +++ b/wicd/wicd-daemon.py @@ -1055,14 +1055,14 @@ class WirelessDaemon(dbus.service.Object): return value @dbus.service.method('org.wicd.daemon.wireless') - def SetWirelessProperty(self, networkid, property, value): + def SetWirelessProperty(self, netid, prop, value): """ Sets property to value in network specified. """ # We don't write script settings here. - if (property.strip()).endswith("script"): + if (prop.strip()).endswith("script"): print "Setting script properties through the daemon is not" \ + " permitted." return False - self.LastScan[networkid][property] = misc.Noneify(value) + self.LastScan[netid][prop] = misc.to_unicode(misc.Noneify(value)) @dbus.service.method('org.wicd.daemon.wireless') def DetectWirelessInterface(self): @@ -1373,7 +1373,7 @@ class WiredDaemon(dbus.service.Object): print "Setting script properties through the daemon" \ + " is not permitted." return False - self.WiredNetwork[property] = misc.Noneify(value) + self.WiredNetwork[property] = misc.to_unicode(misc.Noneify(value)) return True else: print 'SetWiredProperty: WiredNetwork does not exist' From fe18999be8b59a8faee15fa116b74d55cfbe7d72 Mon Sep 17 00:00:00 2001 From: Adam Blackburn Date: Sun, 5 Jul 2009 08:16:59 -1000 Subject: [PATCH 165/186] check to see if the interface exists in the decorator --- wicd/wnettools.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/wicd/wnettools.py b/wicd/wnettools.py index ac6d1c8..a94617d 100644 --- a/wicd/wnettools.py +++ b/wicd/wnettools.py @@ -171,7 +171,8 @@ def neediface(default_response): """ def wrapper(func): def newfunc(self, *args, **kwargs): - if not self.iface: + if not self.iface or \ + not os.path.exists('/sys/class/net/%s' % self.iface): return default_response return func(self, *args, **kwargs) newfunc.__dict__ = func.__dict__ From fef3063521ca46484e2fa9c720d3aa4bc33c915c Mon Sep 17 00:00:00 2001 From: Andrew Psaltis Date: Sun, 5 Jul 2009 14:42:39 -0400 Subject: [PATCH 166/186] Actually tell the user that he may need to be in wpath.wicd_group if wicd-clientgets an access-denied error. --- wicd/wicd-client.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/wicd/wicd-client.py b/wicd/wicd-client.py index 6cc453b..118c068 100755 --- a/wicd/wicd-client.py +++ b/wicd/wicd-client.py @@ -88,7 +88,7 @@ def catchdbus(func): return func(*args, **kwargs) except DBusException, e: if e.get_dbus_name() != None and "DBus.Error.AccessDenied" in e.get_dbus_name(): - error(None, language['access_denied']) + error(None, language['access_denied'].replace("$A",""+wpath.wicd_group+"")) #raise raise DBusException(e) else: From f7e1075ec9f322327d4e586c0b283f4b8f33c149 Mon Sep 17 00:00:00 2001 From: Adam Blackburn Date: Sun, 5 Jul 2009 08:51:39 -1000 Subject: [PATCH 167/186] updated translations.py --- wicd/translations.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/wicd/translations.py b/wicd/translations.py index e5d1092..3c65f65 100644 --- a/wicd/translations.py +++ b/wicd/translations.py @@ -55,7 +55,7 @@ def get_gettext(): _ = lang.gettext return _ -# Generated automatically on Sat, 20 Jun 2009 21:58:21 CDT +# Generated automatically on Sun, 05 Jul 2009 13:51:18 CDT _ = get_gettext() language = {} language['resetting_ip_address'] = _('''Resetting IP address...''') @@ -214,7 +214,7 @@ language['connection_established'] = _('''Connection established''') language['disconnected'] = _('''Disconnected''') language['establishing_connection'] = _('''Establishing connection...''') language['association_failed'] = _('''Connection failed: Could not contact the wireless access point.''') -language['access_denied'] = _('''Unable to contact the Wicd daemon due to an access denied error from DBus. Please check your DBus configuration.''') +language['access_denied'] = _('''Unable to contact the Wicd daemon due to an access denied error from DBus. Please check that your user is in the $A group.''') language['disconnecting_active'] = _('''Disconnecting active connections...''') language['access_denied_wc'] = _('''ERROR: wicd-curses was denied access to the wicd daemon: please check that your user is in the "$A" group.''') language['post_disconnect_script'] = _('''Run post-disconnect script''') From 33bc2dd489f6d3cb17e1709ac77112b3f0a9f7f0 Mon Sep 17 00:00:00 2001 From: Adam Blackburn Date: Sun, 5 Jul 2009 08:56:26 -1000 Subject: [PATCH 168/186] updated setup.py version number, CHANGES, and NEWS --- CHANGES | 127 +++++++++++++++++++++++++++++++++++++++++++++++++++++++ NEWS | 78 ++++++++++++++++++++-------------- setup.py | 2 +- 3 files changed, 174 insertions(+), 33 deletions(-) diff --git a/CHANGES b/CHANGES index e187896..c386e9b 100644 --- a/CHANGES +++ b/CHANGES @@ -1,4 +1,131 @@ ------------------------------------------------------------ +revno: 434 +committer: Adam Blackburn +branch nick: 1.6 +timestamp: Sun 2009-07-05 08:51:39 -1000 +message: + updated translations.py +------------------------------------------------------------ +revno: 433 +committer: Andrew Psaltis +branch nick: 1.6 +timestamp: Sun 2009-07-05 14:42:39 -0400 +message: + Actually tell the user that he may need to be in wpath.wicd_group if wicd-clientgets an access-denied error. +------------------------------------------------------------ +revno: 432 +committer: Adam Blackburn +branch nick: 1.6 +timestamp: Sun 2009-07-05 08:16:59 -1000 +message: + check to see if the interface exists in the decorator +------------------------------------------------------------ +revno: 431 +committer: Dan O'Reilly +branch nick: trunk +timestamp: Thu 2009-07-02 18:26:37 -0400 +message: + Make sure we run to_unicode on all properties we read from disk or get from the user (bug 390680). + Don't try to run global scripts of the global script directory doesn't exist (bug 386244). +------------------------------------------------------------ +revno: 430 +committer: Dan O'Reilly +branch nick: trunk +timestamp: Thu 2009-07-02 16:50:48 -0400 +message: + Fix crash when trying to create an ad-hoc network. +------------------------------------------------------------ +revno: 429 +committer: Andrew Psaltis +branch nick: 1.6 +timestamp: Tue 2009-06-30 22:58:44 -0400 +message: + Merged r353 of 1.6-nacl. + ------------------------------------------------------------ + revno: 202.2.62 + committer: Andrew Psaltis + branch nick: 1.6-nacl + timestamp: Tue 2009-06-30 22:43:17 -0400 + message: + Background wicd's startup in Slackware's initscript. + ------------------------------------------------------------ + revno: 202.2.61 + committer: Andrew Psaltis + branch nick: 1.6-nacl + timestamp: Tue 2009-06-30 21:51:33 -0400 + message: + Fix a small unicode problem in wicd-curses that caused a crash in Debian Lenny. +------------------------------------------------------------ +revno: 428 +committer: Andrew Psaltis +branch nick: 1.6 +timestamp: Wed 2009-06-24 19:14:43 -0400 +message: + Merge bugfixes from r351 of 1.6-nacl, thanks to comfrey in #wicd for noticing them. + ------------------------------------------------------------ + revno: 202.2.60 + committer: Andrew Psaltis + branch nick: 1.6-nacl + timestamp: Wed 2009-06-24 19:10:30 -0400 + message: + Do nothing if the user makes a connection attempt while scanning. + ------------------------------------------------------------ + revno: 202.2.59 + committer: Andrew Psaltis + branch nick: 1.6-nacl + timestamp: Wed 2009-06-24 18:44:29 -0400 + message: + Do nothing in wicd-curses if there are no networks present. + ------------------------------------------------------------ + revno: 202.2.58 + committer: Andrew Psaltis + branch nick: 1.6-nacl + timestamp: Wed 2009-06-24 18:43:58 -0400 + message: + Merged r417 of mainline 1.6. + ------------------------------------------------------------ + revno: 202.2.57 + committer: Andrew Psaltis + branch nick: 1.6-nacl + timestamp: Sun 2009-06-21 14:07:22 -0400 + message: + Merged r426 of mainline 1.6. + ------------------------------------------------------------ + revno: 202.2.56 + committer: Andrew Psaltis + branch nick: 1.6-nacl + timestamp: Fri 2009-06-19 23:20:29 -0400 + message: + Merge r417 of mainline 1.6. + ------------------------------------------------------------ + revno: 202.2.55 + committer: Andrew Psaltis + branch nick: 1.6-nacl + timestamp: Wed 2009-06-17 20:52:59 -0400 + message: + Merge r416 of mainline 1.6. + ------------------------------------------------------------ + revno: 202.2.54 + committer: Andrew Psaltis + branch nick: 1.6-nacl + timestamp: Sun 2009-06-07 14:53:04 -0400 + message: + Merge 411 of mainline 1.6. +------------------------------------------------------------ +revno: 427 +committer: Andrew Psaltis +branch nick: 1.6 +timestamp: Sun 2009-06-21 14:45:44 -0400 +message: + Fix typo that crashes wicd-curses on attempting to bring up the help dialog. +------------------------------------------------------------ +revno: 426 +committer: Adam Blackburn +branch nick: 1.6 +timestamp: Sat 2009-06-20 23:02:23 -0500 +message: + updated setup.py version and CHANGES +------------------------------------------------------------ revno: 425 committer: Andrew Psaltis branch nick: 1.6 diff --git a/NEWS b/NEWS index 701ff67..887143b 100644 --- a/NEWS +++ b/NEWS @@ -1,35 +1,49 @@ -Wicd 1.6.x Branch +Wicd 1.6.0 Branch +1.6.2: + Minor Changes: + - Now deals better if the interface disappears while running + - Will now start if the global script directories don't exist + - Adhoc window will now work correctly + - PSK can be generated from non-ASCII characters + - Fix a minor wicd-curses crash while connecting during a scan -Major Changes: -- Improved tray icon and GUI images (thanks to Martin Sagastume) -- Reorganized network list in the GUI for easier navigation -- New experimental ioctl backend, which is more cpu-friendly than the - previous one -- Added a curses client (thanks to Andrew Psaltis) -- Added a right-click connection menu to the tray icon -- Added options to specify a DNS domain and search domain for static networks -- Reworked the Preferences menu to be more in line with GNOME standards -- Added support for global scripts -- Made it possible to have optional entries in encryption templates -- Added ability to show libnotify notifications on status change +1.6.1: + Minor Changes: + - User is told if the lack permission to access the daemon + - Support for wireless cards that don't report signal strength added + - Enhanced network configuration dialog title -Minor Changes and Other Enhancements: -- Better autoconnection behavior -- Tray/GUI will survive the daemon being killed -- Reasons for connection failures will now bubble back to the GUI -- Add/remove wired profile system is now more user-friendly -- Support for using resolvconf instead of directly editing /etc/resolv.conf -- Wicd won't blindly kill dhcp clients / wpa_supplicant any more -- Added an option to automatically switch from a wireless network to a wired - one as soon as a cable is plugged in -- Moved scanning to its own thread, which makes GUI and daemon more responsive - during scans -- Made it possible to specify macros in script entries -- The GUI will now display the encryption entry dialog if you attempt to - connect to an encrypted network without entering a password -- Static gateway entry is now optional -- Passwords with leading or trailing whitespace are now stored properly -- Many init/config script, man page, and setup.py fixes/updates, including - better autodetection of file placement with regard to sleep hooks and - KDE autostart files (thanks to Robby Workman) +1.6.0: + Major Changes: + - Improved tray icon and GUI images (thanks to Martin Sagastume) + - Reorganized network list in the GUI for easier navigation + - New experimental ioctl backend, which is more cpu-friendly than the + previous one + - Added a curses client (thanks to Andrew Psaltis) + - Added a right-click connection menu to the tray icon + - Added options to specify a DNS domain and search domain for static networks + - Reworked the Preferences menu to be more in line with GNOME standards + - Added support for global scripts + - Made it possible to have optional entries in encryption templates + - Added ability to show libnotify notifications on status change + + Minor Changes and Other Enhancements: + - Better autoconnection behavior + - Tray/GUI will survive the daemon being killed + - Reasons for connection failures will now bubble back to the GUI + - Add/remove wired profile system is now more user-friendly + - Support for using resolvconf instead of directly editing /etc/resolv.conf + - Wicd won't blindly kill dhcp clients / wpa_supplicant any more + - Added an option to automatically switch from a wireless network to a wired + one as soon as a cable is plugged in + - Moved scanning to its own thread, which makes GUI and daemon more responsive + during scans + - Made it possible to specify macros in script entries + - The GUI will now display the encryption entry dialog if you attempt to + connect to an encrypted network without entering a password + - Static gateway entry is now optional + - Passwords with leading or trailing whitespace are now stored properly + - Many init/config script, man page, and setup.py fixes/updates, including + better autodetection of file placement with regard to sleep hooks and + KDE autostart files (thanks to Robby Workman) diff --git a/setup.py b/setup.py index ee9feb2..a45ba71 100755 --- a/setup.py +++ b/setup.py @@ -26,7 +26,7 @@ import subprocess # Be sure to keep this updated! # VERSIONNUMBER -VERSION_NUM = '1.6.1' +VERSION_NUM = '1.6.2' # REVISION_NUM is automatically updated REVISION_NUM = 'unknown' CURSES_REVNO = 'uimod' From cbf9ff418cf0af950a4664ae74d8a9120b1e4b2b Mon Sep 17 00:00:00 2001 From: Adam Blackburn Date: Sun, 5 Jul 2009 09:26:24 -1000 Subject: [PATCH 169/186] fix problem running get_translations if translations/ doesn't exist --- setup.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/setup.py b/setup.py index a45ba71..ed56e4e 100755 --- a/setup.py +++ b/setup.py @@ -412,7 +412,8 @@ class get_translations(Command): def run(self): import urllib, shutil - shutil.rmtree('translations/') + if os.path.exists('translations'): + shutil.rmtree('translations/') os.makedirs('translations') filename, headers = urllib.urlretrieve('http://wicd.sourceforge.net/translator/idlist/') id_file = open(filename, 'r') From 155bf2edfd94d92b955688bb8aa9c90864f01698 Mon Sep 17 00:00:00 2001 From: Robby Workman Date: Tue, 7 Jul 2009 22:31:08 -0500 Subject: [PATCH 170/186] Remove obsolete entries from dbus config file org.wicd.daemon.config no longer exists; this was apparently a leftover from the 1.4.x or 1.5.x days. --- in/other=wicd.conf.in | 4 ---- 1 file changed, 4 deletions(-) diff --git a/in/other=wicd.conf.in b/in/other=wicd.conf.in index ac2fa88..7c9cd39 100644 --- a/in/other=wicd.conf.in +++ b/in/other=wicd.conf.in @@ -11,8 +11,6 @@ - - @@ -22,8 +20,6 @@ - - From 54fcdee7265fc21e9f8c334ace8762b0d0f344f9 Mon Sep 17 00:00:00 2001 From: Robby Workman Date: Tue, 7 Jul 2009 22:36:05 -0500 Subject: [PATCH 171/186] Reorder the directives in the dbus config file This is aesthetic only; no functional change. --- in/other=wicd.conf.in | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/in/other=wicd.conf.in b/in/other=wicd.conf.in index 7c9cd39..d3cc2ac 100644 --- a/in/other=wicd.conf.in +++ b/in/other=wicd.conf.in @@ -13,6 +13,10 @@ + + + + @@ -23,10 +27,6 @@ - - - - From 9c64f5ac7f0d79b20296cb1a1f10fb6b4b6fdfcb Mon Sep 17 00:00:00 2001 From: Robby Workman Date: Tue, 7 Jul 2009 22:37:30 -0500 Subject: [PATCH 172/186] Remove default allow at_console permissions for wicd client I suspect that this will be a user-visible change for lots of people; basically, the default before this was to allow any user logged in on the local machine to use wicd-client IF ConsoleKit was installed and in use on the machine. Since we don't support use of PolicyKit for obtaining authorizations, this wasn't really the proper default in my opinion. This will not affect systems that are not using ConsoleKit - they will continue to depend on group membership in whatever is defined for %WICDGROUP% in the dbus configuration file. --- in/other=wicd.conf.in | 26 ++++++++++++++++---------- 1 file changed, 16 insertions(+), 10 deletions(-) diff --git a/in/other=wicd.conf.in b/in/other=wicd.conf.in index d3cc2ac..79c10c5 100644 --- a/in/other=wicd.conf.in +++ b/in/other=wicd.conf.in @@ -17,16 +17,6 @@ - - - - - - - - - - @@ -34,4 +24,20 @@ + + + From d6b79beb8380c2129815528525f1828f8710bdad Mon Sep 17 00:00:00 2001 From: Adam Blackburn Date: Tue, 7 Jul 2009 18:41:52 -1000 Subject: [PATCH 173/186] Added Robby's comment on at_console --- in/other=wicd.conf.in | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/in/other=wicd.conf.in b/in/other=wicd.conf.in index d3cc2ac..e7c36d3 100644 --- a/in/other=wicd.conf.in +++ b/in/other=wicd.conf.in @@ -17,6 +17,13 @@ + + From 447e9f454d7b30db7828d3ef665f5d5601131f98 Mon Sep 17 00:00:00 2001 From: Robby Workman Date: Wed, 8 Jul 2009 01:39:53 -0500 Subject: [PATCH 174/186] Clarify at_console and Introspectable bits in dbus config This (again) is largely aesthetic, but it clarifies the %WICDGROUP% setting (previous the comment referred to "above" while it was actually below) by moving that block above the at_console block. Also this adds a comment about the Introspectable method to head off any inquiries as to why we're allowing that in wicd's config. --- in/other=wicd.conf.in | 17 ++++++++++------- 1 file changed, 10 insertions(+), 7 deletions(-) diff --git a/in/other=wicd.conf.in b/in/other=wicd.conf.in index e7c36d3..e82bb6f 100644 --- a/in/other=wicd.conf.in +++ b/in/other=wicd.conf.in @@ -17,6 +17,16 @@ + + + + + + + + - - - - - - From 35ec07e0968ab7f9b9dde542874aa40c65e2543b Mon Sep 17 00:00:00 2001 From: Adam Blackburn Date: Tue, 7 Jul 2009 22:01:19 -1000 Subject: [PATCH 175/186] commit Dan's fix for long numeric keys --- wicd/configmanager.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/wicd/configmanager.py b/wicd/configmanager.py index c61faff..b93b1a6 100644 --- a/wicd/configmanager.py +++ b/wicd/configmanager.py @@ -111,11 +111,11 @@ class ConfigManager(RawConfigParser): except (ValueError, TypeError, AttributeError): ret = Noneify(ret) # This is a workaround for a python-dbus issue on 64-bit systems. - if isinstance(ret, (int)): + if isinstance(ret, (int, long)): try: Int32(ret) except OverflowError: - ret = long(ret) + ret = str(ret) return to_unicode(ret) def get(self, *args, **kargs): From a0ed8c4a44d11fcee546cfed087cbffef6b17222 Mon Sep 17 00:00:00 2001 From: Andrew Psaltis Date: Mon, 13 Jul 2009 18:10:28 -0400 Subject: [PATCH 176/186] Fix typo in prefs.py --- wicd/prefs.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/wicd/prefs.py b/wicd/prefs.py index 6072f8d..4677463 100644 --- a/wicd/prefs.py +++ b/wicd/prefs.py @@ -100,7 +100,7 @@ class PreferencesDialog(object): sudo_list = [self.sudoautoradio, self.gksudoradio, self.kdesuradio, self.ktsussradio] self._setup_external_app_radios(sudo_list, daemon.GetSudoApp, - daemon.SetAudoApp) + daemon.SetSudoApp) auto_conn_meth = daemon.GetWiredAutoConnectMethod() if auto_conn_meth == 1: From e1fb4584f25b16f3bd2ac5998f752353e7e2f565 Mon Sep 17 00:00:00 2001 From: Adam Blackburn Date: Wed, 22 Jul 2009 21:29:34 -0500 Subject: [PATCH 177/186] added support for not displaying the tray icon or the GUI, only the notifications --- wicd/wicd-client.py | 38 +++++++++++++++++++++++++++++++++----- 1 file changed, 33 insertions(+), 5 deletions(-) diff --git a/wicd/wicd-client.py b/wicd/wicd-client.py index 118c068..36679b7 100755 --- a/wicd/wicd-client.py +++ b/wicd/wicd-client.py @@ -121,13 +121,15 @@ class TrayIcon(object): Base Class for implementing a tray icon to display network status. """ - def __init__(self, animate): + def __init__(self, animate, displaytray=True): if USE_EGG: self.tr = self.EggTrayIconGUI() else: self.tr = self.StatusTrayIconGUI() self.icon_info = self.TrayConnectionInfo(self.tr, animate) self.tr.icon_info = self.icon_info + print 'displaytray %s' % displaytray + self.tr.visible(displaytray) def is_embedded(self): if USE_EGG: @@ -666,6 +668,18 @@ class TrayIcon(object): """ self.tooltip.set_tip(self.eb, val) + def visible(self, val): + """ Set if the icon is visible or not. + + If val is True, makes the icon visible, if val is False, + hides the tray icon. + + """ + if val: + self.tray.show_all() + else: + self.tray.hide_all() + if hasattr(gtk, "StatusIcon"): class StatusTrayIconGUI(gtk.StatusIcon, TrayIconGUI): @@ -696,6 +710,14 @@ class TrayIcon(object): self.current_icon_path = path gtk.StatusIcon.set_from_file(self, path) + def visible(self, val): + """ Set if the icon is visible or not. + + If val is True, makes the icon visible, if val is False, + hides the tray icon. + + """ + self.set_visible(val) def usage(): """ Print usage information. """ @@ -764,8 +786,9 @@ def main(argv): """ try: - opts, args = getopt.getopt(sys.argv[1:], 'nha', ['help', 'no-tray', - 'no-animate']) + opts, args = getopt.getopt(sys.argv[1:], 'nhao', ['help', 'no-tray', + 'no-animate', + 'only-notifications']) except getopt.GetoptError: # Print help information and exit usage() @@ -773,6 +796,7 @@ def main(argv): use_tray = True animate = True + display_app = True for opt, a in opts: if opt in ('-h', '--help'): usage() @@ -781,6 +805,10 @@ def main(argv): use_tray = False elif opt in ('-a', '--no-animate'): animate = False + elif opt in ('-o', '--only-notifications'): + print "only displaying notifications" + use_tray = False + display_app = False else: usage() sys.exit(2) @@ -789,14 +817,14 @@ def main(argv): setup_dbus() atexit.register(on_exit) - if not use_tray or not ICON_AVAIL: + if display_app and not use_tray or not ICON_AVAIL: the_gui = gui.appGui(standalone=True) mainloop = gobject.MainLoop() mainloop.run() sys.exit(0) # Set up the tray icon GUI and backend - tray_icon = TrayIcon(animate) + tray_icon = TrayIcon(animate, displaytray=display_app) # Check to see if wired profile chooser was called before icon # was launched (typically happens on startup or daemon restart). From 09c8992dc98d54d774c43db69b397d5fbdea0faa Mon Sep 17 00:00:00 2001 From: Adam Blackburn Date: Wed, 22 Jul 2009 21:47:47 -0500 Subject: [PATCH 178/186] added the -o option to the help text --- wicd/wicd-client.py | 1 + 1 file changed, 1 insertion(+) diff --git a/wicd/wicd-client.py b/wicd/wicd-client.py index 36679b7..93e52dd 100755 --- a/wicd/wicd-client.py +++ b/wicd/wicd-client.py @@ -729,6 +729,7 @@ Arguments: \t-n\t--no-tray\tRun wicd without the tray icon. \t-h\t--help\t\tPrint this help information. \t-a\t--no-animate\tRun the tray without network traffic tray animations. +\t-o\t--only-notifications\tDon't display anything except notifications. """ % wpath.version def setup_dbus(force=True): From 6e132f102877bf1d7008ed801de360242bbfef5f Mon Sep 17 00:00:00 2001 From: Adam Blackburn Date: Mon, 27 Jul 2009 21:09:18 -0500 Subject: [PATCH 179/186] moved 55wicd to 91wicd --- in/{other=55wicd.in => other=91wicd.in} | 0 setup.py | 2 +- 2 files changed, 1 insertion(+), 1 deletion(-) rename in/{other=55wicd.in => other=91wicd.in} (100%) diff --git a/in/other=55wicd.in b/in/other=91wicd.in similarity index 100% rename from in/other=55wicd.in rename to in/other=91wicd.in diff --git a/setup.py b/setup.py index ed56e4e..fbdd0c6 100755 --- a/setup.py +++ b/setup.py @@ -526,7 +526,7 @@ try: data.append((wpath.resume, ['other/80-wicd-connect.sh' ])) data.append((wpath.suspend, ['other/50-wicd-suspend.sh' ])) if not wpath.no_install_pmutils: - data.append((wpath.pmutils, ['other/55wicd' ])) + data.append((wpath.pmutils, ['other/91wicd' ])) print 'Using pid path', os.path.basename(wpath.pidfile) print 'Language support for', for language in os.listdir('translations/'): From d684bac0ab68cf40a7c8f07850012c0f133cfc78 Mon Sep 17 00:00:00 2001 From: Dan O'Reilly Date: Sat, 1 Aug 2009 18:57:00 -0400 Subject: [PATCH 180/186] Fix some minor formatting issues Don't save wired profiles that have only whitespace in their names. --- wicd/wicd-daemon.py | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/wicd/wicd-daemon.py b/wicd/wicd-daemon.py index ae38208..52f8619 100644 --- a/wicd/wicd-daemon.py +++ b/wicd/wicd-daemon.py @@ -84,7 +84,7 @@ class WicdDaemon(dbus.service.Object): self._debug_mode = bool(self.config.get("Settings", "debug_mode")) self.wifi = networking.Wireless(debug=self._debug_mode) self.wired = networking.Wired(debug=self._debug_mode) - self.wired_bus= WiredDaemon(bus_name, self, wired=self.wired) + self.wired_bus = WiredDaemon(bus_name, self, wired=self.wired) self.wireless_bus = WirelessDaemon(bus_name, self, wifi=self.wifi) self.forced_disconnect = False self.need_profile_chooser = False @@ -518,7 +518,7 @@ class WicdDaemon(dbus.service.Object): # 1 = default profile # 2 = show list # 3 = last used profile - self.config.set("Settings","wired_connect_mode", int(method), + self.config.set("Settings", "wired_connect_mode", int(method), write=True) self.wired_connect_mode = int(method) self.wired_bus.connect_mode = int(method) @@ -856,7 +856,7 @@ class WicdDaemon(dbus.service.Object): """ b_wired = self.wired_bus b_wifi = self.wireless_bus - app_conf= self.config + app_conf = self.config # Load the backend. be_def = 'external' self.SetBackend(app_conf.get("Settings", "backend", default=be_def)) @@ -880,7 +880,7 @@ class WicdDaemon(dbus.service.Object): dns1 = app_conf.get("Settings", "global_dns_1", default='None') dns2 = app_conf.get("Settings", "global_dns_2", default='None') dns3 = app_conf.get("Settings", "global_dns_3", default='None') - dns_dom =app_conf.get("Settings", "global_dns_dom", default='None') + dns_dom = app_conf.get("Settings", "global_dns_dom", default='None') search_dom = app_conf.get("Settings", "global_search_dom", default='None') self.SetGlobalDNS(dns1, dns2, dns3, dns_dom, search_dom) self.SetAutoReconnect(app_conf.get("Settings", "auto_reconnect", @@ -1448,7 +1448,7 @@ class WiredDaemon(dbus.service.Object): if self.config.has_section(profilename): return False - for option in ["ip", "broadcast", "netmask","gateway", "search_domain", + for option in ["ip", "broadcast", "netmask", "gateway", "search_domain", "dns_domain", "dns1", "dns2", "dns3", "beforescript", "afterscript", "predisconnectscript", "postdisconnectscript"]: @@ -1506,8 +1506,10 @@ class WiredDaemon(dbus.service.Object): if not self.config.has_option(prof, script): self.config.set(prof, script, None) - if profilename == "": + profilename = profilename.strip() + if not profilename: self.config.write() + print "Warning: Bad wired profile name given, ignoring." return "500: Bad Profile name" if self.debug_mode: print "saving wired profile %s" % profilename From 08fc68a459e3f6b505f0fb467b5cf10b1dd20f19 Mon Sep 17 00:00:00 2001 From: Dan O'Reilly Date: Sat, 1 Aug 2009 19:05:24 -0400 Subject: [PATCH 181/186] Enforce valid wired profile names at the GUI level. --- wicd/netentry.py | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/wicd/netentry.py b/wicd/netentry.py index 979832d..44bfa10 100644 --- a/wicd/netentry.py +++ b/wicd/netentry.py @@ -655,17 +655,16 @@ class WiredNetworkEntry(NetworkEntry): def add_profile(self, widget): """ Add a profile to the profile list. """ - print "adding profile" - response = string_input("Enter a profile name", "The profile name " + "will not be used by the computer. It " + "allows you to " + "easily distinguish between different network " + - "profiles.", "Profile name:") + "profiles.", "Profile name:").strip() # if response is "" or None if not response: - return + error(None, "Invalid profile name", block=True) + return False profile_name = response profile_list = wired.GetWiredProfileList() From 0467dd8fce2e36f5598b8d03826b143d23a44b15 Mon Sep 17 00:00:00 2001 From: Dan O'Reilly Date: Sat, 1 Aug 2009 21:25:58 -0400 Subject: [PATCH 182/186] Fix crash when trying to use an unavaiable locale. --- wicd/translations.py | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/wicd/translations.py b/wicd/translations.py index 3c65f65..396bd92 100644 --- a/wicd/translations.py +++ b/wicd/translations.py @@ -44,11 +44,10 @@ def get_gettext(): lc, encoding = locale.getdefaultlocale(envvars=('LC_MESSAGES', 'LC_ALL', 'LANG', 'LANGUAGE')) + langs += [lc] except ValueError, e: print str(e) print "Default locale unavailable, falling back to en_US" - if (lc): - langs += [lc] langs += ["en_US"] lang = gettext.translation('wicd', local_path, languages=langs, fallback=True) From 43ce229465620fa94eb5533f4cc90a26274d4019 Mon Sep 17 00:00:00 2001 From: Andrew Psaltis Date: Sun, 2 Aug 2009 23:53:25 -0400 Subject: [PATCH 183/186] Prevent empty or whitespace-only wired profile names in wicd-curses. Did some code cleanup in curses/curses_misc.py --- curses/curses_misc.py | 39 +++------------------------------------ curses/wicd-curses.py | 31 +++++++++++++++++++------------ 2 files changed, 22 insertions(+), 48 deletions(-) diff --git a/curses/curses_misc.py b/curses/curses_misc.py index e8feefe..c2159ff 100644 --- a/curses/curses_misc.py +++ b/curses/curses_misc.py @@ -33,10 +33,6 @@ def error(ui,parent,message): dialog = TextDialog(message,6,40,('important',"ERROR")) return dialog.run(ui,parent) -# My savior. :-) -# Although I could have made this myself pretty easily, just want to give credit -# where it's due. -# http://excess.org/urwid/browser/contrib/trunk/rbreu_filechooser.py class SelText(urwid.Text): """A selectable text widget. See urwid.Text.""" @@ -253,7 +249,7 @@ class ComboBoxException(Exception): # I based this off of the code found here: # http://excess.org/urwid/browser/contrib/trunk/rbreu_menus.py # This is a hack/kludge. It isn't without quirks, but it more or less works. -# We need to wait for changes in urwid's Canvas controls before we can actually +# We need to wait for changes in urwid's Canvas API before we can actually # make a real ComboBox. class ComboBox(urwid.WidgetWrap): """A ComboBox of text objects""" @@ -333,9 +329,8 @@ class ComboBox(urwid.WidgetWrap): str,trash = self.label.get_text() self.overlay = None - #w,sensitive=True,attrs=('editbx','editnfc'),focus_attr='editfc') self.cbox = DynWrap(SelText(self.DOWN_ARROW),attrs=attrs,focus_attr=focus_attr) - # Unicode will kill me sooner or later. ^_^ + # Unicode will kill me sooner or later. if label != '': w = urwid.Columns([('fixed',len(str),self.label),self.cbox],dividechars=1) else: @@ -344,10 +339,9 @@ class ComboBox(urwid.WidgetWrap): # We need this to pick our keypresses self.use_enter = use_enter - # The Focus + self.focus = focus - # The callback and friends self.callback = callback self.user_args = user_args @@ -442,11 +436,6 @@ class Dialog2(urwid.WidgetWrap): urwid.Divider()] ) w = self.frame self.view = w - - # pad area around listbox - #w = urwid.Padding(w, ('fixed left',2), ('fixed right',2)) - #w = urwid.Filler(w, ('fixed top',1), ('fixed bottom',1)) - #w = urwid.AttrWrap(w, 'body') # buttons: tuple of name,exitcode def add_buttons(self, buttons): @@ -503,8 +492,6 @@ class Dialog2(urwid.WidgetWrap): class TextDialog(Dialog2): def __init__(self, text, height, width, header=None,align='left'): l = [urwid.Text(text)] - #for line in text: - # l.append( urwid.Text( line,align=align)) body = urwid.ListBox(l) body = urwid.AttrWrap(body, 'body') @@ -596,7 +583,6 @@ class OptCols(urwid.WidgetWrap): else: key += part - #theText = urwid.Text([(attrs[0],cmd[0]),(attrs[1],cmd[1])]) if debug: callback = self.debugClick args = cmd[1] @@ -608,9 +594,6 @@ class OptCols(urwid.WidgetWrap): ('fixed',len(key)+1,urwid.Text((attrs[0],key+':')) ), urwid.AttrWrap(urwid.Text(cmd[1]),attrs[1])], callback,args) - #if i != len(tuples)-1: - # textList.append(('fixed',maxlen,col)) - #else: # The last one textList.append(col) i+=1 if debug: @@ -625,19 +608,3 @@ class OptCols(urwid.WidgetWrap): def mouse_event(self,size,event,button,x,y,focus): # Widgets are evenly long (as of current), so... return self._w.mouse_event(size,event,button,x,y,focus) - """ - if self.debug: - if x > size[0]-10: - return - widsize = (size[0]-10)/len(self.callbacks) - else: - widsize = size[0]/len(self.callbacks) - widnum = x/widsize - if self.debug: - text = str(widnum) - if self.callbacks[widnum] == None: - text += " None" - self.debug.set_text(text) - elif self.callbacks[widnum] != None: - self.callbacks[widnum]() - """ diff --git a/curses/wicd-curses.py b/curses/wicd-curses.py index 4a0c041..220a635 100755 --- a/curses/wicd-curses.py +++ b/curses/wicd-curses.py @@ -383,18 +383,25 @@ class WiredComboBox(ComboBox): def keypress(self,size,key): prev_focus = self.get_focus()[1] - key = self.__super.keypress(size,key) - if self.get_focus()[1] == len(self.list)-1: - dialog = InputDialog(('header',language["add_new_wired_profile"]),7,30) - - exitcode,name = dialog.run(ui,self.parent) - if exitcode == 0: - wired.CreateWiredNetworkProfile(name,False) - self.set_list(wired.GetWiredProfileList()) - self.rebuild_combobox() - self.set_focus(prev_focus) - else: - wired.ReadWiredNetworkProfile(self.get_selected_profile()) + key = ComboBox.keypress(self,size,key) + if key == ' ': + if self.get_focus()[1] == len(self.list)-1: + dialog = InputDialog(('header',language["add_new_wired_profile"]),7,30) + exitcode,name = dialog.run(ui,self.parent) + if exitcode == 0: + name = name.strip() + if not name: + error(ui,self.parent,'Invalid profile name') + self.set_focus(prev_focus) + return key + + wired.CreateWiredNetworkProfile(name,False) + self.set_list(wired.GetWiredProfileList()) + self.rebuild_combobox() + self.set_focus(prev_focus) + else: + print "updating..." + wired.ReadWiredNetworkProfile(self.get_selected_profile()) if key == 'delete': if len(self.theList) == 1: error(self.ui,self.parent,language["no_delete_last_profile"]) From f3d9a3b6da987fc8d841a5da45320d7285790cdf Mon Sep 17 00:00:00 2001 From: Dan O'Reilly Date: Mon, 3 Aug 2009 19:29:18 -0400 Subject: [PATCH 184/186] Actually display the error messag we get when scanning fails in the ioctl backend. Make sure we actually abort the connection attempt when authentication validation fails. --- wicd/backends/be-ioctl.py | 2 +- wicd/networking.py | 3 ++- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/wicd/backends/be-ioctl.py b/wicd/backends/be-ioctl.py index 3d16486..a51db1b 100644 --- a/wicd/backends/be-ioctl.py +++ b/wicd/backends/be-ioctl.py @@ -288,7 +288,7 @@ class WirelessInterface(Interface, BaseWirelessInterface): try: results = self.scan_iface.Scan() except iwscan.error, e: - print "ERROR: %s" + print "ERROR: %s" % e return [] return filter(None, [self._parse_ap(cell) for cell in results]) diff --git a/wicd/networking.py b/wicd/networking.py index 13ec635..1269e5c 100644 --- a/wicd/networking.py +++ b/wicd/networking.py @@ -866,7 +866,8 @@ class WirelessConnectThread(ConnectThread): if self.network.get('enctype'): self.SetStatus('validating_authentication') if not wiface.ValidateAuthentication(time.time()): - if not self.connect_result: + print "connect result is %s" % self.connect_result + if not self.connect_result or self.connect_result == 'Failed': self.abort_connection('bad_pass') # Set up gateway, IP address, and DNS servers. From 4839e7e7bb7315d18ddb83b1f6de55aaac34c868 Mon Sep 17 00:00:00 2001 From: Adam Blackburn Date: Wed, 5 Aug 2009 21:27:24 -0500 Subject: [PATCH 185/186] commit fix from https://bugs.launchpad.net/wicd/+bug/388116/comments/3 --- wicd/wicd-daemon.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/wicd/wicd-daemon.py b/wicd/wicd-daemon.py index 52f8619..28f9c76 100644 --- a/wicd/wicd-daemon.py +++ b/wicd/wicd-daemon.py @@ -1201,6 +1201,8 @@ class WirelessDaemon(dbus.service.Object): if cur_network["hidden"]: if cur_network.get("essid") in ["", "Hidden", "", None]: cur_network["essid"] = "" + else: + cur_network['essid'] = self.config.get(section, 'essid') return "100: Loaded Profile" @dbus.service.method('org.wicd.daemon.wireless') From 661476f87a923b43f0d3a42825b6b785e663fad2 Mon Sep 17 00:00:00 2001 From: Adam Blackburn Date: Tue, 11 Aug 2009 22:42:44 -0500 Subject: [PATCH 186/186] make automatic reconnect work when measuring in dBm as well --- wicd/monitor.py | 15 +++++++++++---- 1 file changed, 11 insertions(+), 4 deletions(-) diff --git a/wicd/monitor.py b/wicd/monitor.py index 6dcb0a0..0827965 100755 --- a/wicd/monitor.py +++ b/wicd/monitor.py @@ -178,8 +178,8 @@ class ConnectionStatus(object): if not bssid: return False - wifi_signal = self._get_printable_sig_strength() - if wifi_signal == 0: + wifi_signal = self._get_printable_sig_strength(always_positive=True) + if wifi_signal <= 0: # If we have no signal, increment connection loss counter. # If we haven't gotten any signal 4 runs in a row (12 seconds), # try to reconnect. @@ -296,13 +296,20 @@ class ConnectionStatus(object): self.last_state = state return True - def _get_printable_sig_strength(self): + def _get_printable_sig_strength(self, always_positive=False): """ Get the correct signal strength format. """ try: if daemon.GetSignalDisplayType() == 0: wifi_signal = int(wireless.GetCurrentSignalStrength(self.iwconfig)) else: - wifi_signal = int(wireless.GetCurrentDBMStrength(self.iwconfig)) + if always_positive: + # because dBm is negative, add 99 to the signal. This way, if + # the signal drops below -99, wifi_signal will == 0, and + # an automatic reconnect will be triggered + # this is only used in check_for_wireless_connection + wifi_signal = 99 + int(wireless.GetCurrentDBMStrength(self.iwconfig)) + else: + wifi_signal = int(wireless.GetCurrentDBMStrength(self.iwconfig)) except TypeError: wifi_signal = 0