diff options
author | Daniel Drake <dsd@laptop.org> | 2012-12-11 10:02:48 (GMT) |
---|---|---|
committer | Daniel Drake <dsd@laptop.org> | 2012-12-17 12:59:43 (GMT) |
commit | 69d57789feb2b5a2b07b8489f2511b4c8c8bd411 (patch) | |
tree | c8e22965a83ac763032a5901927c74e588795e7e /extensions | |
parent | 5540725660e41b90024137e712bb9748cdc937a4 (diff) |
Modem device icon: fix state detection (#4255)
Probably lacking an update from the NM-0.8 era, _update_state does
not correctly handle NM_DEVICE_STATE_IP_CHECK and
NM_DEVICE_STATE_SECONDARIES (triggered late in the connection-establishing
process after NM_DEVICE_STATE_IP_CONFIG).
This was causing backtraces like:
File "/usr/share/sugar/extensions/deviceicon/network.py", line 856, in _update_state
self._palette.update_state(gsm_state, reason)
File "/usr/share/sugar/extensions/deviceicon/network.py", line 272, in update_state
self._update_label_and_text(reason)
File "/usr/share/sugar/extensions/deviceicon/network.py", line 310, in _update_label_and_text
'text, %s' % str(self._current_state))
ValueError: Invalid GSM state while updating label and text, None
and it may have been confusing further code in the same class after.
Fix _update_state to more accurately identify the "connecting" states.
Diffstat (limited to 'extensions')
-rw-r--r-- | extensions/deviceicon/network.py | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/extensions/deviceicon/network.py b/extensions/deviceicon/network.py index ebbafdd..2a60481 100644 --- a/extensions/deviceicon/network.py +++ b/extensions/deviceicon/network.py @@ -846,7 +846,7 @@ class GsmDeviceView(TrayIcon): gsm_state = _GSM_STATE_NOT_READY elif (state >= network.NM_DEVICE_STATE_PREPARE) and \ - (state <= network.NM_DEVICE_STATE_IP_CONFIG): + (state < network.NM_DEVICE_STATE_ACTIVATED): gsm_state = _GSM_STATE_CONNECTING elif state == network.NM_DEVICE_STATE_FAILED: |