diff options
author | Marco Pesenti Gritti <mpg@redhat.com> | 2007-02-25 11:17:45 (GMT) |
---|---|---|
committer | Marco Pesenti Gritti <mpg@redhat.com> | 2007-02-25 11:17:45 (GMT) |
commit | 38ac42d6650154659dd2f1c354c023f29f07de7d (patch) | |
tree | 0a69c48b5a0442ef80bd43e6a26bff618c2ad20a /shell/hardware/nmclient.py | |
parent | 91722dfebc4d21bccf5591dbe211ddbe4ffd51ef (diff) |
Activate the network on click
Diffstat (limited to 'shell/hardware/nmclient.py')
-rw-r--r-- | shell/hardware/nmclient.py | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/shell/hardware/nmclient.py b/shell/hardware/nmclient.py index b3b05c8..c98f1e2 100644 --- a/shell/hardware/nmclient.py +++ b/shell/hardware/nmclient.py @@ -418,6 +418,21 @@ class NMClient(gobject.GObject): except dbus.DBusException: pass + def set_active_device(self, device, network): + net_op = "" + if network: + net_op = network.get_op() + try: + # NM 0.6.4 and earlier have a bug which returns an + # InvalidArguments error if no security information is passed + # for wireless networks + self._nm_obj.setActiveDevice(device.get_op(), network.get_ssid()) + except dbus.DBusException, e: + if str(e).find("invalid arguments"): + pass + else: + raise dbus.DBusException(e) + def get_key_for_network(self, net, async_cb, async_err_cb): pass |