aboutsummaryrefslogtreecommitdiffstats
path: root/addressbook/gui/widgets
diff options
context:
space:
mode:
Diffstat (limited to 'addressbook/gui/widgets')
-rw-r--r--addressbook/gui/widgets/e-minicard-view.c28
-rw-r--r--addressbook/gui/widgets/e-minicard-view.h3
2 files changed, 31 insertions, 0 deletions
diff --git a/addressbook/gui/widgets/e-minicard-view.c b/addressbook/gui/widgets/e-minicard-view.c
index 0672983f05..4cd3606876 100644
--- a/addressbook/gui/widgets/e-minicard-view.c
+++ b/addressbook/gui/widgets/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/widgets/e-minicard-view.h b/addressbook/gui/widgets/e-minicard-view.h
index 520bf31a19..bb50aa99c1 100644
--- a/addressbook/gui/widgets/e-minicard-view.h
+++ b/addressbook/gui/widgets/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
}