summaryrefslogtreecommitdiff
path: root/info-daemon
diff options
context:
space:
mode:
authorDan Williams <dcbw@redhat.com>2004-07-27 20:25:35 +0000
committerDan Williams <dcbw@redhat.com>2004-07-27 20:25:35 +0000
commitbe590d9793bb98b3e5ec64c05ab914f6b2a6935e (patch)
tree3e949e9ddac9ca577dcf61e37d497e52cc0ab78f /info-daemon
parent8945fdfd7cc36d8a264622f17456bd6dda4b06ef (diff)
downloadNetworkManager-be590d9793bb98b3e5ec64c05ab914f6b2a6935e.tar.gz
2004-07-27 Dan Williams <dcbw@redhat.com>
* info-daemon/NetworkManagerInfo.c - Update allowed network's GConf key when user enters a WEP key explicitly * info-daemon/NetworkManagerDbus.c - Fix some comments - nmi_dbus_get_allowed_networks(): kill warning git-svn-id: http://svn-archive.gnome.org/svn/NetworkManager/trunk@26 4912f4e0-d625-0410-9fb7-b9a5a253dbdc
Diffstat (limited to 'info-daemon')
-rw-r--r--info-daemon/NetworkManagerInfo.c16
-rw-r--r--info-daemon/NetworkManagerInfoDbus.c8
2 files changed, 20 insertions, 4 deletions
diff --git a/info-daemon/NetworkManagerInfo.c b/info-daemon/NetworkManagerInfo.c
index 48797cba22..43889911f8 100644
--- a/info-daemon/NetworkManagerInfo.c
+++ b/info-daemon/NetworkManagerInfo.c
@@ -90,8 +90,24 @@ static void ok_button_clicked (GtkWidget *ok_button, gpointer user_data)
const char *passphrase = gtk_entry_get_text (GTK_ENTRY (entry));
const char *device = g_object_get_data (G_OBJECT (dialog), "device");
const char *network = g_object_get_data (G_OBJECT (dialog), "network");
+ gchar *key = NULL;
+ GConfEntry *gconf_entry;
+ /* Tell NetworkManager about the key the user typed in */
nmi_dbus_return_user_key (info->connection, device, network, passphrase);
+
+ /* Update GConf with the new user key */
+ key = g_strdup_printf ("%s/%s", NMI_GCONF_ALLOWED_NETWORKS_PATH, network);
+ gconf_entry = gconf_client_get_entry (info->gconf_client, key, NULL, TRUE, NULL);
+ g_free (key);
+ if (gconf_entry)
+ {
+ gconf_entry_unref (gconf_entry);
+ key = g_strdup_printf ("%s/%s/key", NMI_GCONF_ALLOWED_NETWORKS_PATH, network);
+ gconf_client_set_string (info->gconf_client, key, passphrase, NULL);
+ g_free (key);
+ }
+
nmi_clear_dialog (dialog, entry);
}
}
diff --git a/info-daemon/NetworkManagerInfoDbus.c b/info-daemon/NetworkManagerInfoDbus.c
index 02c150cd20..65a1d22437 100644
--- a/info-daemon/NetworkManagerInfoDbus.c
+++ b/info-daemon/NetworkManagerInfoDbus.c
@@ -193,7 +193,7 @@ static DBusMessage *nmi_dbus_get_allowed_networks (NMIAppInfo *info, DBusMessage
gchar key[100];
GConfValue *value;
- g_snprintf (&key[0], 99, "%s/essid", element->data);
+ g_snprintf (&key[0], 99, "%s/essid", (char *)(element->data));
value = gconf_client_get (info->gconf_client, key, NULL);
if (value && gconf_value_get_string (value))
{
@@ -242,7 +242,7 @@ static DBusMessage *nmi_dbus_get_allowed_network_prio (NMIAppInfo *info, DBusMes
return (reply_message);
}
- /* List all allowed access points that gconf knows about */
+ /* Grab priority key for our access point from GConf */
key = g_strdup_printf ("%s/%s/priority", NMI_GCONF_ALLOWED_NETWORKS_PATH, network);
value = gconf_client_get (info->gconf_client, key, NULL);
g_free (key);
@@ -290,7 +290,7 @@ static DBusMessage *nmi_dbus_get_allowed_network_essid (NMIAppInfo *info, DBusMe
return (reply_message);
}
- /* List all allowed access points that gconf knows about */
+ /* Grab essid key for our access point from GConf */
key = g_strdup_printf ("%s/%s/essid", NMI_GCONF_ALLOWED_NETWORKS_PATH, network);
value = gconf_client_get (info->gconf_client, key, NULL);
g_free (key);
@@ -338,7 +338,7 @@ static DBusMessage *nmi_dbus_get_allowed_network_key (NMIAppInfo *info, DBusMess
return (reply_message);
}
- /* List all allowed access points that gconf knows about */
+ /* Grab user-key key for our access point from GConf */
key = g_strdup_printf ("%s/%s/key", NMI_GCONF_ALLOWED_NETWORKS_PATH, network);
value = gconf_client_get (info->gconf_client, key, NULL);
g_free (key);