diff options
author | Larry Ewing <lewing@ximian.com> | 2001-11-15 06:41:26 +0800 |
---|---|---|
committer | Larry Ewing <lewing@src.gnome.org> | 2001-11-15 06:41:26 +0800 |
commit | 7838233834765fa21f3597eb6d0e44558141e6fd (patch) | |
tree | 07d0baade0b4af2cc06e707b72ca2388d9d33e8f | |
parent | f6bbfa3d44ca772031a6c6161cd7e3256955fdc2 (diff) | |
download | gsoc2013-evolution-7838233834765fa21f3597eb6d0e44558141e6fd.tar.gz gsoc2013-evolution-7838233834765fa21f3597eb6d0e44558141e6fd.tar.zst gsoc2013-evolution-7838233834765fa21f3597eb6d0e44558141e6fd.zip |
popup failure dialog if we cannot get a valid editor_engine.
2001-11-14 Larry Ewing <lewing@ximian.com>
* e-msg-composer.c (create_composer): popup failure dialog if we
cannot get a valid editor_engine.
(prepare_engine): make the checks robust and make sure that we
unset the engine if any part fails.
svn path=/trunk/; revision=14715
-rw-r--r-- | composer/ChangeLog | 7 | ||||
-rw-r--r-- | composer/e-msg-composer.c | 33 |
2 files changed, 36 insertions, 4 deletions
diff --git a/composer/ChangeLog b/composer/ChangeLog index 97ce5674bb..dfd3eff5e6 100644 --- a/composer/ChangeLog +++ b/composer/ChangeLog @@ -1,3 +1,10 @@ +2001-11-14 Larry Ewing <lewing@ximian.com> + + * e-msg-composer.c (create_composer): popup failure dialog if we + cannot get a valid editor_engine. + (prepare_engine): make the checks robust and make sure that we + unset the engine if any part fails. + 2001-11-02 Radek Doulik <rodo@ximian.com> * e-msg-composer.c (add_inlined_images): use hash table to diff --git a/composer/e-msg-composer.c b/composer/e-msg-composer.c index aeca4b58cb..7ac6c3b770 100644 --- a/composer/e-msg-composer.c +++ b/composer/e-msg-composer.c @@ -734,20 +734,35 @@ prepare_engine (EMsgComposer *composer) CORBA_exception_init (&ev); composer->editor_engine = (GNOME_GtkHTML_Editor_Engine) bonobo_object_client_query_interface (bonobo_widget_get_server (BONOBO_WIDGET (composer->editor)), "IDL:GNOME/GtkHTML/Editor/Engine:1.0", &ev); - if (composer->editor_engine != CORBA_OBJECT_NIL) { + if ((composer->editor_engine != CORBA_OBJECT_NIL) && (ev._major == CORBA_NO_EXCEPTION)) { /* printf ("trying set listener\n"); */ composer->editor_listener = BONOBO_OBJECT (listener_new (composer)); - if (composer->editor_listener != CORBA_OBJECT_NIL) + if (composer->editor_listener != NULL) GNOME_GtkHTML_Editor_Engine__set_listener (composer->editor_engine, (GNOME_GtkHTML_Editor_Listener) bonobo_object_dup_ref (bonobo_object_corba_objref (composer->editor_listener), &ev), &ev); - else + + if ((ev._major != CORBA_NO_EXCEPTION) || (composer->editor_listener == NULL)) { + CORBA_Environment err_ev; + + CORBA_exception_init (&err_ev); + + Bonobo_Unknown_unref (composer->editor_engine, &err_ev); + CORBA_Object_release (composer->editor_engine, &err_ev); + + CORBA_exception_free (&err_ev); + + composer->editor_engine = CORBA_OBJECT_NIL; g_warning ("Can't establish Editor Listener\n"); - } else + } + } else { + composer->editor_engine = CORBA_OBJECT_NIL; g_warning ("Can't get Editor Engine\n"); + } + CORBA_exception_free (&ev); } @@ -2426,6 +2441,16 @@ create_composer (void) e_msg_composer_show_attachments (composer, FALSE); prepare_engine (composer); + if (composer->editor_engine == CORBA_OBJECT_NIL) { + 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:GNOME/GtkHTML/Editor/Engine:1.0"); + gtk_object_destroy (GTK_OBJECT (composer)); + return NULL; + } + gtk_signal_connect (GTK_OBJECT (composer), "map", map_default_cb, NULL); if (am == NULL) { |