Update the ignored hosts list when the location changes (bug #581472)

This commit is contained in:
Maxim Ermilov 2009-08-23 10:00:08 +02:00 committed by Jens Granseuer
parent 56c3163a41
commit 9e84e0ac38

View file

@ -1107,6 +1107,19 @@ connect_sensitivity_signals (GtkBuilder *builder, GSList *mode_group)
}
}
static void
cb_ignore_hosts_gconf_changed (GConfClient *client, guint cnxn_id,
GConfEntry *entry, gpointer user_data)
{
g_slist_foreach (ignore_hosts, (GFunc) g_free, NULL);
g_slist_free (ignore_hosts);
ignore_hosts = gconf_client_get_list (client, IGNORE_HOSTS_KEY,
GCONF_VALUE_STRING, NULL);
populate_listmodel (GTK_LIST_STORE (model), ignore_hosts);
}
static void
setup_dialog (GtkBuilder *builder)
{
@ -1135,6 +1148,8 @@ setup_dialog (GtkBuilder *builder)
gconf_client_add_dir (client, LOCATION_DIR, GCONF_CLIENT_PRELOAD_ONELEVEL, NULL);
gconf_client_notify_add (client, CURRENT_LOCATION, (GConfClientNotifyFunc) cb_current_location, builder, NULL, NULL);
gconf_client_notify_add (client, IGNORE_HOSTS_KEY, cb_ignore_hosts_gconf_changed, NULL, NULL, NULL);
g_signal_connect (location_box, "changed", G_CALLBACK (cb_location_changed), builder);
g_signal_connect (gtk_builder_get_object (builder, "delete_button"), "clicked", G_CALLBACK (cb_delete_button_clicked), builder);