diff options
author | Sascha Silbe <silbe@activitycentral.com> | 2011-01-21 18:10:35 (GMT) |
---|---|---|
committer | Sascha Silbe <sascha-pgp@silbe.org> | 2011-02-05 15:25:05 (GMT) |
commit | bb0f646342903cdd1e9e5d4379fcade668c92d5e (patch) | |
tree | 1d681efba2220f901a34f9b243ccb05fa855d77d /extensions | |
parent | cbba08f28bc461f06da56d27bca058900c090139 (diff) |
fix network disconnect (SL#1608, SL#1802)
User interface changes:
- enable the disconnect button on the access point menu in the
neighbourhood view, (rather than the button doing nothing),
- fix the disconnect button on the wireless device icon in the frame
so that the disconnection remains effective [1], (rather than
disconnecting and then reconnecting automatically),
Based on a patch by James Cameron <quozl@laptop.org>.
[1] http://mail.gnome.org/archives/networkmanager-list/2011-January/msg00007.html
Signed-off-by: Sascha Silbe <silbe@activitycentral.com>
Diffstat (limited to 'extensions')
-rw-r--r-- | extensions/deviceicon/network.py | 18 |
1 files changed, 5 insertions, 13 deletions
diff --git a/extensions/deviceicon/network.py b/extensions/deviceicon/network.py index bc2492d..4c4f339 100644 --- a/extensions/deviceicon/network.py +++ b/extensions/deviceicon/network.py @@ -564,20 +564,12 @@ class WirelessDeviceView(ToolButton): self._icon.props.base_color = self._color def __deactivate_connection_cb(self, palette, data=None): - if self._active_ap_op is not None: - obj = self._bus.get_object(_NM_SERVICE, _NM_PATH) - netmgr = dbus.Interface(obj, _NM_IFACE) - netmgr_props = dbus.Interface(netmgr, dbus.PROPERTIES_IFACE) - active_connections_o = netmgr_props.Get(_NM_IFACE, - 'ActiveConnections') + if self._mode == network.NM_802_11_MODE_INFRA: + connection = network.find_connection_by_ssid(self._name) + if connection: + connection.disable_autoconnect() - for conn_o in active_connections_o: - obj = self._bus.get_object(_NM_IFACE, conn_o) - props = dbus.Interface(obj, dbus.PROPERTIES_IFACE) - ap_op = props.Get(_NM_ACTIVE_CONN_IFACE, 'SpecificObject') - if ap_op == self._active_ap_op: - netmgr.DeactivateConnection(conn_o) - break + network.disconnect_access_points([self._active_ap_op]) def __activate_reply_cb(self, connection): logging.debug('Network created: %s', connection) |