Remove the ugliness that was `e_shell_quit()'; implement an

`e_shell_destroy_all_views()' function instead, and get the "Exit"
menu item to use that instead.

svn path=/trunk/; revision=10467
This commit is contained in:
Ettore Perazzoli
2001-06-25 04:41:32 +00:00
parent 5cd485fec1
commit 8a77a47f19
5 changed files with 25 additions and 44 deletions
+11
View File
@@ -1,3 +1,14 @@
2001-06-25 Ettore Perazzoli <ettore@ximian.com>
* main.c (no_views_left_cb): Don't call `e_shell_quit()' anymore.
* e-shell-view-menu.c (command_quit): Call
`e_shell_destroy_all_views()' instead of `e_shell_quit()', which
does not exist anymore.
* e-shell.c (e_shell_quit): Removed.
(e_shell_destroy_all_views): New.
2001-06-24 Ettore Perazzoli <ettore@ximian.com>
* Makefile.am: s/\.oafinfo/.oaf/g.
+1 -3
View File
@@ -159,9 +159,7 @@ command_quit (BonoboUIComponent *uih,
shell_view = E_SHELL_VIEW (data);
shell = e_shell_view_get_shell (shell_view);
e_shell_quit (shell);
gtk_main_quit ();
e_shell_destroy_all_views (shell);
}
#if 0
+9 -39
View File
@@ -1121,17 +1121,16 @@ e_shell_restore_from_settings (EShell *shell)
}
/**
* e_shell_quit:
* @shell: An EShell.
* e_shell_destroy_all_views:
* @shell:
*
* Make @shell quit. This will close all the associated views and destroy the
* object.
* Destroy all the views in @shell.
**/
void
e_shell_quit (EShell *shell)
e_shell_destroy_all_views (EShell *shell)
{
EShellPrivate *priv;
GList *p;
GList *p, *pnext;
g_return_if_fail (shell != NULL);
g_return_if_fail (E_IS_SHELL (shell));
@@ -1141,43 +1140,14 @@ e_shell_quit (EShell *shell)
priv = shell->priv;
for (p = priv->views; p != NULL; p = p->next) {
for (p = priv->views; p != NULL; p = pnext) {
EShellView *shell_view;
pnext = p->next;
shell_view = E_SHELL_VIEW (p->data);
gtk_signal_disconnect_by_func (
GTK_OBJECT (shell_view),
GTK_SIGNAL_FUNC (view_destroy_cb), shell);
gtk_object_destroy (GTK_OBJECT (shell_view));
gtk_widget_destroy (GTK_WIDGET (shell_view));
}
g_list_free (priv->views);
priv->views = NULL;
bonobo_object_unref (BONOBO_OBJECT (priv->corba_storage_registry));
priv->corba_storage_registry = NULL;
e_storage_set_remove_all_storages (priv->storage_set);
/*
* Ok, so you thought the GUI components lifecycle was coupled to
* the Shell's, in fact this is not the case, they are unref'd
* here, and NULL'd to avoid shell destruction killing them again.
* So; the shell can be destroyed either remotely or localy.
*/
gtk_object_unref (GTK_OBJECT (priv->storage_set));
gtk_object_unref (GTK_OBJECT (priv->shortcuts));
gtk_object_unref (GTK_OBJECT (priv->folder_type_registry));
gtk_object_unref (GTK_OBJECT (priv->component_registry));
priv->storage_set = NULL;
priv->shortcuts = NULL;
priv->folder_type_registry = NULL;
priv->component_registry = NULL;
bonobo_object_unref (BONOBO_OBJECT (shell));
}
+1 -1
View File
@@ -97,7 +97,7 @@ EFolderTypeRegistry *e_shell_get_folder_type_registry (EShell *shell);
gboolean e_shell_save_settings (EShell *shell);
gboolean e_shell_restore_from_settings (EShell *shell);
void e_shell_quit (EShell *shell);
void e_shell_destroy_all_views (EShell *shell);
void e_shell_component_maybe_crashed (EShell *shell,
const char *uri,
+3 -1
View File
@@ -56,7 +56,9 @@ extern char *evolution_debug_log;
static void
no_views_left_cb (EShell *shell, gpointer data)
{
e_shell_quit (shell);
/* FIXME: This is wrong. We should exit only when the shell is
destroyed. But refcounting is broken at present, so this is a
reasonable workaround for now. */
gtk_main_quit ();
}