aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--addressbook/ChangeLog8
-rw-r--r--addressbook/gui/contact-list-editor/e-contact-list-editor.c23
2 files changed, 28 insertions, 3 deletions
diff --git a/addressbook/ChangeLog b/addressbook/ChangeLog
index 9b993f50d8..234263b43f 100644
--- a/addressbook/ChangeLog
+++ b/addressbook/ChangeLog
@@ -1,3 +1,11 @@
+2005-08-22 Sushma Rai <rsushma@novell.com>
+
+ * gui/contact-list-editor/e-contact-list-editor.c (remove_entry_cb):
+ Changes contact-list-editor so that multiple items can be selected and
+ removed at once. Fixes #235038.
+ Patch submitted by "sean.gao@sun.com (Sean Gao)" and patch was
+ corected by "Devashish Sharma <sdevashish@novell.com>"
+
2005-08-22 Devashish Sharma <sdevashish@novell.com>
* gui/widgets/eab-contact-compare.c (match_email_hostname): This
diff --git a/addressbook/gui/contact-list-editor/e-contact-list-editor.c b/addressbook/gui/contact-list-editor/e-contact-list-editor.c
index fd48e53af7..a8424814e0 100644
--- a/addressbook/gui/contact-list-editor/e-contact-list-editor.c
+++ b/addressbook/gui/contact-list-editor/e-contact-list-editor.c
@@ -789,16 +789,33 @@ add_email_cb (GtkWidget *w, EContactListEditor *editor)
}
static void
-remove_row (int model_row, EContactListEditor *editor)
+prepend_selected_rows (int model_row, GList **list)
{
- e_contact_list_model_remove_row (E_CONTACT_LIST_MODEL (editor->model), model_row);
+ int *idx = g_new (int, 1);
+ *idx = model_row;
+ *list = g_list_append (*list, idx);
}
static void
remove_entry_cb (GtkWidget *w, EContactListEditor *editor)
{
+ int *idx = NULL;
+ GList *list = NULL;
+ int num_rows_deleted = 0;
e_table_selected_row_foreach (e_table_scrolled_get_table(E_TABLE_SCROLLED(editor->table)),
- (EForeachFunc)remove_row, editor);
+ (EForeachFunc)prepend_selected_rows, &list);
+
+ if (!list) return ;
+
+ for(; list; list=list->next, num_rows_deleted++) {
+ idx = (int *)(list->data);
+ e_contact_list_model_remove_row (E_CONTACT_LIST_MODEL (editor->model), (*idx - num_rows_deleted));
+ g_free (idx);
+ list->data = NULL;
+ }
+
+ list = g_list_first (list);
+ g_list_free (list);
editor->changed = TRUE;
command_state_changed (editor);
}