From ce05b0db24215b2a29c89d502570ab1dcd63d24a Mon Sep 17 00:00:00 2001 From: Chris Toshok Date: Tue, 11 Apr 2000 00:36:44 +0000 Subject: new function. (delete_contact_cb): wire up button to call * addressbook/gui/component/addressbook.c (card_deleted_cb): new function. (delete_contact_cb): wire up button to call e_minicard_view_remove_selection. * addressbook/gui/minicard/e-minicard-view.c (e_minicard_view_remove_selection): fix warning, and stick "view" in the name. svn path=/trunk/; revision=2387 --- ChangeLog | 11 +++++++++++ addressbook/gui/component/addressbook.c | 16 +++++++++++++++- addressbook/gui/minicard/e-minicard-view.c | 8 ++++---- addressbook/gui/widgets/e-minicard-view.c | 8 ++++---- 4 files changed, 34 insertions(+), 9 deletions(-) diff --git a/ChangeLog b/ChangeLog index 5cc969f2cd..5fbde9e37e 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,14 @@ +2000-04-11 Chris Toshok + + * addressbook/gui/component/addressbook.c (card_deleted_cb): new + function. + (delete_contact_cb): wire up button to call + e_minicard_view_remove_selection. + + * addressbook/gui/minicard/e-minicard-view.c + (e_minicard_view_remove_selection): fix warning, and stick "view" + in the name. + 2000-04-10 Christopher James Lahey * addressbook/backend/ebook/e-book-view.c, diff --git a/addressbook/gui/component/addressbook.c b/addressbook/gui/component/addressbook.c index 71095d6aeb..d364a74240 100644 --- a/addressbook/gui/component/addressbook.c +++ b/addressbook/gui/component/addressbook.c @@ -145,6 +145,20 @@ find_contact_cb (BonoboUIHandler *uih, void *user_data, const char *path) } +static void +card_deleted_cb (EBook* book, EBookStatus status, gpointer user_data) +{ + g_print ("%s: %s(): a card was deleted\n", __FILE__, __FUNCTION__); +} + +static void +delete_contact_cb (BonoboUIHandler *uih, void *user_data, const char *path) +{ + EMinicardView *minicard_view = E_MINICARD_VIEW (user_data); + + e_minicard_view_remove_selection (minicard_view, card_deleted_cb, NULL); +} + static GnomeUIInfo gnome_toolbar [] = { GNOMEUIINFO_ITEM_STOCK (N_("New"), N_("Create a new contact"), new_contact_cb, GNOME_STOCK_PIXMAP_NEW), @@ -152,7 +166,7 @@ static GnomeUIInfo gnome_toolbar [] = { GNOMEUIINFO_ITEM_STOCK (N_("Find"), N_("Find a contact"), find_contact_cb, GNOME_STOCK_PIXMAP_SEARCH), GNOMEUIINFO_ITEM_STOCK (N_("Print"), N_("Print contacts"), do_nothing_cb, GNOME_STOCK_PIXMAP_PRINT), - GNOMEUIINFO_ITEM_STOCK (N_("Delete"), N_("Delete a contact"), do_nothing_cb, GNOME_STOCK_PIXMAP_TRASH), + GNOMEUIINFO_ITEM_STOCK (N_("Delete"), N_("Delete a contact"), delete_contact_cb, GNOME_STOCK_PIXMAP_TRASH), GNOMEUIINFO_END }; diff --git a/addressbook/gui/minicard/e-minicard-view.c b/addressbook/gui/minicard/e-minicard-view.c index 4cd3606876..097d38dbcd 100644 --- a/addressbook/gui/minicard/e-minicard-view.c +++ b/addressbook/gui/minicard/e-minicard-view.c @@ -255,9 +255,9 @@ e_minicard_view_destroy (GtkObject *object) } void -e_minicard_remove_selection(EMinicardView *view, - EBookCallback cb, - gpointer closure) +e_minicard_view_remove_selection(EMinicardView *view, + EBookCallback cb, + gpointer closure) { if (view->book) { EReflow *reflow = E_REFLOW(view); @@ -265,7 +265,7 @@ e_minicard_remove_selection(EMinicardView *view, for (list = reflow->items; list; list = g_list_next(list)) { GnomeCanvasItem *item = list->data; gboolean has_focus; - gtk_object_get(item, + gtk_object_get(GTK_OBJECT(item), "has_focus", &has_focus, NULL); if (has_focus) { diff --git a/addressbook/gui/widgets/e-minicard-view.c b/addressbook/gui/widgets/e-minicard-view.c index 4cd3606876..097d38dbcd 100644 --- a/addressbook/gui/widgets/e-minicard-view.c +++ b/addressbook/gui/widgets/e-minicard-view.c @@ -255,9 +255,9 @@ e_minicard_view_destroy (GtkObject *object) } void -e_minicard_remove_selection(EMinicardView *view, - EBookCallback cb, - gpointer closure) +e_minicard_view_remove_selection(EMinicardView *view, + EBookCallback cb, + gpointer closure) { if (view->book) { EReflow *reflow = E_REFLOW(view); @@ -265,7 +265,7 @@ e_minicard_remove_selection(EMinicardView *view, for (list = reflow->items; list; list = g_list_next(list)) { GnomeCanvasItem *item = list->data; gboolean has_focus; - gtk_object_get(item, + gtk_object_get(GTK_OBJECT(item), "has_focus", &has_focus, NULL); if (has_focus) { -- cgit v1.2.3