diff options
-rw-r--r-- | shell/ChangeLog | 27 | ||||
-rw-r--r-- | shell/e-shell-folder-commands.c | 6 | ||||
-rw-r--r-- | shell/e-shell-view-menu.c | 5 | ||||
-rw-r--r-- | shell/e-shell-view.c | 33 | ||||
-rw-r--r-- | shell/e-shell.c | 7 |
5 files changed, 67 insertions, 11 deletions
diff --git a/shell/ChangeLog b/shell/ChangeLog index f87c9410e3..d96c0eb209 100644 --- a/shell/ChangeLog +++ b/shell/ChangeLog @@ -1,5 +1,32 @@ 2001-09-13 Ettore Perazzoli <ettore@ximian.com> + [Fix #5990, Remembering Evolution window geometry.] + + * e-shell.c (impl_Shell_createNewView): gtk_widget_show() the new + view returned by `e_shell_create_view()'. + (e_shell_restore_from_settings): Same here, after loading the + settings. + + * e-shell-view.c (activate_shortcut_cb): gtk_widget_show() the new + view returned by `e_shell_create_view()'. + + * e-shell-view-menu.c (command_open_folder_in_new_window): + gtk_widget_show() the view returned by `e_shell_create_view()'. + + * e-shell-folder-commands.c + (e_shell_command_open_folder_in_other_window): gtk_widget_show() + the view returned by `e_shell_create_view()'. + + * e-shell.c (e_shell_create_view): Don't show the view + automatically anymore. + + * e-shell-view.c (e_shell_view_save_settings): Save the width and + height of the window. + (e_shell_view_load_settings): Restore the width and the height and + gtk_window_set_default_size() based on them. + +2001-09-13 Ettore Perazzoli <ettore@ximian.com> + [Remove a bunch of debugging messages, as per #7741.] * evolution-wizard.c (impl_GNOME_Evolution_Wizard_notifyAction): diff --git a/shell/e-shell-folder-commands.c b/shell/e-shell-folder-commands.c index b1cc047f85..a9bc540ca3 100644 --- a/shell/e-shell-folder-commands.c +++ b/shell/e-shell-folder-commands.c @@ -256,11 +256,15 @@ void e_shell_command_open_folder_in_other_window (EShell *shell, EShellView *shell_view) { + EShellView *view; + g_return_if_fail (shell != NULL); g_return_if_fail (E_IS_SHELL (shell)); g_return_if_fail (shell_view != NULL && E_IS_SHELL_VIEW (shell_view)); - e_shell_create_view (shell, e_shell_view_get_current_uri (shell_view)); + view = e_shell_create_view (shell, e_shell_view_get_current_uri (shell_view)); + + gtk_widget_show (GTK_WIDGET (view)); } diff --git a/shell/e-shell-view-menu.c b/shell/e-shell-view-menu.c index 1d4d4c1671..5f3520993f 100644 --- a/shell/e-shell-view-menu.c +++ b/shell/e-shell-view-menu.c @@ -308,7 +308,7 @@ command_open_folder_in_new_window (BonoboUIComponent *uih, gpointer data, const char *path) { - EShellView *shell_view; + EShellView *shell_view, *new_view; EShell *shell; const char *current_uri; @@ -316,7 +316,8 @@ command_open_folder_in_new_window (BonoboUIComponent *uih, shell = e_shell_view_get_shell (shell_view); current_uri = e_shell_view_get_current_uri (shell_view); - e_shell_create_view (shell, current_uri); + new_view = e_shell_create_view (shell, current_uri); + gtk_widget_show (GTK_WIDGET (new_view)); } diff --git a/shell/e-shell-view.c b/shell/e-shell-view.c index 974da73007..db6237d2aa 100644 --- a/shell/e-shell-view.c +++ b/shell/e-shell-view.c @@ -597,10 +597,14 @@ activate_shortcut_cb (EShortcutsView *shortcut_view, shell_view = E_SHELL_VIEW (data); - if (in_new_window) - e_shell_create_view (e_shell_view_get_shell (shell_view), uri); - else + if (in_new_window) { + EShellView *new_view; + + new_view = e_shell_create_view (e_shell_view_get_shell (shell_view), uri); + gtk_widget_show (GTK_WIDGET (new_view)); + } else { e_shell_view_display_uri (shell_view, uri); + } } /* Callback when user chooses "Hide shortcut bar" via a right click */ @@ -2322,13 +2326,20 @@ e_shell_view_save_settings (EShellView *shell_view, prefix = g_strdup_printf ("/Shell/Views/%d/", view_num); + key = g_strconcat (prefix, "Width", NULL); + bonobo_config_set_long (db, key, GTK_WIDGET (shell_view)->allocation.width, NULL); + g_free (key); + + key = g_strconcat (prefix, "Height", NULL); + bonobo_config_set_long (db, key, GTK_WIDGET (shell_view)->allocation.height, NULL); + g_free (key); + key = g_strconcat (prefix, "CurrentShortcutsGroupNum", NULL); bonobo_config_set_long (db, key, e_shell_view_get_current_shortcuts_group_num (shell_view), NULL); g_free (key); - key = g_strconcat (prefix, "FolderBarShown", NULL); bonobo_config_set_long (db, key, e_shell_view_folder_bar_shown (shell_view), NULL); g_free (key); @@ -2347,7 +2358,6 @@ e_shell_view_save_settings (EShellView *shell_view, e_paned_get_position (E_PANED (priv->view_hpaned)), NULL); g_free (key); - key = g_strconcat (prefix, "DisplayedURI", NULL); uri = e_shell_view_get_current_uri (shell_view); if (uri != NULL) @@ -2403,6 +2413,7 @@ e_shell_view_load_settings (EShellView *shell_view, EShellViewPrivate *priv; EShortcutBar *shortcut_bar; int num_groups, group, val; + long width, height; char *stringval, *prefix, *filename, *key; g_return_val_if_fail (shell_view != NULL, FALSE); @@ -2417,6 +2428,16 @@ e_shell_view_load_settings (EShellView *shell_view, prefix = g_strdup_printf ("/Shell/Views/%d/", view_num); + key = g_strconcat (prefix, "Width", NULL); + width = bonobo_config_get_long (db, key, NULL); + g_free (key); + + key = g_strconcat (prefix, "Height", NULL); + height = bonobo_config_get_long (db, key, NULL); + g_free (key); + + gtk_window_set_default_size (GTK_WINDOW (shell_view), width, height); + key = g_strconcat (prefix, "CurrentShortcutsGroupNum", NULL); val = bonobo_config_get_long (db, key, NULL); e_shell_view_set_current_shortcuts_group_num (shell_view, val); @@ -2472,10 +2493,8 @@ e_shell_view_load_settings (EShellView *shell_view, filename = g_strdup_printf ("%s/config/storage-set-view-expanded:view_%d", e_shell_get_local_directory (priv->shell), view_num); - e_tree_load_expanded_state (E_TREE (priv->storage_set_view), filename); - g_free (filename); return TRUE; diff --git a/shell/e-shell.c b/shell/e-shell.c index 8ebb607f65..812b585387 100644 --- a/shell/e-shell.c +++ b/shell/e-shell.c @@ -268,6 +268,8 @@ impl_Shell_createNewView (PortableServer_Servant servant, return CORBA_OBJECT_NIL; } + gtk_widget_show (GTK_WIDGET (shell_view)); + shell_view_interface = e_shell_view_get_corba_interface (shell_view); if (shell_view_interface == CORBA_OBJECT_NIL) { CORBA_exception_set (ev, CORBA_USER_EXCEPTION, @@ -1063,7 +1065,6 @@ e_shell_create_view (EShell *shell, view = e_shell_view_new (shell); - gtk_widget_show (GTK_WIDGET (view)); gtk_signal_connect (GTK_OBJECT (view), "delete_event", GTK_SIGNAL_FUNC (view_delete_event_cb), shell); gtk_signal_connect (GTK_OBJECT (view), "destroy", @@ -1354,6 +1355,10 @@ e_shell_restore_from_settings (EShell *shell) if (! e_shell_view_load_settings (view, i)) retval = FALSE; + + /* This needs to be done after loading the settings as the + default size is in the settings as well. */ + gtk_widget_show (GTK_WIDGET (view)); } return retval; |