[Sugar-devel] [PATCH sugar] SugarAdhoc networks: make 'connect' option in Palette available

Simon Schampijer simon at schampijer.de
Wed Jan 4 07:23:46 EST 2012


The palette got only updated on device state changes so far,
but is not initialised on startup. The device state is now signaled
as well on bringup from the manager to the widget.
---
 src/jarabe/desktop/meshbox.py |    2 +-
 src/jarabe/model/adhoc.py     |    1 +
 2 files changed, 2 insertions(+), 1 deletions(-)

diff --git a/src/jarabe/desktop/meshbox.py b/src/jarabe/desktop/meshbox.py
index 2ce6163..2bf6334 100644
--- a/src/jarabe/desktop/meshbox.py
+++ b/src/jarabe/desktop/meshbox.py
@@ -606,10 +606,10 @@ 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._add_adhoc_network_icon(1)
         self._add_adhoc_network_icon(6)
         self._add_adhoc_network_icon(11)
+        self._adhoc_manager.start_listening(device)
         self._adhoc_manager.autoconnect()
 
     def remove_adhoc_networks(self):
diff --git a/src/jarabe/model/adhoc.py b/src/jarabe/model/adhoc.py
index 09325ed..58ff1c0 100644
--- a/src/jarabe/model/adhoc.py
+++ b/src/jarabe/model/adhoc.py
@@ -82,6 +82,7 @@ class AdHocManager(gobject.GObject):
         self._device = device
         props = dbus.Interface(device, dbus.PROPERTIES_IFACE)
         self._device_state = props.Get(network.NM_DEVICE_IFACE, 'State')
+        self._update_state()
 
         self._bus.add_signal_receiver(self.__device_state_changed_cb,
                                       signal_name='StateChanged',
-- 
1.7.7.3



More information about the Sugar-devel mailing list