network-manager-applet r806 - in trunk: . src src/connection-editor src/wireless-security



Author: dcbw
Date: Mon Jul 28 22:02:03 2008
New Revision: 806
URL: http://svn.gnome.org/viewvc/network-manager-applet?rev=806&view=rev

Log:
2008-07-28  Dan Williams  <dcbw redhat com>

	* src/wireless-security/ws-wep-key.c
	  src/wireless-security/ws-wep-key.h
		- (ws_wep_key_new): WEP auth method and key indexes are pretty pointless
			for Ad-Hoc networks; hide them in the Ad-Hoc case

	* src/wireless-dialog.c
	  src/connection-editor/page-wireless-security.c
		- (security_combo_init, ce_page_wireless_security_new): fix up for
			above change



Modified:
   trunk/ChangeLog
   trunk/src/connection-editor/page-wireless-security.c
   trunk/src/wireless-dialog.c
   trunk/src/wireless-security/ws-wep-key.c
   trunk/src/wireless-security/ws-wep-key.h

Modified: trunk/src/connection-editor/page-wireless-security.c
==============================================================================
--- trunk/src/connection-editor/page-wireless-security.c	(original)
+++ trunk/src/connection-editor/page-wireless-security.c	Mon Jul 28 22:02:03 2008
@@ -252,7 +252,7 @@
 		if (default_type == NMU_SEC_STATIC_WEP)
 			default_wep_type = ws_wep_guess_key_type (connection, connection_id);
 
-		ws_wep = ws_wep_key_new (glade_file, connection, connection_id, WEP_KEY_TYPE_PASSPHRASE);
+		ws_wep = ws_wep_key_new (glade_file, connection, connection_id, WEP_KEY_TYPE_PASSPHRASE, FALSE);
 		if (ws_wep) {
 			add_security_item (self, WIRELESS_SECURITY (ws_wep), sec_model,
 			                   &iter, _("WEP 128-bit Passphrase"));
@@ -261,7 +261,7 @@
 			item++;
 		}
 
-		ws_wep = ws_wep_key_new (glade_file, connection, connection_id, WEP_KEY_TYPE_HEX);
+		ws_wep = ws_wep_key_new (glade_file, connection, connection_id, WEP_KEY_TYPE_HEX, FALSE);
 		if (ws_wep) {
 			add_security_item (self, WIRELESS_SECURITY (ws_wep), sec_model,
 			                   &iter, _("WEP 40/128-bit Hexadecimal"));
@@ -270,7 +270,7 @@
 			item++;
 		}
 
-		ws_wep = ws_wep_key_new (glade_file, connection, connection_id, WEP_KEY_TYPE_ASCII);
+		ws_wep = ws_wep_key_new (glade_file, connection, connection_id, WEP_KEY_TYPE_ASCII, FALSE);
 		if (ws_wep) {
 			add_security_item (self, WIRELESS_SECURITY (ws_wep), sec_model,
 			                   &iter, _("WEP 40/128-bit ASCII"));

Modified: trunk/src/wireless-dialog.c
==============================================================================
--- trunk/src/wireless-dialog.c	(original)
+++ trunk/src/wireless-dialog.c	Mon Jul 28 22:02:03 2008
@@ -746,7 +746,7 @@
 		if (default_type == NMU_SEC_STATIC_WEP)
 			default_wep_type = ws_wep_guess_key_type (priv->connection, connection_id);
 
-		ws_wep = ws_wep_key_new (priv->glade_file, priv->connection, connection_id, WEP_KEY_TYPE_PASSPHRASE);
+		ws_wep = ws_wep_key_new (priv->glade_file, priv->connection, connection_id, WEP_KEY_TYPE_PASSPHRASE, priv->adhoc_create);
 		if (ws_wep) {
 			add_security_item (self, WIRELESS_SECURITY (ws_wep), sec_model,
 			                   &iter, _("WEP 128-bit Passphrase"));
@@ -755,7 +755,7 @@
 			item++;
 		}
 
-		ws_wep = ws_wep_key_new (priv->glade_file, priv->connection, connection_id, WEP_KEY_TYPE_HEX);
+		ws_wep = ws_wep_key_new (priv->glade_file, priv->connection, connection_id, WEP_KEY_TYPE_HEX, priv->adhoc_create);
 		if (ws_wep) {
 			add_security_item (self, WIRELESS_SECURITY (ws_wep), sec_model,
 			                   &iter, _("WEP 40/128-bit Hexadecimal"));
@@ -764,7 +764,7 @@
 			item++;
 		}
 
-		ws_wep = ws_wep_key_new (priv->glade_file, priv->connection, connection_id, WEP_KEY_TYPE_ASCII);
+		ws_wep = ws_wep_key_new (priv->glade_file, priv->connection, connection_id, WEP_KEY_TYPE_ASCII, priv->adhoc_create);
 		if (ws_wep) {
 			add_security_item (self, WIRELESS_SECURITY (ws_wep), sec_model,
 			                   &iter, _("WEP 40/128-bit ASCII"));

Modified: trunk/src/wireless-security/ws-wep-key.c
==============================================================================
--- trunk/src/wireless-security/ws-wep-key.c	(original)
+++ trunk/src/wireless-security/ws-wep-key.c	Mon Jul 28 22:02:03 2008
@@ -268,14 +268,15 @@
 ws_wep_key_new (const char *glade_file,
                 NMConnection *connection,
                 const char *connection_id,
-                WEPKeyType type)
+                WEPKeyType type,
+                gboolean adhoc_create)
 {
 	WirelessSecurityWEPKey *sec;
 	GtkWidget *widget;
 	GladeXML *xml;
 	NMSettingWirelessSecurity *s_wsec = NULL;
 	guint8 default_key_idx = 0;
-	gboolean is_adhoc = FALSE;
+	gboolean is_adhoc = adhoc_create;
 	gboolean is_shared_key = FALSE;
 
 	g_return_val_if_fail (glade_file != NULL, NULL);
@@ -376,6 +377,13 @@
 	                  (GCallback) key_index_combo_changed_cb,
 	                  sec);
 
+	/* Key index is useless with adhoc networks */
+	if (is_adhoc) {
+		gtk_widget_hide (widget);
+		widget = glade_xml_get_widget (xml, "key_index_label");
+		gtk_widget_hide (widget);
+	}
+
 	/* Fill the key entry with the key for that index */
 	widget = glade_xml_get_widget (xml, "wep_key_entry");
 	if (strlen (sec->keys[default_key_idx]))
@@ -393,7 +401,9 @@
 	/* Ad-Hoc connections can't use Shared Key auth */
 	if (is_adhoc) {
 		gtk_combo_box_set_active (GTK_COMBO_BOX (widget), 0);
-		gtk_widget_set_sensitive (widget, FALSE);
+		gtk_widget_hide (widget);
+		widget = glade_xml_get_widget (xml, "auth_method_label");
+		gtk_widget_hide (widget);
 	}
 
 	return sec;

Modified: trunk/src/wireless-security/ws-wep-key.h
==============================================================================
--- trunk/src/wireless-security/ws-wep-key.h	(original)
+++ trunk/src/wireless-security/ws-wep-key.h	Mon Jul 28 22:02:03 2008
@@ -39,7 +39,8 @@
 WirelessSecurityWEPKey * ws_wep_key_new (const char *glade_file,
                                          NMConnection *connection,
                                          const char *connection_id,
-                                         WEPKeyType type);
+                                         WEPKeyType type,
+                                         gboolean adhoc_create);
 
 WEPKeyType ws_wep_guess_key_type (NMConnection *connection, const char *connection_id);
 



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