Linux Archive

Linux Archive (http://www.linux-archive.org/)
-   Debian Java (http://www.linux-archive.org/debian-java/)
-   -   Network spoke: fix races when disabling wireless (on/off switch). (http://www.linux-archive.org/debian-java/672115-network-spoke-fix-races-when-disabling-wireless-off-switch.html)

Radek Vykydal 05-29-2012 08:12 AM

Network spoke: fix races when disabling wireless (on/off switch).
 
---
pyanaconda/ui/gui/spokes/network.py | 13 +++++++++----
1 files changed, 9 insertions(+), 4 deletions(-)

diff --git a/pyanaconda/ui/gui/spokes/network.py b/pyanaconda/ui/gui/spokes/network.py
index dbcd8f0..c513b94 100644
--- a/pyanaconda/ui/gui/spokes/network.py
+++ b/pyanaconda/ui/gui/spokes/network.py
@@ -278,9 +278,8 @@ class NetworkControlBox():
self.on_device_off_toggled)
self.builder.get_object("device_wireless_off_switc h").connect("notify::active",
self.on_device_off_toggled)
- # TODO
- #self.client.connect("notify::%s" % NMClient.CLIENT_WIRELESS_ENABLED,
- # self._wireless_enabled_toggled)
+ self.client.connect("notify::%s" % NMClient.CLIENT_WIRELESS_ENABLED,
+ self.on_wireless_enabled)

self.builder.get_object("button_wired_options").co nnect("clicked",
self.on_edit_connection)
@@ -444,6 +443,12 @@ class NetworkControlBox():

subprocess.Popen(["nm-connection-editor", "--edit", "%s" % uuid])

+ def on_wireless_enabled(self, *args):
+ switch = self.builder.get_object("device_wireless_off_switc h")
+ self._updating_device = True
+ switch.set_active(self.client.wireless_get_enabled ())
+ self._updating_device = False
+
def on_device_off_toggled(self, switch, *args):
if self._updating_device:
print "DBG: off switch ignored"
@@ -775,7 +780,7 @@ class NetworkControlBox():
if not configuration_of_disconnected_devices_allowed:
self.builder.get_object("button_%s_options" % dev_type_str).set_sensitive(state == NetworkManager.DeviceState.ACTIVATED)
elif dev_type_str == "wireless":
- switch.set_active(self.client.wireless_get_enabled ())
+ self.on_wireless_enabled()

def _set_device_info_value(self, dev_type_str, info, value_str):
heading = self.builder.get_object("heading_%s_%s" % (dev_type_str, info))
--
1.7.4

_______________________________________________
Anaconda-devel-list mailing list
Anaconda-devel-list@redhat.com
https://www.redhat.com/mailman/listinfo/anaconda-devel-list


All times are GMT. The time now is 11:47 AM.

VBulletin, Copyright ©2000 - 2014, Jelsoft Enterprises Ltd.
Content Relevant URLs by vBSEO ©2007, Crawlability, Inc.