From d78749b52160b46f3409963372113c786c0088e7 Mon Sep 17 00:00:00 2001 From: Iain Holmes Date: Fri, 6 Jul 2001 17:26:47 +0000 Subject: Fix bad selection clist stuff svn path=/trunk/; revision=10848 --- my-evolution/ChangeLog | 9 +++++++++ my-evolution/e-summary-preferences.c | 39 ++++++++++++++++++++---------------- my-evolution/my-evolution.glade | 4 ++-- 3 files changed, 33 insertions(+), 19 deletions(-) (limited to 'my-evolution') diff --git a/my-evolution/ChangeLog b/my-evolution/ChangeLog index 318d8055af..787d5df475 100644 --- a/my-evolution/ChangeLog +++ b/my-evolution/ChangeLog @@ -1,3 +1,12 @@ +2001-07-06 Iain Holmes + + * e-summary-preferences.c (fill_rdf_shown_list): Attach data + (rdf_add_clicked_cb): Allow multiple rows to be removed. + (rdf_remove_clicked_cb): Use the data. + + * my-evolution.glade: Allow multiple selection in the RDF all clist. + Only allow single selection in the shown rdf list. + 2001-07-05 Iain Holmes * e-summary-preferences.c (rdf_new_url_clicked_cb): Change RDF to diff --git a/my-evolution/e-summary-preferences.c b/my-evolution/e-summary-preferences.c index e134aeb868..0b66b231de 100644 --- a/my-evolution/e-summary-preferences.c +++ b/my-evolution/e-summary-preferences.c @@ -568,9 +568,11 @@ fill_rdf_shown_clist (GtkCList *clist, for (p = pd->summary->preferences->rdf_urls; p; p = p->next) { char *text[1]; + int row; text[0] = (char *) find_name_for_url (pd, p->data); - gtk_clist_append (clist, text); + row = gtk_clist_append (clist, text); + gtk_clist_set_row_data (clist, row, p); } } @@ -723,25 +725,28 @@ rdf_add_clicked_cb (GtkButton *button, PropertyData *pd) { struct _RDFInfo *info; - GList *p; + GList *p, *rows; char *text[1]; int row; - row = GPOINTER_TO_INT (GTK_CLIST (pd->rdf->all)->selection->data); - info = gtk_clist_get_row_data (GTK_CLIST (pd->rdf->all), row); - - text[0] = info->name; - - for (p = pd->summary->preferences->rdf_urls; p; p = p->next) { - if (strcmp (p->data, info->url) == 0) { - /* Found it already */ - return; + for (rows = GTK_CLIST (pd->rdf->all)->selection; rows; rows = rows->next) { + row = GPOINTER_TO_INT (rows->data); + info = gtk_clist_get_row_data (GTK_CLIST (pd->rdf->all), row); + + text[0] = info->name; + + for (p = pd->summary->preferences->rdf_urls; p; p = p->next) { + if (strcmp (p->data, info->url) == 0) { + /* Found it already */ + return; + } } + + pd->summary->preferences->rdf_urls = g_list_prepend (pd->summary->preferences->rdf_urls, g_strdup (info->url)); + row = gtk_clist_prepend (GTK_CLIST (pd->rdf->shown), text); + gtk_clist_set_row_data (GTK_CLIST (pd->rdf->shown), row, + pd->summary->preferences->rdf_urls); } - - pd->summary->preferences->rdf_urls = g_list_prepend (pd->summary->preferences->rdf_urls, g_strdup (info->url)); - gtk_clist_prepend (GTK_CLIST (pd->rdf->shown), text); - gnome_property_box_changed (pd->box); } @@ -753,9 +758,9 @@ rdf_remove_clicked_cb (GtkButton *button, int row; row = GPOINTER_TO_INT (GTK_CLIST (pd->rdf->shown)->selection->data); + p = gtk_clist_get_row_data (GTK_CLIST (pd->rdf->shown), row); gtk_clist_remove (GTK_CLIST (pd->rdf->shown), row); - - p = g_list_nth (pd->summary->preferences->rdf_urls, row); + pd->summary->preferences->rdf_urls = g_list_remove_link (pd->summary->preferences->rdf_urls, p); g_free (p->data); g_list_free (p); diff --git a/my-evolution/my-evolution.glade b/my-evolution/my-evolution.glade index c4f1dfef90..cf2b8416bc 100644 --- a/my-evolution/my-evolution.glade +++ b/my-evolution/my-evolution.glade @@ -514,7 +514,7 @@ True 1 80 - GTK_SELECTION_EXTENDED + GTK_SELECTION_SINGLE False GTK_SHADOW_IN @@ -774,7 +774,7 @@ GtkLabel Notebook:tab label6 - + GTK_JUSTIFY_CENTER False 0.5 -- cgit v1.2.3