From 0c1a017932cb80832fcf0863a38f48d9e08cb311 Mon Sep 17 00:00:00 2001 From: Tomeu Vizoso Date: Wed, 11 Jul 2007 12:40:23 +0200 Subject: [PATCH] #1720 nmclient.Device was not returning the ssid of the active network. --- NEWS | 1 + shell/hardware/nmclient.py | 6 ++++-- shell/model/devices/network/wireless.py | 2 ++ 3 files changed, 7 insertions(+), 2 deletions(-) diff --git a/NEWS b/NEWS index 191795ca..4bf67665 100644 --- a/NEWS +++ b/NEWS @@ -1,3 +1,4 @@ +* #1720 Show the name of the wireless network to which we are connected. (tomeu) * #1888 Fix opening items from the clipboard. (tomeu) * #1984 Fix removing items from the clipboard. (tomeu) diff --git a/shell/hardware/nmclient.py b/shell/hardware/nmclient.py index 631a352d..b699a043 100644 --- a/shell/hardware/nmclient.py +++ b/shell/hardware/nmclient.py @@ -211,7 +211,6 @@ class Device(gobject.GObject): self._networks = {} self._caps = 0 self._state = DEVICE_STATE_INACTIVE - self._ssid = None self._active_network = None obj = sys_bus.get_object(NM_SERVICE, self._op) @@ -401,7 +400,10 @@ class Device(gobject.GObject): error_handler=self._get_active_net_error_cb) def get_ssid(self): - return self._ssid + if self._active_network and self._active_network.is_valid(): + return self._active_network.get_ssid() + elif not self._active_network: + return None def get_type(self): return self._type diff --git a/shell/model/devices/network/wireless.py b/shell/model/devices/network/wireless.py index 20d20940..bc6c9ddc 100644 --- a/shell/model/devices/network/wireless.py +++ b/shell/model/devices/network/wireless.py @@ -54,6 +54,8 @@ class Device(device.Device): if pspec.name == 'strength': return self._nm_device.get_strength() elif pspec.name == 'name': + import logging + logging.debug('wireless.Device.props.name: %s' % self._nm_device.get_ssid()) return self._nm_device.get_ssid() elif pspec.name == 'state': nm_state = self._nm_device.get_state()