From a6d1ec4664e1401e0e79427882cdcb9e851bd183 Mon Sep 17 00:00:00 2001 From: Bertrand Guiheneuf Date: Sat, 4 Mar 2000 17:55:36 +0000 Subject: Message browser can now display attachment inline when Bonobo compenent exist for the mime type. $(prefix)/share/mime-info/bonobo.keys must be modified for this to work, though. For example, to display application/svg attachments, the following lines must be added : application/svg bonobo-goad-id=embeddable:gill svn path=/trunk/; revision=2041 --- tests/ui-tests/message-browser.c | 23 +++++++++++++++++------ 1 file changed, 17 insertions(+), 6 deletions(-) (limited to 'tests/ui-tests') diff --git a/tests/ui-tests/message-browser.c b/tests/ui-tests/message-browser.c index 57b8b17448..dbf706875a 100644 --- a/tests/ui-tests/message-browser.c +++ b/tests/ui-tests/message-browser.c @@ -366,22 +366,26 @@ on_object_requested (GtkHTML *html, GtkHTMLEmbedded *eb, void *data) printf ("object requested : %s\n", class_id); printf ("UID = %s\n", uid); - bonobo_embedable = bonobo_widget_new_subdoc (class_id, NULL); - gtk_widget_show (bonobo_embedable); - gtk_container_add (GTK_CONTAINER(eb), bonobo_embedable); - - if (sscanf (uid, "camel://%p", &stream) == 1) { + bonobo_embedable = bonobo_widget_new_subdoc (class_id, NULL); + + server = bonobo_widget_get_server (BONOBO_WIDGET (bonobo_embedable)); - + + if (!server) { + printf ("Couldn't get the server for the bonobo embedable\n"); + return; + } + /* if the component supports persistant streams, * then we are going to create a mem stream */ if (bonobo_object_client_has_interface (server, "IDL:Bonobo/PersistStream:1.0", NULL)) { + printf ("the bonobo object supports PersistStream. Good\n"); tmp_gstring = g_string_new (""); do { @@ -400,6 +404,8 @@ on_object_requested (GtkHTML *html, GtkHTMLEmbedded *eb, void *data) } while (!camel_stream_eos (stream)); + printf ("After reading the stream, the temporary buffer has %d elements\n", tmp_gstring->len); + if (tmp_gstring->len) { mem_stream = bonobo_stream_mem_create (tmp_gstring->str,tmp_gstring->len , TRUE); @@ -443,7 +449,12 @@ on_object_requested (GtkHTML *html, GtkHTMLEmbedded *eb, void *data) CORBA_Object_release (persist, &ev); CORBA_exception_free (&ev); + + gtk_widget_show (bonobo_embedable); + + gtk_container_add (GTK_CONTAINER(eb), bonobo_embedable); + } } } -- cgit v1.2.3