diff options
-rw-r--r-- | composer/ChangeLog | 15 | ||||
-rw-r--r-- | composer/e-msg-composer-hdrs.c | 4 | ||||
-rw-r--r-- | composer/e-msg-composer-hdrs.h | 2 | ||||
-rw-r--r-- | composer/e-msg-composer.c | 64 | ||||
-rw-r--r-- | composer/e-msg-composer.h | 1 |
5 files changed, 50 insertions, 36 deletions
diff --git a/composer/ChangeLog b/composer/ChangeLog index 44dca3c49e..d00f1cef9e 100644 --- a/composer/ChangeLog +++ b/composer/ChangeLog @@ -1,3 +1,18 @@ +2001-10-13 Dan Winship <danw@ximian.com> + + * e-msg-composer.c (autosave_manager_unregister): Don't pop up an + "unable to retrieve message" if the composer never finished + initializing. + (init): Don't call autosave_manager_register here: wait until the + end of create_composer. + (create_composer): Remove the distinction between this and + e_msg_composer_construct since there's no need for the latter. Use + e_activation_failure_dialog if either the selectnames component or + the gtkhtml editor fails. + + * e-msg-composer-hdrs.c (setup_corba): Don't g_warn if the oaf + activation fails. create_composer() will tell the user. + 2001-10-11 Jeffrey Stedfast <fejj@ximian.com> * listener.c (impl_event): Deleted declaration of len. diff --git a/composer/e-msg-composer-hdrs.c b/composer/e-msg-composer-hdrs.c index ec08a94f7a..c64aab4cb9 100644 --- a/composer/e-msg-composer-hdrs.c +++ b/composer/e-msg-composer-hdrs.c @@ -49,7 +49,6 @@ #include "addressbook/backend/ebook/e-book-util.h" -#define SELECT_NAMES_OAFID "OAFIID:GNOME_Evolution_Addressbook_SelectNames" /* Indexes in the GtkTable assigned to various items */ @@ -103,12 +102,11 @@ setup_corba (EMsgComposerHdrs *hdrs) CORBA_exception_init (&ev); - priv->corba_select_names = oaf_activate_from_id (SELECT_NAMES_OAFID, 0, NULL, &ev); + priv->corba_select_names = oaf_activate_from_id (SELECT_NAMES_OAFIID, 0, NULL, &ev); /* OAF seems to be broken -- it can return a CORBA_OBJECT_NIL without raising an exception in `ev'. */ if (ev._major != CORBA_NO_EXCEPTION || priv->corba_select_names == CORBA_OBJECT_NIL) { - g_warning ("Cannot activate -- %s", SELECT_NAMES_OAFID); CORBA_exception_free (&ev); return FALSE; } diff --git a/composer/e-msg-composer-hdrs.h b/composer/e-msg-composer-hdrs.h index 15ad478497..6ffc494786 100644 --- a/composer/e-msg-composer-hdrs.h +++ b/composer/e-msg-composer-hdrs.h @@ -41,6 +41,8 @@ extern "C" { #define E_IS_MSG_COMPOSER_HDRS_CLASS(klass) (GTK_CHECK_CLASS_TYPE ((obj), E_TYPE_MSG_COMPOSER_HDRS)) +#define SELECT_NAMES_OAFIID "OAFIID:GNOME_Evolution_Addressbook_SelectNames" + typedef struct _EMsgComposerHdrs EMsgComposerHdrs; typedef struct _EMsgComposerHdrsClass EMsgComposerHdrsClass; typedef struct _EMsgComposerHdrsPrivate EMsgComposerHdrsPrivate; diff --git a/composer/e-msg-composer.c b/composer/e-msg-composer.c index 1b483396fa..2615b61965 100644 --- a/composer/e-msg-composer.c +++ b/composer/e-msg-composer.c @@ -1271,6 +1271,9 @@ autosave_manager_register (AutosaveManager *am, EMsgComposer *composer) static void autosave_manager_unregister (AutosaveManager *am, EMsgComposer *composer) { + if (!composer->autosave_file) + return; + g_hash_table_remove (am->table, g_basename (composer->autosave_file)); /* only remove the file if we can successfully save it */ @@ -2155,11 +2158,6 @@ init (EMsgComposer *composer) composer->charset = NULL; composer->autosave_file = NULL; composer->autosave_fd = -1; - - if (am == NULL) { - am = autosave_manager_new (); - } - autosave_manager_register (am, composer); } @@ -2294,20 +2292,17 @@ map_default_cb (EMsgComposer *composer, gpointer user_data) CORBA_exception_free (&ev); } -/** - * e_msg_composer_construct: - * @composer: A message composer widget - * - * Construct @composer. - **/ -void -e_msg_composer_construct (EMsgComposer *composer) +static EMsgComposer * +create_composer (void) { + EMsgComposer *composer; GtkWidget *vbox; BonoboObject *editor_server; gint vis; - g_return_if_fail (gtk_main_level () > 0); + g_return_val_if_fail (gtk_main_level () > 0, NULL); + + composer = gtk_type_new (E_TYPE_MSG_COMPOSER); gtk_window_set_default_size (GTK_WINDOW (composer), DEFAULT_WIDTH, DEFAULT_HEIGHT); @@ -2329,6 +2324,15 @@ e_msg_composer_construct (EMsgComposer *composer) vis = e_msg_composer_get_visible_flags (composer); composer->hdrs = e_msg_composer_hdrs_new (vis); + if (!composer->hdrs) { + e_activation_failure_dialog (GTK_WINDOW (composer), + _("Could not create composer window:\n" + "Unable to activate address selector control."), + SELECT_NAMES_OAFIID, + "IDL:Bonobo/Control:1.0"); + gtk_object_destroy (GTK_OBJECT (composer)); + return NULL; + } gtk_box_pack_start (GTK_BOX (vbox), composer->hdrs, FALSE, FALSE, 0); gtk_signal_connect (GTK_OBJECT (composer->hdrs), "subject_changed", @@ -2343,9 +2347,15 @@ e_msg_composer_construct (EMsgComposer *composer) composer->editor = bonobo_widget_new_control ( GNOME_GTKHTML_EDITOR_CONTROL_ID, bonobo_ui_component_get_container (composer->uic)); - - if (!composer->editor) - return; + if (!composer->editor) { + e_activation_failure_dialog (GTK_WINDOW (composer), + _("Could not create composer window:\n" + "Unable to activate HTML editor component."), + GNOME_GTKHTML_EDITOR_CONTROL_ID, + "IDL:Bonobo/Control:1.0"); + gtk_object_destroy (GTK_OBJECT (composer)); + return NULL; + } /* let the editor know which mode we are in */ bonobo_widget_set_property (BONOBO_WIDGET (composer->editor), @@ -2393,23 +2403,13 @@ e_msg_composer_construct (EMsgComposer *composer) prepare_engine (composer); gtk_signal_connect (GTK_OBJECT (composer), "map", map_default_cb, NULL); -} -static EMsgComposer * -create_composer (void) -{ - EMsgComposer *new; - - new = gtk_type_new (E_TYPE_MSG_COMPOSER); - e_msg_composer_construct (new); - if (!new->editor) { - e_notice (GTK_WINDOW (new), GNOME_MESSAGE_BOX_ERROR, - _("Could not create composer window.")); - gtk_object_unref (GTK_OBJECT (new)); - return NULL; + if (am == NULL) { + am = autosave_manager_new (); } - - return new; + autosave_manager_register (am, composer); + + return composer; } /** diff --git a/composer/e-msg-composer.h b/composer/e-msg-composer.h index 01f7c2db9d..e926ce84a7 100644 --- a/composer/e-msg-composer.h +++ b/composer/e-msg-composer.h @@ -104,7 +104,6 @@ struct _EMsgComposerClass { GtkType e_msg_composer_get_type (void); -void e_msg_composer_construct (EMsgComposer *composer); EMsgComposer *e_msg_composer_new (void); EMsgComposer *e_msg_composer_new_with_message (CamelMimeMessage *msg); EMsgComposer *e_msg_composer_new_from_url (const char *url); |