Attachments you submit will be routed for moderation. If you have an account, please
log in first.
Ticket #2187: 0001-Sugar-Ad-hoc-network-reconnect-after-suspend-2187.patch
|
File 0001-Sugar-Ad-hoc-network-reconnect-after-suspend-2187.patch, 1.7 KB
(added by erikos, 3 years ago)
|
|
Sugar Ad-hoc network: reconnect after suspend
|
-
From bde38e446d076a9774b0cd8fa5d7556d34dc922e Mon Sep 17 00:00:00 2001
From: Simon Schampijer <simon@schampijer.de>
Date: Wed, 15 Sep 2010 09:58:29 +0200
Subject: [PATCH] Sugar Ad-hoc network: reconnect after suspend #2187
---
src/jarabe/model/adhoc.py | 15 +--------------
1 files changed, 1 insertions(+), 14 deletions(-)
diff --git a/src/jarabe/model/adhoc.py b/src/jarabe/model/adhoc.py
index ad0c941..0ff3e22 100644
|
a
|
b
|
|
| 134 | 134 | def _update_state(self): |
| 135 | 135 | self.emit('state-changed', self._current_channel, self._device_state) |
| 136 | 136 | |
| 137 | | def _have_configured_connections(self): |
| 138 | | return len(network.get_settings().connections) > 0 |
| 139 | | |
| 140 | 137 | def autoconnect(self): |
| 141 | | """Autoconnect to an Ad-hoc network""" |
| 142 | | if self._device_state != network.DEVICE_STATE_DISCONNECTED: |
| 143 | | return |
| 144 | | elif self._have_configured_connections(): |
| 145 | | self._autoconnect_adhoc_timer() |
| 146 | | else: |
| 147 | | self._autoconnect_adhoc() |
| 148 | | |
| 149 | | def _autoconnect_adhoc_timer(self): |
| 150 | 138 | """Start a timer which basically looks for 30 seconds of inactivity |
| 151 | 139 | on the device, then does autoconnect to an Ad-hoc network. |
| 152 | 140 | |
| … |
… |
|
| 157 | 145 | self._AUTOCONNECT_TIMEOUT, self.__idle_check_cb) |
| 158 | 146 | |
| 159 | 147 | def __idle_check_cb(self): |
| 160 | | if self._device_state == network.DEVICE_STATE_DISCONNECTED: |
| 161 | | logging.debug("Connect to Ad-hoc network due to inactivity.") |
| | 148 | if self._device_state == network.DEVICE_STATE_DISCONNECTED: |
| 162 | 149 | self._autoconnect_adhoc() |
| 163 | 150 | return False |
| 164 | 151 | |
Download in other formats: