From 8d21ab98d99ca43ee7873adba8172b699d8a007f Mon Sep 17 00:00:00 2001 From: Matthew Barnes Date: Thu, 18 Sep 2008 02:32:04 +0000 Subject: Progress update: - Get context menus working in the contact preview pane. - Kill EABPopup. - Yet more code refactoring. - Add a handy utility function: e_shell_window_show_popup_menu() Takes a widget path in the shell window's UI definition. svn path=/branches/kill-bonobo/; revision=36366 --- addressbook/gui/widgets/eab-vcard-control.c | 26 +++++++++++++++++--------- 1 file changed, 17 insertions(+), 9 deletions(-) (limited to 'addressbook/gui/widgets/eab-vcard-control.c') diff --git a/addressbook/gui/widgets/eab-vcard-control.c b/addressbook/gui/widgets/eab-vcard-control.c index 2379559e3d..431229498e 100644 --- a/addressbook/gui/widgets/eab-vcard-control.c +++ b/addressbook/gui/widgets/eab-vcard-control.c @@ -46,7 +46,7 @@ typedef struct { EABContactDisplay *display; GList *card_list; GtkWidget *label; - EABContactDisplayRenderMode render_mode; + EABContactDisplayMode mode; } EABVCardControl; #define VCARD_CONTROL_ID "OAFIID:GNOME_Evolution_Addressbook_VCard_Control:" BASE_VERSION @@ -134,8 +134,10 @@ pstream_load (BonoboPersistStream *ps, const Bonobo_Stream stream, g_free(vcard); vcard_control->card_list = list; if (list) { - eab_contact_display_render (vcard_control->display, E_CONTACT (list->data), - vcard_control->render_mode); + eab_contact_display_set_mode ( + vcard_control->display, vcard_control->mode); + eab_contact_display_set_contact ( + vcard_control->display, E_CONTACT (list->data)); } if (list && list->next) { char *message; @@ -218,23 +220,29 @@ static void toggle_full_vcard(GtkWidget *button, gpointer data) { EABVCardControl *vcard_control = data; + EContact *contact; char *label; if (!vcard_control->card_list) return; - if (vcard_control->render_mode == EAB_CONTACT_DISPLAY_RENDER_NORMAL) { - vcard_control->render_mode = EAB_CONTACT_DISPLAY_RENDER_COMPACT; + contact = E_CONTACT (vcard_control->card_list->data); + + if (vcard_control->mode == EAB_CONTACT_DISPLAY_RENDER_NORMAL) { + vcard_control->mode = EAB_CONTACT_DISPLAY_RENDER_COMPACT; label = _("Show Full vCard"); } else { - vcard_control->render_mode = EAB_CONTACT_DISPLAY_RENDER_NORMAL; + vcard_control->mode = EAB_CONTACT_DISPLAY_RENDER_NORMAL; label = _("Show Compact vCard"); } gtk_button_set_label (GTK_BUTTON (button), label); - eab_contact_display_render (vcard_control->display, E_CONTACT (vcard_control->card_list->data), - vcard_control->render_mode); + + eab_contact_display_set_mode ( + vcard_control->display, vcard_control->mode); + eab_contact_display_set_contact ( + vcard_control->display, contact); } static void @@ -265,7 +273,7 @@ eab_vcard_control_new (void) vcard_control->display = NULL; vcard_control->label = NULL; - vcard_control->render_mode = EAB_CONTACT_DISPLAY_RENDER_COMPACT; + vcard_control->mode = EAB_CONTACT_DISPLAY_RENDER_COMPACT; /* Create the control. */ -- cgit v1.2.3