insensitive versus vanish



So, I just committed a patch to make the wireless menu items (the
banner, networks, "Create ..." menus) go away when wireless is disabled.

This is good.

The question was raised that it makes more sense to make insensitive the
menu items (particularly the "Create Wireless ..." items).

My argument is that we must remove the wireless options, since we cannot
very well insensitize the old list of wireless networks.  Nor should we
insensitize the "Wireless Networks" banner since it is just a banner
(actually I argue it should always be insensitive).  So we need to
remove the banner, too.

That leaves just the "Create Wireless ..." options, which, I would
argue, should follow the same behavior as the other options.  Since they
go away, so should it.

Chris disagrees, however, and I see his points.  So I cooked up a patch
and am sending it out.

	Robert Love

Index: gnome/applet/applet.c
===================================================================
RCS file: /cvs/gnome/NetworkManager/gnome/applet/applet.c,v
retrieving revision 1.75
diff -u -r1.75 applet.c
--- gnome/applet/applet.c	2 Nov 2005 15:37:09 -0000	1.75
+++ gnome/applet/applet.c	2 Nov 2005 16:11:32 -0000
@@ -1539,6 +1539,7 @@
 	gtk_container_add (GTK_CONTAINER (menu_item), label);
 	gtk_widget_show_all (menu_item);
 	gtk_menu_shell_append (GTK_MENU_SHELL (menu), menu_item);
+	gtk_widget_set_sensitive (GTK_WIDGET (menu_item), applet->wireless_enabled);
 	g_signal_connect (menu_item, "activate", G_CALLBACK (custom_essid_item_selected), applet);
 }
 
@@ -1560,6 +1561,7 @@
 	gtk_container_add (GTK_CONTAINER (menu_item), label);
 	gtk_widget_show_all (menu_item);
 	gtk_menu_shell_append (GTK_MENU_SHELL (menu), menu_item);
+	gtk_widget_set_sensitive (GTK_WIDGET (menu_item), applet->wireless_enabled);
 	g_signal_connect (menu_item, "activate", G_CALLBACK (new_network_item_selected), applet);
 }
 
@@ -1859,7 +1861,7 @@
 			nmwa_menu_add_dialup_menu (menu, applet);
 	}
 
-	if (n_wireless_interfaces > 0 && applet->wireless_enabled)
+	if (n_wireless_interfaces > 0)
 	{
 		/* Add the "Other wireless network..." entry */
 		nmwa_menu_add_separator_item (menu);


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