[network-manager-applet] gsm/cdma: fix display of disabled device status



commit 9aff106af5315e04f0c5f898d46ae4a5d56e4896
Author: Dan Williams <dcbw redhat com>
Date:   Sun Apr 11 21:12:41 2010 -0700

    gsm/cdma: fix display of disabled device status

 src/mb-menu-item.c |   39 +++++++++++++++++++--------------------
 1 files changed, 19 insertions(+), 20 deletions(-)
---
diff --git a/src/mb-menu-item.c b/src/mb-menu-item.c
index 6ee163c..b758ca7 100644
--- a/src/mb-menu-item.c
+++ b/src/mb-menu-item.c
@@ -162,27 +162,26 @@ nm_mb_menu_item_new (const char *connection_name,
 		break;
 	}
 
-	if (enabled) {
-		/* Assume a connection name means the label should be active */
-		if (connection_name) {
-			char *markup;
-
-			gtk_label_set_use_markup (GTK_LABEL (priv->desc), TRUE);
-			markup = g_markup_printf_escaped ("<b>%s</b>", priv->desc_string);
-			gtk_label_set_markup (GTK_LABEL (priv->desc), markup);
-			g_free (markup);
-			gtk_widget_set_sensitive (GTK_WIDGET (item), TRUE);
-		} else {
-			gtk_label_set_use_markup (GTK_LABEL (priv->desc), FALSE);
-			gtk_label_set_text (GTK_LABEL (priv->desc), priv->desc_string);
-			gtk_widget_set_sensitive (GTK_WIDGET (item), FALSE);
-		}
+	/* Assume a connection name means the label should be active */
+	if (enabled && connection_name) {
+		char *markup;
+
+		gtk_label_set_use_markup (GTK_LABEL (priv->desc), TRUE);
+		markup = g_markup_printf_escaped ("<b>%s</b>", priv->desc_string);
+		gtk_label_set_markup (GTK_LABEL (priv->desc), markup);
+		g_free (markup);
+		gtk_widget_set_sensitive (GTK_WIDGET (item), TRUE);
+	} else {
+		/* Disconnected and disabled states */
+		gtk_label_set_use_markup (GTK_LABEL (priv->desc), FALSE);
+		gtk_label_set_text (GTK_LABEL (priv->desc), priv->desc_string);
+		gtk_widget_set_sensitive (GTK_WIDGET (item), FALSE);
+	}
 
-		/* And the strength icon, if we have strength information at all */
-		if (strength) {
-			gtk_image_set_from_pixbuf (GTK_IMAGE (priv->strength),
-			                           mobile_helper_get_quality_icon (strength, applet));
-		}
+	/* And the strength icon, if we have strength information at all */
+	if (enabled && strength) {
+		gtk_image_set_from_pixbuf (GTK_IMAGE (priv->strength),
+		                           mobile_helper_get_quality_icon (strength, applet));
 	}
 
 	return GTK_WIDGET (item);



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