aboutsummaryrefslogtreecommitdiffstats
path: root/shell/e-shell-view.c
diff options
context:
space:
mode:
authorEttore Perazzoli <ettore@src.gnome.org>2001-09-14 07:46:03 +0800
committerEttore Perazzoli <ettore@src.gnome.org>2001-09-14 07:46:03 +0800
commit638ad0ba0b02766c7e48a92d72366cf6fc39e4c1 (patch)
tree85510393655da2e0a6dd58a0d94e47444619ca48 /shell/e-shell-view.c
parent1c75ae8c60d794793ee66dd0d8139776db9e9c8e (diff)
downloadgsoc2013-evolution-638ad0ba0b02766c7e48a92d72366cf6fc39e4c1.tar.gz
gsoc2013-evolution-638ad0ba0b02766c7e48a92d72366cf6fc39e4c1.tar.zst
gsoc2013-evolution-638ad0ba0b02766c7e48a92d72366cf6fc39e4c1.zip
[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. svn path=/trunk/; revision=12816
Diffstat (limited to 'shell/e-shell-view.c')
-rw-r--r--shell/e-shell-view.c33
1 files changed, 26 insertions, 7 deletions
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;