From 6b346389dcf339d68fbdae79b0cf13924a2b3700 Mon Sep 17 00:00:00 2001 From: Ettore Perazzoli Date: Wed, 4 Sep 2002 18:36:21 +0000 Subject: Pass FALSE as @restore_all_views to e_shell_restore_from_settings() so we * main.c (idle_cb): Pass FALSE as @restore_all_views to e_shell_restore_from_settings() so we only restore the first view. * e-shell.c (e_shell_restore_from_settings): New arg @restore_all_views. svn path=/trunk/; revision=17967 --- shell/ChangeLog | 8 ++++++++ shell/e-shell.c | 16 +++++++++++----- shell/e-shell.h | 3 ++- shell/main.c | 2 +- 4 files changed, 22 insertions(+), 7 deletions(-) (limited to 'shell') diff --git a/shell/ChangeLog b/shell/ChangeLog index 5fb29e2c3c..7c710595a5 100644 --- a/shell/ChangeLog +++ b/shell/ChangeLog @@ -1,3 +1,11 @@ +2002-09-04 Ettore Perazzoli + + * main.c (idle_cb): Pass FALSE as @restore_all_views to + e_shell_restore_from_settings() so we only restore the first view. + + * e-shell.c (e_shell_restore_from_settings): New arg + @restore_all_views. + 2002-09-04 Ettore Perazzoli * e-storage-set-view.c (popup_folder_menu): Remove the context diff --git a/shell/e-shell.c b/shell/e-shell.c index 09eb7f91cf..a6b90f3669 100644 --- a/shell/e-shell.c +++ b/shell/e-shell.c @@ -1304,9 +1304,8 @@ e_shell_construct (EShell *shell, can tell the components we are here. */ set_owner_on_components (shell, E_SPLASH (splash)); - if (show_splash) { + if (show_splash) gtk_widget_destroy (splash); - } if (e_shell_startup_wizard_create () == FALSE) { e_shell_unregister_all (shell); @@ -1694,15 +1693,18 @@ e_shell_save_settings (EShell *shell) /** * e_shell_restore_from_settings: * @shell: An EShell object. + * @restore_all_views: whether to restore all the views * * Restore the existing views from the saved configuration. The shell must - * have no views for this to work. + * have no views for this to work. If @restore_all_views is TRUE, restore all + * the views; otherwise, just the first one. * * Return value: %FALSE if the shell has some open views or there is no saved * configuration. %TRUE if the configuration could be restored successfully. **/ gboolean -e_shell_restore_from_settings (EShell *shell) +e_shell_restore_from_settings (EShell *shell, + gboolean restore_all_views) { EShellPrivate *priv; int num_views; @@ -1716,9 +1718,13 @@ e_shell_restore_from_settings (EShell *shell) num_views = bonobo_config_get_long_with_default (priv->db, "/Shell/Views/NumberOfViews", 0, NULL); - for (i = 0; i < num_views; i++) + for (i = 0; i < num_views; i++) { e_shell_create_view_from_uri_and_settings (shell, NULL, i); + if (! restore_all_views) + break; + } + return (num_views > 0); } diff --git a/shell/e-shell.h b/shell/e-shell.h index f5bb51e637..8713a0b06e 100644 --- a/shell/e-shell.h +++ b/shell/e-shell.h @@ -126,7 +126,8 @@ EFolderTypeRegistry *e_shell_get_folder_type_registry (EShell *shell); EUriSchemaRegistry *e_shell_get_uri_schema_registry (EShell *shell); gboolean e_shell_save_settings (EShell *shell); -gboolean e_shell_restore_from_settings (EShell *shell); +gboolean e_shell_restore_from_settings (EShell *shell, + gboolean restore_all_views); void e_shell_destroy_all_views (EShell *shell); diff --git a/shell/main.c b/shell/main.c index 1b22658d96..b22fd8fa5e 100644 --- a/shell/main.c +++ b/shell/main.c @@ -387,7 +387,7 @@ idle_cb (void *data) * user's previous settings, then show the default URI. */ if (! have_evolution_uri) { - if (! e_shell_restore_from_settings (shell)) + if (! e_shell_restore_from_settings (shell, FALSE)) display_default = TRUE; else display_default = FALSE; -- cgit v1.2.3