diff options
Diffstat (limited to 'addressbook/gui/minicard')
-rw-r--r-- | addressbook/gui/minicard/e-minicard-view.c | 28 | ||||
-rw-r--r-- | addressbook/gui/minicard/e-minicard-view.h | 3 | ||||
-rw-r--r-- | addressbook/gui/minicard/e-reflow.c | 1 |
3 files changed, 32 insertions, 0 deletions
diff --git a/addressbook/gui/minicard/e-minicard-view.c b/addressbook/gui/minicard/e-minicard-view.c index 0672983f05..4cd3606876 100644 --- a/addressbook/gui/minicard/e-minicard-view.c +++ b/addressbook/gui/minicard/e-minicard-view.c @@ -168,6 +168,8 @@ book_view_loaded (EBook *book, EBookStatus status, EBookView *book_view, gpointe view); g_list_foreach(E_REFLOW(view)->items, (GFunc) gtk_object_destroy, NULL); g_list_free(E_REFLOW(view)->items); + E_REFLOW(view)->items = NULL; + e_canvas_item_request_reflow(GNOME_CANVAS_ITEM(view)); } static gboolean @@ -251,3 +253,29 @@ e_minicard_view_destroy (GtkObject *object) if (view->book_view) gtk_object_unref(GTK_OBJECT(view->book_view)); } + +void +e_minicard_remove_selection(EMinicardView *view, + EBookCallback cb, + gpointer closure) +{ + if (view->book) { + EReflow *reflow = E_REFLOW(view); + GList *list; + for (list = reflow->items; list; list = g_list_next(list)) { + GnomeCanvasItem *item = list->data; + gboolean has_focus; + gtk_object_get(item, + "has_focus", &has_focus, + NULL); + if (has_focus) { + ECard *card; + gtk_object_get(GTK_OBJECT(item), + "card", &card, + NULL); + e_book_remove_card(view->book, card, cb, closure); + return; + } + } + } +} diff --git a/addressbook/gui/minicard/e-minicard-view.h b/addressbook/gui/minicard/e-minicard-view.h index 520bf31a19..bb50aa99c1 100644 --- a/addressbook/gui/minicard/e-minicard-view.h +++ b/addressbook/gui/minicard/e-minicard-view.h @@ -79,6 +79,9 @@ struct _EMinicardViewClass }; GtkType e_minicard_view_get_type (void); +void e_minicard_view_remove_selection (EMinicardView *view, + EBookCallback cb, + gpointer closure); #ifdef __cplusplus } diff --git a/addressbook/gui/minicard/e-reflow.c b/addressbook/gui/minicard/e-reflow.c index 0ff8c0f4ea..004183727a 100644 --- a/addressbook/gui/minicard/e-reflow.c +++ b/addressbook/gui/minicard/e-reflow.c @@ -189,6 +189,7 @@ e_reflow_destroy (GtkObject *object) EReflow *reflow = E_REFLOW(object); g_list_free(reflow->items); + reflow->items = NULL; } static void |