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/e-component-registry.c | 53 ++++++++++++++++++-------------------------- 1 file changed, 22 insertions(+), 31 deletions(-) (limited to 'shell/e-component-registry.c') diff --git a/shell/e-component-registry.c b/shell/e-component-registry.c index 77e2df95eb..e1ef250eaa 100644 --- a/shell/e-component-registry.c +++ b/shell/e-component-registry.c @@ -200,7 +200,8 @@ register_type (EComponentRegistry *component_registry, static gboolean register_component (EComponentRegistry *component_registry, const char *id, - gboolean override_duplicate) + gboolean override_duplicate, + CORBA_Environment *ev) { EComponentRegistryPrivate *priv; GNOME_Evolution_ShellComponent component_corba_interface; @@ -209,7 +210,7 @@ register_component (EComponentRegistry *component_registry, GNOME_Evolution_URISchemaList *supported_schemas; Component *component; EvolutionShellComponentClient *client; - CORBA_Environment ev; + CORBA_Environment my_ev; CORBA_unsigned_long i; priv = component_registry->priv; @@ -219,28 +220,28 @@ register_component (EComponentRegistry *component_registry, return FALSE; } - client = evolution_shell_component_client_new (id); + client = evolution_shell_component_client_new (id, ev); if (client == NULL) return FALSE; - CORBA_exception_init (&ev); - /* FIXME we could use the EvolutionShellComponentClient API here instead, but for now we don't care. */ component_corba_interface = bonobo_object_corba_objref (BONOBO_OBJECT (client)); shell_corba_interface = bonobo_object_corba_objref (BONOBO_OBJECT (priv->shell)); + CORBA_exception_init (&my_ev); + /* Register the supported folder types. */ - supported_types = GNOME_Evolution_ShellComponent__get_supportedTypes (component_corba_interface, &ev); - if (ev._major != CORBA_NO_EXCEPTION || supported_types->_length == 0) { + supported_types = GNOME_Evolution_ShellComponent__get_supportedTypes (component_corba_interface, &my_ev); + if (my_ev._major != CORBA_NO_EXCEPTION || supported_types->_length == 0) { bonobo_object_unref (BONOBO_OBJECT (client)); - CORBA_exception_free (&ev); + CORBA_exception_free (&my_ev); return FALSE; } - CORBA_exception_free (&ev); + CORBA_exception_free (&my_ev); component = component_new (id, client); g_hash_table_insert (priv->component_id_to_component, component->id, component); @@ -270,8 +271,8 @@ register_component (EComponentRegistry *component_registry, /* Register the supported external URI schemas. */ - supported_schemas = GNOME_Evolution_ShellComponent__get_externalUriSchemas (component_corba_interface, &ev); - if (ev._major == CORBA_NO_EXCEPTION) { + supported_schemas = GNOME_Evolution_ShellComponent__get_externalUriSchemas (component_corba_interface, &my_ev); + if (my_ev._major == CORBA_NO_EXCEPTION) { EUriSchemaRegistry *uri_schema_registry; uri_schema_registry = e_shell_get_uri_schema_registry (priv->shell); @@ -379,13 +380,14 @@ e_component_registry_new (EShell *shell) gboolean e_component_registry_register_component (EComponentRegistry *component_registry, - const char *id) + const char *id, + CORBA_Environment *ev) { g_return_val_if_fail (component_registry != NULL, FALSE); g_return_val_if_fail (E_IS_COMPONENT_REGISTRY (component_registry), FALSE); g_return_val_if_fail (id != NULL, FALSE); - return register_component (component_registry, id, FALSE); + return register_component (component_registry, id, FALSE, ev); } @@ -462,11 +464,12 @@ e_component_registry_get_component_by_id (EComponentRegistry *component_registr EvolutionShellComponentClient * e_component_registry_restart_component (EComponentRegistry *component_registry, - const char *id) + const char *id, + CORBA_Environment *ev) { EComponentRegistryPrivate *priv; Component *component; - CORBA_Environment ev; + CORBA_Environment my_ev; CORBA_Object corba_objref; g_return_val_if_fail (component_registry != NULL, NULL); @@ -479,34 +482,22 @@ e_component_registry_restart_component (EComponentRegistry *component_registry, if (component == NULL) return NULL; - CORBA_exception_init (&ev); + CORBA_exception_init (&my_ev); g_hash_table_remove (priv->component_id_to_component, id); - corba_objref = CORBA_Object_duplicate (bonobo_object_corba_objref (BONOBO_OBJECT (component->client)), &ev); + corba_objref = CORBA_Object_duplicate (bonobo_object_corba_objref (BONOBO_OBJECT (component->client)), &my_ev); component_free (component); wait_for_corba_object_to_die (corba_objref, id); - CORBA_exception_free (&ev); + CORBA_exception_free (&my_ev); -#if 1 - if (! register_component (component_registry, id, TRUE)) + if (! register_component (component_registry, id, TRUE, ev)) return NULL; return e_component_registry_get_component_by_id (component_registry, id); -#else - client = evolution_shell_component_client_new (id); - if (client == NULL) - return NULL; - - component = component_new (id, client); - g_hash_table_insert (priv->component_id_to_component, component->id, component); - bonobo_object_unref (BONOBO_OBJECT (client)); -#endif - - return component->client; } -- cgit v1.2.3