[Dextrose] [PATCH 1/2] Always enable wireless workaround
Martin Abente
martin.abente.lahaye at gmail.com
Mon Feb 14 15:46:03 EST 2011
As reported at #2602 the wireless device gets
disabled unexpectedly, creating confusion among
the users.
This patch contains a workaround that will enable
the wireless device on every boot.
PLEASE revert it as soon as a mainstream solution
arrives.
Signed-off-by: Martin Abente <martin.abente.lahaye at gmail.com>
---
bin/sugar-session | 16 ++++++++++++++++
1 files changed, 16 insertions(+), 0 deletions(-)
diff --git a/bin/sugar-session b/bin/sugar-session
index e4a9707..d85189f 100755
--- a/bin/sugar-session
+++ b/bin/sugar-session
@@ -33,6 +33,7 @@ import logging
import gconf
import gtk
import gobject
+import dbus
import dbus.glib
import wnck
@@ -192,6 +193,7 @@ def bootstrap():
gobject.idle_add(setup_file_transfer_cb)
gobject.idle_add(show_software_updates_cb)
gobject.idle_add(setup_accessibility_cb)
+ gobject.idle_add(setup_wireless_cb)
if sys.modules.has_key('xklavier'):
gobject.idle_add(setup_keyboard_cb)
@@ -203,6 +205,20 @@ def set_fonts():
settings = gtk.settings_get_default()
settings.set_property("gtk-font-name", "%s %f" % (face, size))
+def setup_wireless_cb():
+ #XXX: Revert this patch atfer #2602 gets fixed.
+ logging.debug('Enabling wireless device')
+ try:
+ bus = dbus.SystemBus()
+ obj = bus.get_object('org.freedesktop.NetworkManager',
+ '/org/freedesktop/NetworkManager')
+ nm_props = dbus.Interface(obj, dbus.PROPERTIES_IFACE)
+ except:
+ logging.exception('Could not enable wireless device')
+ else:
+ nm_props.Set('org.freedesktop.NetworkManager',
+ 'WirelessEnabled', True)
+
def setup_accessibility_cb():
from jarabe.model import accessibility
accessibility_manager = accessibility.AccessibilityManager()
--
1.7.1
More information about the Dextrose
mailing list