1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
|
From patchwork Mon Feb 14 20:46:03 2011
Content-Type: text/plain; charset="utf-8"
MIME-Version: 1.0
Content-Transfer-Encoding: 7bit
Subject: [1/2] Always enable wireless workaround
Date: Tue, 15 Feb 2011 01:46:03 -0000
From: Martin Abente <martin.abente.lahaye@gmail.com>
X-Patchwork-Id: 661
Message-Id: <1297716363-2934-1-git-send-email-martin.abente.lahaye@gmail.com>
To: dextrose@lists.sugarlabs.org,
anish@sugarlabs.org
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@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()
|