Web   ·   Wiki   ·   Activities   ·   Blog   ·   Lists   ·   Chat   ·   Meeting   ·   Bugs   ·   Git   ·   Translate   ·   Archive   ·   People   ·   Donate
summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSimon Schampijer <simon@schampijer.de>2008-12-16 18:23:54 (GMT)
committer Simon Schampijer <simon@schampijer.de>2008-12-16 18:23:54 (GMT)
commit1b2a2789f459765f66cb81925f6ee9b55fcd00f9 (patch)
tree8a9a457eb4db2e7271bc60dd704a6092a36cb519
parent383c7c877fff405e7b9df026fab58e60a8f5a9bf (diff)
Only create a keydialog for the activating connection
This fixes the issue when we have already an active connection (wired, another wireless device) and want to authenticate with another AP
-rw-r--r--src/jarabe/desktop/meshbox.py13
-rw-r--r--src/jarabe/model/network.py4
2 files changed, 13 insertions, 4 deletions
diff --git a/src/jarabe/desktop/meshbox.py b/src/jarabe/desktop/meshbox.py
index 43506e2..e650ba7 100644
--- a/src/jarabe/desktop/meshbox.py
+++ b/src/jarabe/desktop/meshbox.py
@@ -647,10 +647,15 @@ class NetworkManagerObserver(object):
for conn_o in active_connections_o:
obj = self._bus.get_object(_NM_IFACE, conn_o)
props = dbus.Interface(obj, 'org.freedesktop.DBus.Properties')
- ap_o = props.Get(_NM_ACTIVE_CONN_IFACE, 'SpecificObject')
-
- ap_view = self._box.access_points[ap_o]
- ap_view.create_keydialog(kwargs['response'])
+ state = props.Get(_NM_ACTIVE_CONN_IFACE, 'State')
+ if state == network.NM_ACTIVE_CONNECTION_STATE_ACTIVATING:
+ ap_o = props.Get(_NM_ACTIVE_CONN_IFACE, 'SpecificObject')
+ if ap_o != '/':
+ ap_view = self._box.access_points[ap_o]
+ ap_view.create_keydialog(kwargs['response'])
+ else:
+ logging.error('Could not determine AP for'
+ ' specific object %s' % conn_o)
def __get_devices_reply_cb(self, devices_o):
for dev_o in devices_o:
diff --git a/src/jarabe/model/network.py b/src/jarabe/model/network.py
index d793deb..866f079 100644
--- a/src/jarabe/model/network.py
+++ b/src/jarabe/model/network.py
@@ -36,6 +36,10 @@ DEVICE_STATE_IP_CONFIG = 7
DEVICE_STATE_ACTIVATED = 8
DEVICE_STATE_FAILED = 9
+NM_ACTIVE_CONNECTION_STATE_UNKNOWN = 0
+NM_ACTIVE_CONNECTION_STATE_ACTIVATING = 1
+NM_ACTIVE_CONNECTION_STATE_ACTIVATED = 2
+
NM_802_11_AP_FLAGS_NONE = 0x00000000
NM_802_11_AP_FLAGS_PRIVACY = 0x00000001