From b770456511728325e90bfc304f1c0b8aff3e7168 Mon Sep 17 00:00:00 2001 From: Dan Williams Date: Fri, 20 Aug 2004 18:18:37 +0000 Subject: [PATCH] 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 git-svn-id: http://svn-archive.gnome.org/svn/NetworkManager/trunk@58 4912f4e0-d625-0410-9fb7-b9a5a253dbdc --- ChangeLog | 26 ++++++++++++++++++ .../NetworkManagerInfoPassphraseDialog.c | 6 ++-- panel-applet/Makefile.am | 3 +- panel-applet/NMWirelessApplet.c | 23 +++++++--------- panel-applet/NMWirelessApplet.h | 20 +++++++------- panel-applet/wired.png | Bin 0 -> 3766 bytes src/NetworkManagerDevice.c | 13 +++++---- 7 files changed, 58 insertions(+), 33 deletions(-) create mode 100644 panel-applet/wired.png 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 0000000000000000000000000000000000000000..1bf6d7d34e0d827b0081ea0bae3a98eb1518d54f GIT binary patch literal 3766 zcmV;n4oUHeP)InW$xi37H6pXoe_mDMV3eFl+)%H#AE_H@(r__TI0T*RS8b z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,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); }