diff options
author | Matthew Barnes <mbarnes@redhat.com> | 2010-05-29 03:57:44 +0800 |
---|---|---|
committer | Matthew Barnes <mbarnes@redhat.com> | 2010-05-29 03:57:44 +0800 |
commit | 732e7096a18a2e2bb9074bdf8026af037d9f8685 (patch) | |
tree | 5fe2132433d9d733861b350fe640ff69bfa7eeff /modules/addressbook | |
parent | db89f125033c70a3043be9b0a3061ef1e66d9428 (diff) | |
download | gsoc2013-evolution-732e7096a18a2e2bb9074bdf8026af037d9f8685.tar.gz gsoc2013-evolution-732e7096a18a2e2bb9074bdf8026af037d9f8685.tar.zst gsoc2013-evolution-732e7096a18a2e2bb9074bdf8026af037d9f8685.zip |
Bug 613038 - Preview pane size not remembered
Converted size restoration of all preview panes to be triggered by
EShellWindow::shell-view-created signal. The signal is emitted when
the view is fully initialized and visible. Shell views can use that
as a trigger for restoring pane sizes from GConf.
Diffstat (limited to 'modules/addressbook')
-rw-r--r-- | modules/addressbook/e-book-shell-content.c | 44 |
1 files changed, 31 insertions, 13 deletions
diff --git a/modules/addressbook/e-book-shell-content.c b/modules/addressbook/e-book-shell-content.c index 4a48677d13..66cd6a4660 100644 --- a/modules/addressbook/e-book-shell-content.c +++ b/modules/addressbook/e-book-shell-content.c @@ -66,6 +66,31 @@ book_shell_content_send_message_cb (EBookShellContent *book_shell_content, eab_send_as_to (&node); } +static void +book_shell_content_restore_state_cb (EShellWindow *shell_window, + EShellView *shell_view, + EShellContent *shell_content) +{ + EBookShellContentPrivate *priv; + GConfBridge *bridge; + GObject *object; + const gchar *key; + + priv = E_BOOK_SHELL_CONTENT_GET_PRIVATE (shell_content); + + /* Bind GObject properties to GConf keys. */ + + bridge = gconf_bridge_get (); + + object = G_OBJECT (priv->paned); + key = "/apps/evolution/addressbook/display/hpane_position"; + gconf_bridge_bind_property_delayed (bridge, key, object, "hposition"); + + object = G_OBJECT (priv->paned); + key = "/apps/evolution/addressbook/display/vpane_position"; + gconf_bridge_bind_property_delayed (bridge, key, object, "vposition"); +} + static GtkOrientation book_shell_content_get_orientation (EBookShellContent *book_shell_content) { @@ -190,10 +215,8 @@ book_shell_content_constructed (GObject *object) EShellWindow *shell_window; EShellContent *shell_content; EShellTaskbar *shell_taskbar; - GConfBridge *bridge; GtkWidget *container; GtkWidget *widget; - const gchar *key; priv = E_BOOK_SHELL_CONTENT_GET_PRIVATE (object); @@ -247,17 +270,12 @@ book_shell_content_constructed (GObject *object) e_binding_new (object, "preview-visible", widget, "visible"); - /* Bind GObject properties to GConf keys. */ - - bridge = gconf_bridge_get (); - - object = G_OBJECT (priv->paned); - key = "/apps/evolution/addressbook/display/hpane_position"; - gconf_bridge_bind_property_delayed (bridge, key, object, "hposition"); - - object = G_OBJECT (priv->paned); - key = "/apps/evolution/addressbook/display/vpane_position"; - gconf_bridge_bind_property_delayed (bridge, key, object, "vposition"); + /* Restore pane positions from the last session once + * the shell view is fully initialized and visible. */ + g_signal_connect ( + shell_window, "shell-view-created::addressbook", + G_CALLBACK (book_shell_content_restore_state_cb), + shell_content); } static void |