[network-manager-applet/NETWORKMANAGER_APPLET_0_7] core: use new networking enabled/disabled call instead of sleep/wake (rh #589108) (bgo #346615)



commit 7f247224c41754b8e76f0efb7e3cb593d7926ad8
Author: Dan Williams <dcbw redhat com>
Date:   Sat May 22 11:29:54 2010 -0700

    core: use new networking enabled/disabled call instead of sleep/wake (rh #589108) (bgo #346615)

 src/applet.c |    6 ++++--
 1 files changed, 4 insertions(+), 2 deletions(-)
---
diff --git a/src/applet.c b/src/applet.c
index 1c2958e..eaec01f 100644
--- a/src/applet.c
+++ b/src/applet.c
@@ -1302,7 +1302,7 @@ nma_set_networking_enabled_cb (GtkWidget *widget, NMApplet *applet)
 	g_return_if_fail (applet != NULL);
 
 	state = gtk_check_menu_item_get_active (GTK_CHECK_MENU_ITEM (widget));
-	nm_client_sleep (applet->nm_client, !state);
+	nm_client_networking_set_enabled (applet->nm_client, state);
 }
 
 
@@ -1438,6 +1438,7 @@ static void
 nma_context_menu_update (NMApplet *applet)
 {
 	NMState state;
+	gboolean net_enabled = TRUE;
 	gboolean have_wireless = FALSE;
 	gboolean wireless_hw_enabled;
 	gboolean notifications_enabled = TRUE;
@@ -1453,8 +1454,9 @@ nma_context_menu_update (NMApplet *applet)
 	/* Enabled Networking */
 	g_signal_handler_block (G_OBJECT (applet->networking_enabled_item),
 	                        applet->networking_enabled_toggled_id);
+	net_enabled = nm_client_networking_get_enabled (applet->nm_client);
 	gtk_check_menu_item_set_active (GTK_CHECK_MENU_ITEM (applet->networking_enabled_item),
-	                                state != NM_STATE_ASLEEP);
+	                                net_enabled && (state != NM_STATE_ASLEEP));
 	g_signal_handler_unblock (G_OBJECT (applet->networking_enabled_item),
 	                          applet->networking_enabled_toggled_id);
 



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]