[Sugar-devel] [PATCH sugar] Make sure to listen on the new device after suspend OLPC #10672

Simon Schampijer simon at schampijer.de
Tue Mar 1 17:47:23 EST 2011


---
 src/jarabe/desktop/meshbox.py |    3 ++-
 src/jarabe/model/adhoc.py     |    1 +
 2 files changed, 3 insertions(+), 1 deletions(-)

diff --git a/src/jarabe/desktop/meshbox.py b/src/jarabe/desktop/meshbox.py
index ad4b873..3d1e52a 100644
--- a/src/jarabe/desktop/meshbox.py
+++ b/src/jarabe/desktop/meshbox.py
@@ -607,7 +607,7 @@ class MeshBox(gtk.VBox):
     def add_adhoc_networks(self, device):
         if self._adhoc_manager is None:
             self._adhoc_manager = get_adhoc_manager_instance()
-            self._adhoc_manager.start_listening(device)
+        self._adhoc_manager.start_listening(device)
         self._add_adhoc_network_icon(1)
         self._add_adhoc_network_icon(6)
         self._add_adhoc_network_icon(11)
@@ -617,6 +617,7 @@ class MeshBox(gtk.VBox):
         for icon in self._adhoc_networks:
             self._layout.remove(icon)
         self._adhoc_networks = []
+        self._adhoc_manager.stop_listening()
 
     def _add_adhoc_network_icon(self, channel):
         icon = SugarAdhocView(channel)
diff --git a/src/jarabe/model/adhoc.py b/src/jarabe/model/adhoc.py
index 8842a5c..3f4587a 100644
--- a/src/jarabe/model/adhoc.py
+++ b/src/jarabe/model/adhoc.py
@@ -98,6 +98,7 @@ class AdHocManager(gobject.GObject):
                                       dbus_interface=_NM_WIRELESS_IFACE)
 
     def stop_listening(self):
+        self._listening_called = 0
         self._bus.remove_signal_receiver(self.__device_state_changed_cb,
                                          signal_name='StateChanged',
                                          path=self._device.object_path,
-- 
1.7.4



More information about the Sugar-devel mailing list