From f9b9c12b3bb8671cdebfa1d6de3a1f3d50bae024 Mon Sep 17 00:00:00 2001 From: Ettore Perazzoli Date: Thu, 4 Apr 2002 13:35:26 +0000 Subject: Change type of parent_class to BonoboXObjectClass. * evolution-shell-component.c: Change type of parent_class to BonoboXObjectClass. * e-shell.c (pop_up_activation_error_dialog): New helper function to pop up a dialog if one of the components couldn't be activated, getting the description for the error from e_get_activation_failure_msg(). (setup_components): Use this function in case of activation error. (set_owner_on_components): Likewise, when the component gets restarted. Also get a @splash arg so we can set the parent for this dialog correctly. * e-component-registry.c (register_component): New arg @ev. (e_component_registry_register_component): Likewise. (e_component_registry_restart_component): Likewise. Also, remove some bogus code that was #if'ed out. * evolution-shell-component-client.c (evolution_shell_component_client_new): New arg @ev. * evolution-shell-component-utils.c (e_get_activation_failure_msg): New. svn path=/trunk/; revision=16342 --- shell/evolution-shell-component-utils.c | 26 +++++++++++++++++++++++++- 1 file changed, 25 insertions(+), 1 deletion(-) (limited to 'shell/evolution-shell-component-utils.c') diff --git a/shell/evolution-shell-component-utils.c b/shell/evolution-shell-component-utils.c index f7e3ebdf54..b3e806d296 100644 --- a/shell/evolution-shell-component-utils.c +++ b/shell/evolution-shell-component-utils.c @@ -94,7 +94,7 @@ free_pixmaps (void) g_slist_free (inited_arrays); } - + /** * e_activation_failure_dialog: * @parent: parent window of the dialog, or %NULL @@ -140,3 +140,27 @@ e_activation_failure_dialog (GtkWindow *parent, const char *msg, e_notice (parent, GNOME_MESSAGE_BOX_ERROR, errmsg); g_free (errmsg); } + + +/** + * e_get_activation_failure_msg: + * @ev: An exception returned by an oaf_activate call. + * + * Get a descriptive error message from @ev. + * + * Return value: A newly allocated string with the printable error message. + **/ +char * +e_get_activation_failure_msg (CORBA_Environment *ev) +{ + g_return_val_if_fail (ev != NULL, NULL); + + if (strcmp (CORBA_exception_id (ev), ex_OAF_GeneralError) != 0) { + return bonobo_exception_get_text (ev); + } else { + const OAF_GeneralError *oaf_general_error; + + oaf_general_error = CORBA_exception_value (ev); + return g_strdup (oaf_general_error->description); + } +} -- cgit v1.2.3