diff options
-rw-r--r-- | mail/ChangeLog | 6 | ||||
-rw-r--r-- | mail/folder-browser-factory.c | 19 | ||||
-rw-r--r-- | mail/mail-display.c | 61 |
3 files changed, 46 insertions, 40 deletions
diff --git a/mail/ChangeLog b/mail/ChangeLog index e4a54da483..4eabbdf876 100644 --- a/mail/ChangeLog +++ b/mail/ChangeLog @@ -1,3 +1,9 @@ +2000-03-21 Matt Loper <matt@helixcode.com> + + * mail-display.c: Minor cleanup & commenting. + + * folder-browser-factory.c: Minor cleanup & warning elimination. + 2000-03-21 bertrand <bertrand@helixcode.com> * message-list.c (ml_value_at): display message size diff --git a/mail/folder-browser-factory.c b/mail/folder-browser-factory.c index f2397ef15b..947f0b3abe 100644 --- a/mail/folder-browser-factory.c +++ b/mail/folder-browser-factory.c @@ -20,13 +20,8 @@ #include "shell/Evolution.h" #include "shell/evolution-service-repository.h" #include "composer/e-msg-composer.h" +#include <camel/camel-stream-fs.h> - -static const gchar *warning_dialog_buttons[] = { - "Cancel", - "OK", - NULL -}; static void folder_browser_set_shell (EvolutionServiceRepository *sr, @@ -81,7 +76,7 @@ development_warning () "I'll try it later", NULL); - label = gtk_label_new ("This is a developement version of Evolution.\n " + label = gtk_label_new ("This is a development version of Evolution.\n " "Using the mail component on your mail files\n " "is extremely hazardous.\n" "Please backup all your mails before trying\n " @@ -97,7 +92,6 @@ development_warning () gtk_object_destroy (GTK_OBJECT (warning_dialog)); return result; - } static void @@ -125,10 +119,9 @@ msg_composer_send_cb (EMsgComposer *composer, } -static void -msg_composer_cb (GtkObject *obj, gpointer user_data) +static void +msg_composer_cb (BonoboUIHandler *uih, void *user_data, const char *path) { - CamelMimeMessage *msg; GtkWidget *composer; composer = e_msg_composer_new (); @@ -163,7 +156,6 @@ control_activate_cb (BonoboControl *control, gpointer user_data) { control_add_menu (control); - } @@ -217,10 +209,7 @@ folder_browser_factory (BonoboGenericFactory *factory, void *closure) * correct infrastructure in the shell now. */ folder_browser_control_add_service_repository_interface (control, folder_browser); - - return BONOBO_OBJECT (control); - } void diff --git a/mail/mail-display.c b/mail/mail-display.c index 1f3c94e404..e22735c2e7 100644 --- a/mail/mail-display.c +++ b/mail/mail-display.c @@ -24,8 +24,6 @@ static GtkObjectClass *mail_display_parent_class; - - @@ -68,6 +66,10 @@ Nothing to display in this view "; +/*----------------------------------------------------------------------* + * Helper utility functions + *----------------------------------------------------------------------*/ + /* stuff to display Bonobo Components inside the html message * body view */ @@ -78,26 +80,17 @@ hydrate_persist_stream_from_gstring (Bonobo_PersistStream persist_stream, CORBA_Environment ev; BonoboStream* mem_stream = bonobo_stream_mem_create (gstr->str, gstr->len, TRUE); - /* - * If the component doesn't support - * PersistStream, then we destroy the - * stream we created and bail. - */ - if (persist_stream == CORBA_OBJECT_NIL) { - gnome_warning_dialog (_("The component now claims that it " - "doesn't support PersistStream!")); - bonobo_object_unref (BONOBO_OBJECT (mem_stream)); - return FALSE; - } + CORBA_Object mem_stream_corba = + bonobo_object_corba_objref (BONOBO_OBJECT (mem_stream)); + + g_assert (persist_stream != CORBA_OBJECT_NIL); CORBA_exception_init (&ev); /* * Load the file into the component using PersistStream. */ - Bonobo_PersistStream_load (persist_stream, - (Bonobo_Stream) bonobo_object_corba_objref (BONOBO_OBJECT (mem_stream)), - &ev); + Bonobo_PersistStream_load (persist_stream, mem_stream_corba, &ev); bonobo_object_unref (BONOBO_OBJECT (mem_stream)); @@ -139,6 +132,10 @@ camel_stream_to_gstring (CamelStream* stream) return tmp_gstring; } +/*----------------------------------------------------------------------* + * Callbacks + *----------------------------------------------------------------------*/ + static void embeddable_destroy_cb (GtkObject *obj, gpointer user_data) { @@ -156,14 +153,18 @@ embeddable_destroy_cb (GtkObject *obj, gpointer user_data) vf = bonobo_widget_get_view_frame (be); - bonobo_control_frame_control_deactivate (vf); + bonobo_control_frame_control_deactivate ( + BONOBO_CONTROL_FRAME (vf)); //w = bonobo_control_frame_get_widget (BONOBO_CONTROL_FRAME (vf)); //gtk_widget_destroy (w); CORBA_exception_init (&ev); - Bonobo_Unknown_unref (bonobo_object_corba_objref (server), &ev); - CORBA_Object_release (bonobo_object_corba_objref (server), &ev); + Bonobo_Unknown_unref ( + bonobo_object_corba_objref (BONOBO_OBJECT(server)), &ev); + CORBA_Object_release ( + bonobo_object_corba_objref (BONOBO_OBJECT(server)), &ev); + CORBA_exception_free (&ev); bonobo_object_destroy (BONOBO_OBJECT (vf)); //gtk_object_unref (obj); @@ -236,7 +237,8 @@ on_object_requested (GtkHTML *html, GtkHTMLEmbedded *eb, void *unused) gnome_warning_dialog (msg); gtk_object_unref (GTK_OBJECT (bonobo_embeddable)); - + + g_free (msg); return; } @@ -261,8 +263,16 @@ on_object_requested (GtkHTML *html, GtkHTMLEmbedded *eb, void *unused) } - - +/** + * mail_display_set_message: + * @mail_display: the mail display object + * @mime_message: the input camel medium + * + * Makes the mail_display object show the contents of the medium + * param. This means feeding mail_display->body_stream and + * mail_display->headers_stream with html. + * + **/ void mail_display_set_message (MailDisplay *mail_display, CamelMedium *medium) @@ -274,7 +284,6 @@ mail_display_set_message (MailDisplay *mail_display, * but I don't know how the formatter reacts * to consecutive call to *_to_html - ber */ camel_formatter = camel_formatter_new (); - /* * for the moment, camel-formatter deals only with @@ -351,8 +360,9 @@ mail_display_set_message (MailDisplay *mail_display, } -/* generic class stuff */ - +/*----------------------------------------------------------------------* + * Standard Gtk+ Class functions + *----------------------------------------------------------------------*/ static void mail_display_init (GtkObject *object) @@ -463,3 +473,4 @@ mail_display_new (FolderBrowser *parent_folder_browser) E_MAKE_TYPE (mail_display, "MailDisplay", MailDisplay, mail_display_class_init, mail_display_init, PARENT_TYPE); + |