From 6d1f75f5521161046a99a20898206272a8c47d4f Mon Sep 17 00:00:00 2001 From: Andrew Psaltis Date: Sun, 21 Jun 2009 14:45:44 -0400 Subject: [PATCH 01/28] 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 02/28] 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 03/28] 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 04/28] 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 05/28] 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 06/28] 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 07/28] 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 08/28] 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 09/28] 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 10/28] 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 11/28] 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 12/28] 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 13/28] 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 14/28] 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 15/28] 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 16/28] 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 17/28] 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 18/28] 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 19/28] 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 20/28] 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 21/28] 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 22/28] 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 23/28] 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 24/28] 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 25/28] 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 26/28] 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 27/28] 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 28/28] 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')