aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--shell/ChangeLog11
-rw-r--r--shell/e-component-registry.c9
-rw-r--r--shell/e-shell.c32
-rw-r--r--shell/evolution-shell-client.c37
-rw-r--r--shell/evolution-shell-client.h22
5 files changed, 92 insertions, 19 deletions
diff --git a/shell/ChangeLog b/shell/ChangeLog
index fe823c91e6..be76238302 100644
--- a/shell/ChangeLog
+++ b/shell/ChangeLog
@@ -1,5 +1,16 @@
2000-09-08 Ettore Perazzoli <ettore@helixcode.com>
+ * e-shell.c (set_owner_on_components): New.
+ (e_shell_construct): Call it after setting up the local storage.
+
+ * e-component-registry.c (register_component): Don't set the owner
+ here.
+
+ * evolution-shell-client.c
+ (evolution_shell_client_get_local_storage): New.
+
+2000-09-08 Ettore Perazzoli <ettore@helixcode.com>
+
* evolution-shell-view.c (destroy): Chain to the parent's
destroy method.
diff --git a/shell/e-component-registry.c b/shell/e-component-registry.c
index 411fe93d42..589d6bca38 100644
--- a/shell/e-component-registry.c
+++ b/shell/e-component-registry.c
@@ -138,7 +138,6 @@ register_component (EComponentRegistry *component_registry,
EvolutionShellComponentClient *client;
CORBA_Environment ev;
CORBA_unsigned_long i;
- const char *local_directory;
priv = component_registry->priv;
@@ -158,14 +157,6 @@ register_component (EComponentRegistry *component_registry,
component_corba_interface = bonobo_object_corba_objref (BONOBO_OBJECT (client));
shell_corba_interface = bonobo_object_corba_objref (BONOBO_OBJECT (priv->shell));
- local_directory = e_shell_get_local_directory (priv->shell);
-
- Evolution_ShellComponent_set_owner (component_corba_interface, shell_corba_interface, local_directory, &ev);
- if (ev._major != CORBA_NO_EXCEPTION) {
- bonobo_object_unref (BONOBO_OBJECT (client));
- CORBA_exception_free (&ev);
- return FALSE;
- }
supported_types = Evolution_ShellComponent__get_supported_types (component_corba_interface, &ev);
if (ev._major != CORBA_NO_EXCEPTION || supported_types->_length == 0) {
diff --git a/shell/e-shell.c b/shell/e-shell.c
index 1623162dda..87f19fb4db 100644
--- a/shell/e-shell.c
+++ b/shell/e-shell.c
@@ -364,6 +364,35 @@ setup_components (EShell *shell)
CORBA_exception_free (&ev);
}
+/* FIXME what if anything fails here? */
+static void
+set_owner_on_components (EShell *shell)
+{
+ Evolution_Shell corba_shell;
+ EShellPrivate *priv;
+ const char *local_directory;
+ GList *id_list;
+ GList *p;
+
+ priv = shell->priv;
+ local_directory = e_shell_get_local_directory (shell);
+
+ corba_shell = bonobo_object_corba_objref (BONOBO_OBJECT (shell));
+
+ id_list = e_component_registry_get_id_list (priv->component_registry);
+ for (p = id_list; p != NULL; p = p->next) {
+ EvolutionShellComponentClient *component_client;
+ const char *id;
+
+ id = (const char *) p->data;
+ component_client = e_component_registry_get_component_by_id (priv->component_registry, id);
+
+ evolution_shell_component_client_set_owner (component_client, corba_shell, local_directory);
+ }
+
+ e_free_string_list (id_list);
+}
+
/* EShellView destruction callback. */
@@ -549,6 +578,9 @@ e_shell_construct (EShell *shell,
/* The local storage depends on the component registry. */
setup_local_storage (shell);
+ /* Now that we have a local storage, we can tell the components we are here. */
+ set_owner_on_components (shell);
+
shortcut_path = g_concat_dir_and_file (local_directory, "shortcuts.xml");
priv->shortcuts = e_shortcuts_new (priv->storage_set,
priv->folder_type_registry,
diff --git a/shell/evolution-shell-client.c b/shell/evolution-shell-client.c
index 4e4fd830b3..a380cae22a 100644
--- a/shell/evolution-shell-client.c
+++ b/shell/evolution-shell-client.c
@@ -330,4 +330,41 @@ evolution_shell_client_user_select_folder (EvolutionShellClient *shell_client,
}
+/**
+ * evolution_shell_client_get_local_storage:
+ * @shell_client: An EvolutionShellClient object
+ *
+ * Retrieve the local storage interface for this shell.
+ *
+ * Return value: a pointer to the CORBA object implementing the local storage
+ * in the shell associated with @shell_client.
+ **/
+Evolution_LocalStorage
+evolution_shell_client_get_local_storage (EvolutionShellClient *shell_client)
+{
+ Evolution_Shell corba_shell;
+ Evolution_LocalStorage corba_local_storage;
+ CORBA_Environment ev;
+
+ g_return_val_if_fail (shell_client != NULL, CORBA_OBJECT_NIL);
+ g_return_val_if_fail (EVOLUTION_IS_SHELL_CLIENT (shell_client), CORBA_OBJECT_NIL);
+
+ CORBA_exception_init (&ev);
+
+ corba_shell = bonobo_object_corba_objref (BONOBO_OBJECT (shell_client));
+ if (corba_shell == CORBA_OBJECT_NIL)
+ return CORBA_OBJECT_NIL;
+
+ corba_local_storage = Evolution_Shell_get_local_storage (corba_shell, &ev);
+ if (ev._major != CORBA_NO_EXCEPTION) {
+ CORBA_exception_free (&ev);
+ return CORBA_OBJECT_NIL;
+ }
+
+ CORBA_exception_free (&ev);
+
+ return corba_local_storage;
+}
+
+
E_MAKE_TYPE (evolution_shell_client, "EvolutionShellClient", EvolutionShellClient, class_init, init, PARENT_TYPE)
diff --git a/shell/evolution-shell-client.h b/shell/evolution-shell-client.h
index c9258574f7..151f18f9b7 100644
--- a/shell/evolution-shell-client.h
+++ b/shell/evolution-shell-client.h
@@ -59,17 +59,19 @@ struct _EvolutionShellClientClass {
};
-GtkType evolution_shell_client_get_type (void);
-void evolution_shell_client_construct (EvolutionShellClient *shell_client,
- Evolution_Shell corba_shell);
-EvolutionShellClient *evolution_shell_client_new (Evolution_Shell shell);
+GtkType evolution_shell_client_get_type (void);
+void evolution_shell_client_construct (EvolutionShellClient *shell_client,
+ Evolution_Shell corba_shell);
+EvolutionShellClient *evolution_shell_client_new (Evolution_Shell shell);
-void evolution_shell_client_user_select_folder (EvolutionShellClient *shell_client,
- const char *title,
- const char *default_folder,
- const char *possible_types[],
- char **uri_return,
- char **physical_uri_return);
+void evolution_shell_client_user_select_folder (EvolutionShellClient *shell_client,
+ const char *title,
+ const char *default_folder,
+ const char *possible_types[],
+ char **uri_return,
+ char **physical_uri_return);
+
+Evolution_LocalStorage evolution_shell_client_get_local_storage (EvolutionShellClient *shell_client);
#ifdef __cplusplus
}