From 1a800edf4d387b9fd2b34bc01e136bc8452f17ca Mon Sep 17 00:00:00 2001 From: Ettore Perazzoli Date: Thu, 20 Jul 2000 14:39:08 +0000 Subject: Implement saving of pane positions. svn path=/trunk/; revision=4238 --- shell/ChangeLog | 6 ++++++ shell/e-shell-view.c | 20 +++++++++++++++++--- 2 files changed, 23 insertions(+), 3 deletions(-) diff --git a/shell/ChangeLog b/shell/ChangeLog index 565762994e..2d78fd8f5a 100644 --- a/shell/ChangeLog +++ b/shell/ChangeLog @@ -1,3 +1,9 @@ +2000-07-20 Ettore Perazzoli + + * e-shell-view.c (e_shell_view_save_settings): Save the paned + positions. + (e_shell_view_load_settings): Restore them. + 2000-07-20 Ettore Perazzoli * e-shell.c (save_settings_for_views): New. Code moved out of diff --git a/shell/e-shell-view.c b/shell/e-shell-view.c index 36e0becf0d..fcd5b54843 100644 --- a/shell/e-shell-view.c +++ b/shell/e-shell-view.c @@ -987,6 +987,7 @@ e_shell_view_save_settings (EShellView *shell_view, GConfClient *gconf_client, const char *prefix) { + EShellViewPrivate *priv; GConfError *err = NULL; const char *uri; char *path; @@ -998,6 +999,8 @@ e_shell_view_save_settings (EShellView *shell_view, g_return_val_if_fail (prefix != NULL, FALSE); g_return_val_if_fail (g_path_is_absolute (prefix), FALSE); + priv = shell_view->priv; + #define SET(type, key, value) \ path = g_strconcat (prefix, "/", (key), NULL); \ gconf_client_set_##type (gconf_client, path, (value), &err); \ @@ -1007,8 +1010,10 @@ e_shell_view_save_settings (EShellView *shell_view, return FALSE; \ } - SET (int, "FolderBarMode", e_shell_view_get_folder_bar_mode (shell_view)) - SET (int, "ShortcutBarMode", e_shell_view_get_shortcut_bar_mode (shell_view)); + SET (int, "FolderBarMode", e_shell_view_get_folder_bar_mode (shell_view)) + SET (int, "ShortcutBarMode", e_shell_view_get_shortcut_bar_mode (shell_view)); + SET (int, "HPanedPosition", e_paned_get_position (E_PANED (priv->hpaned))); + SET (int, "ViewHPanedPosition", e_paned_get_position (priv->view_hpaned)); uri = e_shell_view_get_current_uri (shell_view); if (uri != NULL) { @@ -1045,8 +1050,9 @@ e_shell_view_load_settings (EShellView *shell_view, GConfClient *gconf_client, const char *prefix) { - gboolean val; + EShellViewPrivate *priv; GConfError *err = NULL; + int val; char *stringval; char *path; @@ -1057,6 +1063,8 @@ e_shell_view_load_settings (EShellView *shell_view, g_return_val_if_fail (prefix != NULL, FALSE); g_return_val_if_fail (g_path_is_absolute (prefix), FALSE); + priv = shell_view->priv; + #define GET(type, key, value) \ path = g_strconcat (prefix, "/", (key), NULL); \ (value) = gconf_client_get_##type (gconf_client, path, &err); \ @@ -1072,6 +1080,12 @@ e_shell_view_load_settings (EShellView *shell_view, GET (int, "ShortcutBarMode", val); e_shell_view_set_shortcut_bar_mode (shell_view, val); + GET (int, "HPanedPosition", val); + e_paned_set_position (E_PANED (priv->hpaned), val); + + GET (int, "ViewHPanedPosition", val); + e_paned_set_position (E_PANED (priv->view_hpaned), val); + GET (string, "DisplayedURI", stringval); e_shell_view_display_uri (shell_view, stringval); g_free (stringval); -- cgit v1.2.3