[network-manager-applet] applet: update for NM API changes



commit ff72ead79d82998d01f6d1f116f1ad92dff7d567
Author: Dan Williams <dcbw redhat com>
Date:   Tue Feb 15 10:51:36 2011 -0600

    applet: update for NM API changes

 src/applet.c |   13 ++++++++++---
 1 files changed, 10 insertions(+), 3 deletions(-)
---
diff --git a/src/applet.c b/src/applet.c
index 34b77e8..4399cb0 100644
--- a/src/applet.c
+++ b/src/applet.c
@@ -1514,6 +1514,7 @@ nma_menu_add_vpn_submenu (GtkWidget *menu, NMApplet *applet)
 		NMActiveConnection *active;
 		const char *name;
 		GtkWidget *image;
+		NMState state;
 
 		name = get_connection_id (connection);
 
@@ -1526,7 +1527,10 @@ nma_menu_add_vpn_submenu (GtkWidget *menu, NMApplet *applet)
 		 */
 		active = applet_get_active_for_connection (applet, connection);
 
-		if (nm_client_get_state (applet->nm_client) != NM_STATE_CONNECTED)
+		state = nm_client_get_state (applet->nm_client);
+		if (   state != NM_STATE_CONNECTED_LOCAL
+		    && state != NM_STATE_CONNECTED_SITE
+		    && state != NM_STATE_CONNECTED_GLOBAL)
 			gtk_widget_set_sensitive (GTK_WIDGET (item), FALSE);
 		else if ((num_vpn_active == 0) || active)
 			gtk_widget_set_sensitive (GTK_WIDGET (item), TRUE);
@@ -1732,10 +1736,13 @@ nma_context_menu_update (NMApplet *applet)
 	gboolean wwan_hw_enabled;
 	gboolean wimax_hw_enabled;
 	gboolean notifications_enabled = TRUE;
+	gboolean sensitive = FALSE;
 
 	state = nm_client_get_state (applet->nm_client);
-
-	gtk_widget_set_sensitive (applet->info_menu_item, state == NM_STATE_CONNECTED);
+	sensitive = (   state == NM_STATE_CONNECTED_LOCAL
+	             || state == NM_STATE_CONNECTED_SITE
+	             || state == NM_STATE_CONNECTED_GLOBAL);
+	gtk_widget_set_sensitive (applet->info_menu_item, sensitive);
 
 	/* Update checkboxes, and block 'toggled' signal when updating so that the
 	 * callback doesn't get triggered.



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