diff options
author | Marco Pesenti Gritti <mpg@redhat.com> | 2007-02-25 01:28:14 (GMT) |
---|---|---|
committer | Marco Pesenti Gritti <mpg@redhat.com> | 2007-02-25 01:28:14 (GMT) |
commit | 6a4170a51e2be4f0f3d2ba45aac19819a9aee7f0 (patch) | |
tree | dc54113ffdf2a514445dc8e3852fbfa6a2e494dd /shell/hardware/nmclient.py | |
parent | 755250947a5b49c7fc8353055f65db6c4b277cbd (diff) |
Get the wireless device to show.
Diffstat (limited to 'shell/hardware/nmclient.py')
-rw-r--r-- | shell/hardware/nmclient.py | 22 |
1 files changed, 19 insertions, 3 deletions
diff --git a/shell/hardware/nmclient.py b/shell/hardware/nmclient.py index 9a2c5a8..8bd2999 100644 --- a/shell/hardware/nmclient.py +++ b/shell/hardware/nmclient.py @@ -156,8 +156,6 @@ class Device(gobject.GObject): self._type = props[2] self._udi = props[3] self._active = props[4] - if self._active: - self.emit('activated') self._link = props[15] self._caps = props[17] @@ -170,6 +168,9 @@ class Device(gobject.GObject): self._valid = True + if self._active: + self.emit('activated') + def _update_networks(self, net_ops, active_op): for op in net_ops: net = Network(op) @@ -261,8 +262,19 @@ NM_STATE_CONNECTING = 2 NM_STATE_CONNECTED = 3 NM_STATE_DISCONNECTED = 4 -class NMClient(object): +class NMClient(gobject.GObject): + __gsignals__ = { + 'device-activated' : (gobject.SIGNAL_RUN_FIRST, + gobject.TYPE_NONE, + ([gobject.TYPE_PYOBJECT])), + 'device-removed' : (gobject.SIGNAL_RUN_FIRST, + gobject.TYPE_NONE, + ([gobject.TYPE_PYOBJECT])) + } + def __init__(self): + gobject.GObject.__init__(self) + self.nminfo = None self._nm_present = False self._nm_state = NM_STATE_UNKNOWN @@ -329,6 +341,8 @@ class NMClient(object): dev.disconnect('strength-changed') del self._devices[dev_op] + self.emit('device-removed', dev) + def _dev_activated_cb(self, dev): op = dev.get_op() if not self._devices.has_key(op): @@ -337,6 +351,8 @@ class NMClient(object): return self._active_device = op + self.emit('device-activated', dev) + def _dev_strength_changed_cb(self, dev, strength): op = dev.get_op() if not self._devices.has_key(op): |