diff options
author | Dan Winship <danw@src.gnome.org> | 2001-10-14 01:35:40 +0800 |
---|---|---|
committer | Dan Winship <danw@src.gnome.org> | 2001-10-14 01:35:40 +0800 |
commit | da2d6ee08c364cbc4b99a7c2eb39678c350188f1 (patch) | |
tree | 8611345b1adb12fba3dbc25f2e31faf9ecdd4cab /composer/e-msg-composer.c | |
parent | c72b6cb1e405d8fe3363f40520aa4e3f2e69a9d2 (diff) | |
download | gsoc2013-evolution-da2d6ee08c364cbc4b99a7c2eb39678c350188f1.tar.gz gsoc2013-evolution-da2d6ee08c364cbc4b99a7c2eb39678c350188f1.tar.zst gsoc2013-evolution-da2d6ee08c364cbc4b99a7c2eb39678c350188f1.zip |
Don't pop up an "unable to retrieve message" if the composer never
* 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.
svn path=/trunk/; revision=13661
Diffstat (limited to 'composer/e-msg-composer.c')
-rw-r--r-- | composer/e-msg-composer.c | 64 |
1 files changed, 32 insertions, 32 deletions
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; } /** |