From 6babb16217f8755a81fcc1fbabb24d565b77a9f1 Mon Sep 17 00:00:00 2001 From: Jesse Pavel Date: Wed, 1 Nov 2000 19:50:30 +0000 Subject: added property bag support for Bonobo controls, support which helps only the iTip control, currently. svn path=/trunk/; revision=6318 --- mail/ChangeLog | 5 +++++ mail/mail-display.c | 30 +++++++++++++++++++++++++++++- 2 files changed, 34 insertions(+), 1 deletion(-) (limited to 'mail') diff --git a/mail/ChangeLog b/mail/ChangeLog index dbe644ca6e..1dfec8d9a8 100644 --- a/mail/ChangeLog +++ b/mail/ChangeLog @@ -1,3 +1,8 @@ +2000-11-01 Jesse Pavel + + * mail-display.c: added property bag support for Bonobo + controls, support which helps only the iTip control, currently. + 2000-11-01 Dan Winship * mail-display.c (pixbuf_gen_idle): Lots of fixes and diff --git a/mail/mail-display.c b/mail/mail-display.c index 001281dad9..1650deca1e 100644 --- a/mail/mail-display.c +++ b/mail/mail-display.c @@ -469,6 +469,9 @@ on_object_requested (GtkHTML *html, GtkHTMLEmbedded *eb, gpointer data) GByteArray *ba; CamelStream *cstream; BonoboStream *bstream; + BonoboControlFrame *control_frame; + Bonobo_PropertyBag prop_bag; + const char *from_address; char *cid; cid = eb->classid; @@ -534,8 +537,33 @@ on_object_requested (GtkHTML *html, GtkHTMLEmbedded *eb, gpointer data) */ bonobo_object_ref (BONOBO_OBJECT(bonobo_widget_get_client_site ( BONOBO_WIDGET (embedded)))); - } else + } else { embedded = bonobo_widget_new_control (component->iid, NULL); + if (!embedded) { + CORBA_free (component); + return FALSE; + } + + control_frame = bonobo_widget_get_control_frame (BONOBO_WIDGET (embedded)); + if (control_frame) { + prop_bag = bonobo_control_frame_get_control_property_bag ( control_frame, NULL ); + + if (prop_bag != CORBA_OBJECT_NIL) { + /* Now we can take care of business. Currently, the only control + that needs something passed to it through a property bag is + the iTip control, and it needs only the From email address, + but perhaps in the future we can generalize this section of code + to pass a bunch of useful things to all embedded controls. */ + + CORBA_exception_init (&ev); + + from_address = camel_mime_message_get_from (md->current_message); + bonobo_property_bag_client_set_value_string (prop_bag, "from_address", + from_address, &ev); + CORBA_exception_free (&ev); + } + } + } /* end else (we're going to use a control) */ CORBA_free (component); if (!embedded) return FALSE; -- cgit v1.2.3