diff options
author | nobody <nobody@localhost> | 2002-12-06 07:26:48 +0800 |
---|---|---|
committer | nobody <nobody@localhost> | 2002-12-06 07:26:48 +0800 |
commit | 1e1eb980fb66dffe13a414be2f9813cbbb07011b (patch) | |
tree | 718512fa0b525456d8169e34b4361c98c537ec9f /composer/evolution-composer.c | |
parent | cf5e09fda7bba7532d7be4b9949f7737a4a418cd (diff) | |
download | gsoc2013-evolution-1e1eb980fb66dffe13a414be2f9813cbbb07011b.tar.gz gsoc2013-evolution-1e1eb980fb66dffe13a414be2f9813cbbb07011b.tar.zst gsoc2013-evolution-1e1eb980fb66dffe13a414be2f9813cbbb07011b.zip |
This commit was manufactured by cvs2svn to create tagEVOLUTION_1_2_1
'EVOLUTION_1_2_1'.
svn path=/tags/EVOLUTION_1_2_1/; revision=19034
Diffstat (limited to 'composer/evolution-composer.c')
-rw-r--r-- | composer/evolution-composer.c | 59 |
1 files changed, 25 insertions, 34 deletions
diff --git a/composer/evolution-composer.c b/composer/evolution-composer.c index be540b8d2e..d816a6d897 100644 --- a/composer/evolution-composer.c +++ b/composer/evolution-composer.c @@ -33,6 +33,7 @@ #include <camel/camel.h> #include "evolution-composer.h" #include "mail/mail-config.h" +#include "mail/mail-session.h" #include "e-util/e-html-utils.h" #define PARENT_TYPE BONOBO_OBJECT_TYPE @@ -172,7 +173,7 @@ impl_Composer_attach_MIME (PortableServer_Servant servant, attachment = camel_mime_part_new (); status = camel_data_wrapper_construct_from_stream ( CAMEL_DATA_WRAPPER (attachment), mem_stream); - camel_object_unref (mem_stream); + camel_object_unref (CAMEL_OBJECT (mem_stream)); if (status == -1) { CORBA_exception_set (ev, CORBA_USER_EXCEPTION, @@ -213,7 +214,7 @@ impl_Composer_attach_data (PortableServer_Servant servant, "inline" : "attachment"); e_msg_composer_attach (composer->composer, attachment); - camel_object_unref (attachment); + camel_object_unref (CAMEL_OBJECT (attachment)); } static void @@ -267,49 +268,38 @@ destroy (GtkObject *object) { EvolutionComposer *composer = EVOLUTION_COMPOSER (object); - if (composer->composer) { - g_object_unref((composer->composer)); - composer->composer = NULL; - } + if (composer->composer) + gtk_object_unref (GTK_OBJECT (composer->composer)); GTK_OBJECT_CLASS (parent_class)->destroy (object); } static void -evolution_composer_class_init (EvolutionComposerClass *klass) +class_init (EvolutionComposerClass *klass) { GtkObjectClass *object_class; - POA_GNOME_Evolution_Composer__epv *epv; object_class = GTK_OBJECT_CLASS (klass); object_class->destroy = destroy; - parent_class = g_type_class_ref(bonobo_object_get_type ()); + parent_class = gtk_type_class (bonobo_object_get_type ()); - epv = &klass->epv; - - epv->setHeaders = impl_Composer_set_headers; - epv->setMultipartType = impl_Composer_set_multipart_type; - epv->setBody = impl_Composer_set_body; - epv->attachMIME = impl_Composer_attach_MIME; - epv->attachData = impl_Composer_attach_data; - epv->show = impl_Composer_show; - epv->send = impl_Composer_send; + Composer_vepv.Bonobo_Unknown_epv = bonobo_object_get_epv (); + Composer_vepv.GNOME_Evolution_Composer_epv = evolution_composer_get_epv (); } static void -evolution_composer_init (EvolutionComposer *composer) +init (EvolutionComposer *composer) { const MailConfigAccount *account; - BonoboObject *item_handler; account = mail_config_get_default_account (); composer->composer = e_msg_composer_new (); - g_signal_connect (composer->composer, "send", - G_CALLBACK (send_cb), NULL); - g_signal_connect (composer->composer, "save-draft", - G_CALLBACK (save_draft_cb), NULL); + gtk_signal_connect (GTK_OBJECT (composer->composer), "send", + GTK_SIGNAL_FUNC (send_cb), NULL); + gtk_signal_connect (GTK_OBJECT (composer->composer), "save-draft", + GTK_SIGNAL_FUNC (save_draft_cb), NULL); } #if 0 @@ -356,7 +346,7 @@ evolution_composer_construct (EvolutionComposer *composer, g_return_if_fail (EVOLUTION_IS_COMPOSER (composer)); g_return_if_fail (corba_object != CORBA_OBJECT_NIL); - /*bonobo_object_construct (BONOBO_OBJECT (composer), corba_object);*/ + bonobo_object_construct (BONOBO_OBJECT (composer), corba_object); item_handler = BONOBO_OBJECT ( bonobo_item_handler_new (NULL, get_object, composer)); @@ -367,11 +357,10 @@ EvolutionComposer * evolution_composer_new (void) { EvolutionComposer *new; -#if 0 POA_GNOME_Evolution_Composer *servant; CORBA_Environment ev; GNOME_Evolution_Composer corba_object; - + servant = (POA_GNOME_Evolution_Composer *) g_new0 (BonoboObjectServant, 1); servant->vepv = &Composer_vepv; @@ -387,28 +376,30 @@ evolution_composer_new (void) new = gtk_type_new (evolution_composer_get_type ()); corba_object = bonobo_object_activate_servant (BONOBO_OBJECT (new), servant); -#endif - new = g_object_new(EVOLUTION_TYPE_COMPOSER, NULL); - evolution_composer_construct (new, NULL); + evolution_composer_construct (new, corba_object); return new; } -BONOBO_TYPE_FUNC_FULL(EvolutionComposer, GNOME_Evolution_Composer, BONOBO_TYPE_OBJECT, evolution_composer) +E_MAKE_TYPE (evolution_composer, "EvolutionComposer", EvolutionComposer, class_init, init, PARENT_TYPE) #define GNOME_EVOLUTION_MAIL_COMPOSER_FACTORY_ID "OAFIID:GNOME_Evolution_Mail_ComposerFactory" static BonoboObject * -factory_fn (BonoboGenericFactory *factory, const char *id, void *closure) +factory_fn (BonoboGenericFactory *factory, void *closure) { if (!mail_config_is_configured ()) { - e_notice (NULL, GTK_MESSAGE_ERROR, + e_notice (NULL, GNOME_MESSAGE_BOX_ERROR, _("Could not create composer window, because you " "have not yet\nconfigured any identities in the " "mail component.")); return NULL; } + if (! (session && mail_session_get_interactive ())) { + /* Don't return a composer if mailer isn't ready. */ + return NULL; + } return BONOBO_OBJECT (evolution_composer_new ()); } @@ -418,7 +409,7 @@ evolution_composer_factory_init (void (*send) (EMsgComposer *, gpointer), { if (bonobo_generic_factory_new (GNOME_EVOLUTION_MAIL_COMPOSER_FACTORY_ID, factory_fn, NULL) == NULL) { - e_notice (NULL, GTK_MESSAGE_ERROR, + e_notice (NULL, GNOME_MESSAGE_BOX_ERROR, _("Cannot initialize the Evolution composer.")); exit (1); } |