From 92ec933b198f15789e028cd3c3dc144ba00bb862 Mon Sep 17 00:00:00 2001 From: Ettore Perazzoli Date: Mon, 23 Sep 2002 21:30:57 +0000 Subject: Use e_shell_request_close_view(). * e-shell-view-menu.c (command_close): Use e_shell_request_close_view(). * e-shell.c (e_shell_request_close_view): New, code moved out of view_delete_event_cb(). (view_delete_event_cb): Use it. svn path=/trunk/; revision=18183 --- shell/e-shell.c | 53 ++++++++++++++++++++++++++++++++++++----------------- 1 file changed, 36 insertions(+), 17 deletions(-) (limited to 'shell/e-shell.c') diff --git a/shell/e-shell.c b/shell/e-shell.c index 839d77263c..115201f982 100644 --- a/shell/e-shell.c +++ b/shell/e-shell.c @@ -651,6 +651,16 @@ impl_Shell_setLineStatus (PortableServer_Servant servant, e_shell_go_offline (shell, NULL); } + +void +e_shell_set_interactive (EShell *shell, + gboolean interactive) +{ + g_return_if_fail (E_IS_SHELL (shell)); + + set_interactive (shell, interactive); +} + /* Set up the ::Activity interface. */ @@ -916,24 +926,9 @@ view_delete_event_cb (GtkWidget *widget, EShell *shell; g_assert (E_IS_SHELL_VIEW (widget)); - shell = E_SHELL (data); - e_shell_save_settings (shell); - - if (g_list_length (shell->priv->views) != 1) { - /* If it's not the last view, just destroy it. */ - return FALSE; - } - - if (shell->priv->preparing_to_quit) - return TRUE; - /* If it's the last view, ask for confirm before actually destroying - this view. */ - if (e_shell_prepare_for_quit (shell)) - return FALSE; - else - return TRUE; + return ! e_shell_request_close_view (shell, E_SHELL_VIEW (widget)); } static void @@ -1307,7 +1302,7 @@ e_shell_construct (EShell *shell, if (show_splash) gtk_widget_destroy (splash); - if (e_shell_startup_wizard_create () == FALSE) { + if (e_shell_startup_wizard_create (shell) == FALSE) { e_shell_unregister_all (shell); bonobo_object_unref (BONOBO_OBJECT (shell)); @@ -1444,6 +1439,30 @@ e_shell_create_view_from_uri_and_settings (EShell *shell, return view; } +gboolean +e_shell_request_close_view (EShell *shell, + EShellView *shell_view) +{ + g_return_val_if_fail (E_IS_SHELL (shell), FALSE); + g_return_val_if_fail (E_IS_SHELL_VIEW (shell_view), FALSE); + + e_shell_save_settings (shell); + + if (g_list_length (shell->priv->views) != 1) { + /* Not the last view. */ + return TRUE; + } + + if (shell->priv->preparing_to_quit) + return FALSE; + + /* If it's the last view, ask for confirm. */ + if (e_shell_prepare_for_quit (shell)) + return TRUE; + else + return FALSE; +} + /** * e_shell_get_local_directory: -- cgit v1.2.3