diff options
author | Ettore Perazzoli <ettore@src.gnome.org> | 2003-12-05 07:12:28 +0800 |
---|---|---|
committer | Ettore Perazzoli <ettore@src.gnome.org> | 2003-12-05 07:12:28 +0800 |
commit | 56ac1ec642fb0713434132a76186290018569f67 (patch) | |
tree | 84514676d9cf41ba687abeb9e320e46979b53167 /shell/e-shell.c | |
parent | 7278ac2b56431724dd4d8afecd8bfb7fc0c72b6e (diff) | |
download | gsoc2013-evolution-56ac1ec642fb0713434132a76186290018569f67.tar.gz gsoc2013-evolution-56ac1ec642fb0713434132a76186290018569f67.tar.zst gsoc2013-evolution-56ac1ec642fb0713434132a76186290018569f67.zip |
Implement.
* e-shell.c (e_shell_prepare_for_quit): Implement.
* Evolution-Component.idl (Component::requestQuit): Make sync
[i.e. just return a boolean instead of using a BonoboListener].
svn path=/trunk/; revision=23639
Diffstat (limited to 'shell/e-shell.c')
-rw-r--r-- | shell/e-shell.c | 50 |
1 files changed, 19 insertions, 31 deletions
diff --git a/shell/e-shell.c b/shell/e-shell.c index e5e7281361..7da688d100 100644 --- a/shell/e-shell.c +++ b/shell/e-shell.c @@ -1016,15 +1016,11 @@ e_shell_construct_result_to_string (EShellConstructResult result) gboolean e_shell_prepare_for_quit (EShell *shell) { - /* FIXME TODO */ - - return TRUE; - -#if 0 EShellPrivate *priv; - GList *component_ids; + GSList *component_infos; GList *p; - gboolean retval; + GSList *sp; + CORBA_boolean can_quit; g_return_val_if_fail (E_IS_SHELL (shell), FALSE); @@ -1036,40 +1032,32 @@ e_shell_prepare_for_quit (EShell *shell) for (p = priv->windows; p != NULL; p = p->next) gtk_widget_set_sensitive (GTK_WIDGET (p->data), FALSE); - component_ids = e_component_registry_get_id_list (priv->component_registry); - - for (p = component_ids; p != NULL; p = p->next) { - EvolutionShellComponentClient *client; - const char *id; - GNOME_Evolution_ShellComponentListener_Result result; - - id = (const char *) p->data; - client = e_component_registry_get_component_by_id (priv->component_registry, id); + component_infos = e_component_registry_peek_list (priv->component_registry); + can_quit = TRUE; + for (sp = component_infos; sp != NULL; sp = sp->next) { + EComponentInfo *info = sp->data; + CORBA_Environment ev; - result = (GNOME_Evolution_ShellComponentListener_Result) -1; + CORBA_exception_init (&ev); - evolution_shell_component_client_request_quit (client, prepare_for_quit_callback, &result); + can_quit = GNOME_Evolution_Component_requestQuit (info->iface, &ev); + if (BONOBO_EX (&ev)) { + /* The component might not implement the interface, in which case we assume we can quit. */ + can_quit = TRUE; + } - while (result == (GNOME_Evolution_ShellComponentListener_Result) -1) - gtk_main_iteration (); + CORBA_exception_free (&ev); - if (result == GNOME_Evolution_ShellComponentListener_CANCEL) { - retval = FALSE; - goto end; - } + if (! can_quit) + break; } - retval = TRUE; - - end: /* Restore all the windows to be sensitive. */ for (p = priv->windows; p != NULL; p = p->next) gtk_widget_set_sensitive (GTK_WIDGET (p->data), TRUE); - priv->preparing_to_quit = FALSE; - e_free_string_list (component_ids); - return retval; -#endif + priv->preparing_to_quit = FALSE; + return can_quit; } |