diff --git a/shell/hardware/nmclient.py b/shell/hardware/nmclient.py index d1189f0f..910b6829 100644 --- a/shell/hardware/nmclient.py +++ b/shell/hardware/nmclient.py @@ -218,6 +218,9 @@ class Device(gobject.GObject): def get_networks(self): return self._networks.values() + def get_active_network(self): + return self.get_network(self._active_net) + def get_network(self, op): if self._networks.has_key(op): return self._networks[op] diff --git a/shell/model/devices/wirelessnetwork.py b/shell/model/devices/wirelessnetwork.py index c18cf879..6cd7c577 100644 --- a/shell/model/devices/wirelessnetwork.py +++ b/shell/model/devices/wirelessnetwork.py @@ -27,3 +27,10 @@ class Device(device.Device): def get_id(self): return self._nm_device.get_op() + + def get_name(self): + active_net = self._nm_device.get_active_network() + if active_net: + return active_net.get_ssid() + else: + return None diff --git a/shell/view/devices/wirelessnetwork.py b/shell/view/devices/wirelessnetwork.py index a08de583..19eba5c1 100644 --- a/shell/view/devices/wirelessnetwork.py +++ b/shell/view/devices/wirelessnetwork.py @@ -5,9 +5,11 @@ class DeviceView(deviceview.DeviceView): deviceview.DeviceView.__init__(self, model) self._model = model - self._update_icon() model.connect('notify::strength', self._strength_changed_cb) + self.props.tooltip = model.get_name() + self._update_icon() + def _strength_changed_cb(self, model, pspec): self._update_icon()