diff --git a/ChangeLog b/ChangeLog index 5a330397aa..e48700eee7 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,29 @@ +2004-08-20 Dan Williams + + * info-daemon/NetworkManagerInfoPassphraseDialog.c + - (nmi_passphrase_dialog_ok_clicked): when updating the wep key + for a network, set the essid as well since it may not exist yet + - (nmi_passphrase_dialog_init): don't star out the passphrase field, + since WEP keys/passphrases are long and prone to entry-error + + * panel-applet/Makefile.am + panel-applet/wired.png + - Add (pulled from system-config-network temporarily) + + * panel-applet/NMWirelessApplet.[ch] + - Show wired picture when a wired connection is used + - Rename wireless icon enums, adding WIRELESS + + * src/NetworkManagerDevice.c + - (nm_device_activate_wireless): unset encryption before bringing + down the card and setting the essid + - (nm_device_activatin_worker): request a key from the user if the + AP we are connecting to is encrypted but we don't have a key + for it yet + - (nm_device_set_user_key_for_network): fix missing '== 0' for a + strcmp() that prevented a user-entered key from actually getting + used + 2004-08-16 Dan Williams * initscript/NetworkManager diff --git a/info-daemon/NetworkManagerInfoPassphraseDialog.c b/info-daemon/NetworkManagerInfoPassphraseDialog.c index 639fd870de..9f79e18321 100644 --- a/info-daemon/NetworkManagerInfoPassphraseDialog.c +++ b/info-daemon/NetworkManagerInfoPassphraseDialog.c @@ -101,6 +101,9 @@ void nmi_passphrase_dialog_ok_clicked (GtkWidget *ok_button, gpointer user_data) key = g_strdup_printf ("%s/%s/key", NMI_GCONF_TRUSTED_NETWORKS_PATH, network); gconf_client_set_string (info->gconf_client, key, passphrase, NULL); g_free (key); + key = g_strdup_printf ("%s/%s/essid", NMI_GCONF_TRUSTED_NETWORKS_PATH, network); + gconf_client_set_string (info->gconf_client, key, network, NULL); + g_free (key); } nmi_passphrase_dialog_clear (dialog, entry); @@ -219,9 +222,6 @@ int nmi_passphrase_dialog_init (NMIAppInfo *info) g_signal_connect (G_OBJECT (cancel_button), "clicked", GTK_SIGNAL_FUNC (nmi_passphrase_dialog_cancel_clicked), info); entry = GTK_ENTRY (glade_xml_get_widget (info->passphrase_dialog, "passphrase_entry")); - gtk_entry_set_visibility (entry, FALSE); - gtk_entry_set_invisible_char (entry, '*'); - nmi_passphrase_dialog_clear (dialog, GTK_WIDGET (entry)); return (0); diff --git a/panel-applet/Makefile.am b/panel-applet/Makefile.am index ea06fe228f..08b66a8223 100644 --- a/panel-applet/Makefile.am +++ b/panel-applet/Makefile.am @@ -43,8 +43,9 @@ ui_DATA = NMWirelessApplet.xml pixmapdir = $(datadir)/pixmaps/NMWirelessApplet pixmap_DATA = no-link-0.png \ + wired.png \ broken-0.png \ - signal-1-40.png \ + signal-1-40.png \ signal-41-60.png \ signal-61-80.png \ signal-81-100.png \ diff --git a/panel-applet/NMWirelessApplet.c b/panel-applet/NMWirelessApplet.c index 3f19d4e612..037eac9a61 100644 --- a/panel-applet/NMWirelessApplet.c +++ b/panel-applet/NMWirelessApplet.c @@ -52,7 +52,7 @@ static char * pixmap_names[] = { - "broken-0.png", + "wired.png", "no-link-0.png", "signal-1-40.png", "signal-41-60.png", @@ -132,6 +132,7 @@ static void nmwa_draw (NMWirelessApplet *applet) */ static void nmwa_update_state (NMWirelessApplet *applet) { + applet->pix_state = PIX_WIRED; if (applet->nm_active) { char *status = nmwa_dbus_get_nm_status (applet->connection); @@ -145,12 +146,12 @@ static void nmwa_update_state (NMWirelessApplet *applet) { case (DEVICE_TYPE_WIRELESS_ETHERNET): if (strcmp (status, "connected") == 0) - applet->pix_state = PIX_SIGNAL_4; + applet->pix_state = PIX_WIRELESS_SIGNAL_4; else if (strcmp (status, "connecting") == 0) { - if ( (applet->pix_state < PIX_CONNECT_0) - || (applet->pix_state > PIX_CONNECT_2)) - applet->pix_state = PIX_CONNECT_0; + if ( (applet->pix_state < PIX_WIRELESS_CONNECT_0) + || (applet->pix_state > PIX_WIRELESS_CONNECT_2)) + applet->pix_state = PIX_WIRELESS_CONNECT_0; else applet->pix_state++; } @@ -158,18 +159,14 @@ static void nmwa_update_state (NMWirelessApplet *applet) case (DEVICE_TYPE_WIRED_ETHERNET): default: - applet->pix_state = PIX_BROKEN; + applet->pix_state = PIX_WIRED; break; } } - else - applet->pix_state = PIX_BROKEN; if (active_device) dbus_free (active_device); if (status) dbus_free (status); } - else - applet->pix_state = PIX_BROKEN; nmwa_draw (applet); } @@ -220,7 +217,7 @@ static void nmwa_load_theme (NMWirelessApplet *applet) { pixmapname = g_build_filename (G_DIR_SEPARATOR_S, pixmapdir, pixmap_names[i], NULL); - applet->pixmaps[i] = gdk_pixbuf_new_from_file (pixmapname, NULL); + applet->pixmaps[i] = gdk_pixbuf_new_from_file_at_size (pixmapname, 32, 16, NULL); g_free (pixmapname); } @@ -578,7 +575,7 @@ static void nmwa_setup_widgets (NMWirelessApplet *applet) /* construct pixmap widget */ applet->pixmap = gtk_image_new (); - gtk_image_set_from_pixbuf (GTK_IMAGE (applet->pixmap), applet->pixmaps[PIX_BROKEN]); + gtk_image_set_from_pixbuf (GTK_IMAGE (applet->pixmap), applet->pixmaps[PIX_WIRED]); gtk_widget_size_request (applet->pixmap, &req); gtk_widget_show (applet->pixmap); @@ -691,7 +688,7 @@ static GtkWidget * nmwa_new (NMWirelessApplet *applet) } #endif - applet->pix_state = PIX_BROKEN; + applet->pix_state = PIX_WIRED; applet->connection = nmwa_dbus_init(applet); applet->nm_active = nmwa_dbus_nm_is_running(applet->connection); diff --git a/panel-applet/NMWirelessApplet.h b/panel-applet/NMWirelessApplet.h index 40bf6f6a95..8ecb19c331 100644 --- a/panel-applet/NMWirelessApplet.h +++ b/panel-applet/NMWirelessApplet.h @@ -30,16 +30,16 @@ typedef enum { - PIX_BROKEN, - PIX_NO_LINK, - PIX_SIGNAL_1, - PIX_SIGNAL_2, - PIX_SIGNAL_3, - PIX_SIGNAL_4, - PIX_CONNECT_0, - PIX_CONNECT_1, - PIX_CONNECT_2, - PIX_CONNECT_3, + PIX_WIRED, + PIX_WIRELESS_NO_LINK, + PIX_WIRELESS_SIGNAL_1, + PIX_WIRELESS_SIGNAL_2, + PIX_WIRELESS_SIGNAL_3, + PIX_WIRELESS_SIGNAL_4, + PIX_WIRELESS_CONNECT_0, + PIX_WIRELESS_CONNECT_1, + PIX_WIRELESS_CONNECT_2, + PIX_WIRELESS_CONNECT_3, PIX_NUMBER, } PixmapState; diff --git a/panel-applet/wired.png b/panel-applet/wired.png new file mode 100644 index 0000000000..1bf6d7d34e Binary files /dev/null and b/panel-applet/wired.png differ diff --git a/src/NetworkManagerDevice.c b/src/NetworkManagerDevice.c index 493c6c56a5..f9934155b6 100644 --- a/src/NetworkManagerDevice.c +++ b/src/NetworkManagerDevice.c @@ -859,14 +859,14 @@ static gboolean nm_device_activate_wireless (NMDevice *dev) /* If there is a desired AP to connect to, use that essid and possible WEP key */ if (best_ap && nm_ap_get_essid (best_ap)) { - nm_device_bring_down (dev); - nm_device_set_essid (dev, nm_ap_get_essid (best_ap)); - /* Disable WEP */ nm_device_set_wep_key (dev, NULL); if (nm_ap_get_encrypted (best_ap) && nm_ap_get_wep_key (best_ap)) nm_device_set_wep_key (dev, nm_ap_get_wep_key (best_ap)); + nm_device_bring_down (dev); + nm_device_set_essid (dev, nm_ap_get_essid (best_ap)); + NM_DEBUG_PRINT_2 ("nm_device_wireless_activate(%s) using essid '%s'\n", nm_device_get_iface (dev), nm_ap_get_essid (best_ap)); /* Bring the device up */ @@ -921,7 +921,8 @@ fprintf( stderr, "nm_device_activation_worker (%s) started...\n", nm_device_get_ if ((best_ap = nm_device_get_best_ap (dev))) { /* WEP key we have is wrong, ask user for one */ - if (!nm_device_need_ap_switch (dev) && nm_ap_get_encrypted (best_ap)) + if ( (!nm_device_need_ap_switch (dev) || !nm_ap_get_wep_key (best_ap)) + && nm_ap_get_encrypted (best_ap)) { dev->options.wireless.user_key_received = FALSE; nm_dbus_get_user_key_for_network (dev->app_data->dbus_connection, dev, best_ap); @@ -939,7 +940,7 @@ fprintf( stderr, "nm_device_activation_worker(%s): activation canceled 1\n", nm_ return (NULL); } - fprintf (stderr, "nm_device_activation_worker(%s): user key received!\n", nm_device_get_iface (dev)); +fprintf (stderr, "nm_device_activation_worker(%s): user key received!\n", nm_device_get_iface (dev)); } nm_device_activate_wireless (dev); @@ -1192,7 +1193,7 @@ void nm_device_set_user_key_for_network (NMDevice *dev, NMAccessPointList *inval /* Make sure the "best" ap matches the essid we asked for the key of, * then set the new key on the access point. */ - if (nm_null_safe_strcmp (network, nm_ap_get_essid (best_ap))) + if (nm_null_safe_strcmp (network, nm_ap_get_essid (best_ap)) == 0) nm_ap_set_wep_key (best_ap, key); }