diff options
-rw-r--r-- | mail/ChangeLog | 5 | ||||
-rw-r--r-- | mail/mail-display.c | 30 |
2 files changed, 34 insertions, 1 deletions
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 <jpavel@helixcode.com> + + * mail-display.c: added property bag support for Bonobo + controls, support which helps only the iTip control, currently. + 2000-11-01 Dan Winship <danw@helixcode.com> * 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; |