diff options
author | Srinivasa Ragavan <sragavan@src.gnome.org> | 2007-02-26 13:57:02 +0800 |
---|---|---|
committer | Srinivasa Ragavan <sragavan@src.gnome.org> | 2007-02-26 13:57:02 +0800 |
commit | 522e3a2d20809525451977b3476d09a0ea8cd2e7 (patch) | |
tree | 61c924b4c88bf363cff2708c80151fb8cb4cee71 /addressbook/gui | |
parent | 1bd2d48ad173fce47b431b5e90db761f16fa4e74 (diff) | |
download | gsoc2013-evolution-522e3a2d20809525451977b3476d09a0ea8cd2e7.tar gsoc2013-evolution-522e3a2d20809525451977b3476d09a0ea8cd2e7.tar.gz gsoc2013-evolution-522e3a2d20809525451977b3476d09a0ea8cd2e7.tar.bz2 gsoc2013-evolution-522e3a2d20809525451977b3476d09a0ea8cd2e7.tar.lz gsoc2013-evolution-522e3a2d20809525451977b3476d09a0ea8cd2e7.tar.xz gsoc2013-evolution-522e3a2d20809525451977b3476d09a0ea8cd2e7.tar.zst gsoc2013-evolution-522e3a2d20809525451977b3476d09a0ea8cd2e7.zip |
** Fix for bug #232065
svn path=/trunk/; revision=33248
Diffstat (limited to 'addressbook/gui')
-rw-r--r-- | addressbook/gui/widgets/e-addressbook-view.c | 44 |
1 files changed, 43 insertions, 1 deletions
diff --git a/addressbook/gui/widgets/e-addressbook-view.c b/addressbook/gui/widgets/e-addressbook-view.c index 471f5c3157..a94547bb0c 100644 --- a/addressbook/gui/widgets/e-addressbook-view.c +++ b/addressbook/gui/widgets/e-addressbook-view.c @@ -1965,8 +1965,12 @@ eab_view_delete_selection(EABView *view, gboolean is_delete) GList *list, *l; gboolean plural = FALSE, is_list = FALSE; EContact *contact; + ETable *etable; + EMinicardView *card_view; + ESelectionModel *selection_model; char *name = NULL; - + gint row, select; + list = get_selected_contacts (view); contact = list->data; @@ -1978,6 +1982,17 @@ eab_view_delete_selection(EABView *view, gboolean is_delete) if (e_contact_get (contact, E_CONTACT_IS_LIST)) is_list = TRUE; + if (view->view_type == EAB_VIEW_MINICARD) { + card_view = e_minicard_view_widget_get_view (E_MINICARD_VIEW_WIDGET(view->object)); + selection_model = get_selection_model (view); + row = e_selection_model_cursor_row (selection_model); + } + + else if (view->view_type == EAB_VIEW_TABLE) { + etable = e_table_scrolled_get_table(E_TABLE_SCROLLED(view->widget)); + row = e_table_get_cursor_row (E_TABLE (etable)); + } + /* confirm delete */ if (is_delete && !eab_editor_confirm_delete(GTK_WINDOW(gtk_widget_get_toplevel(view->widget)), @@ -2014,7 +2029,34 @@ eab_view_delete_selection(EABView *view, gboolean is_delete) NULL); } } + + /* Sets the cursor, at the row after the deleted row */ + if (view->view_type == EAB_VIEW_MINICARD && row!=0) { + select = e_sorter_model_to_sorted (selection_model->sorter, row); + + /* Sets the cursor, before the deleted row if its the last row */ + if (select == e_selection_model_row_count (selection_model) - 1) + select = select - 1; + else + select = select + 1; + row = e_sorter_sorted_to_model (selection_model->sorter, select); + e_selection_model_cursor_changed (selection_model, row, 0); + } + + /* Sets the cursor, at the row after the deleted row */ + else if (view->view_type == EAB_VIEW_TABLE && row!=0) { + select = e_table_model_to_view_row (E_TABLE (etable), row); + + /* Sets the cursor, before the deleted row if its the last row */ + if (select == e_table_model_row_count (E_TABLE(etable)->model) - 1) + select = select - 1; + else + select = select + 1; + + row = e_table_view_to_model_row (E_TABLE (etable), select); + e_table_set_cursor_row (E_TABLE (etable), row); + } e_free_object_list(list); } |