From 732e7096a18a2e2bb9074bdf8026af037d9f8685 Mon Sep 17 00:00:00 2001 From: Matthew Barnes Date: Fri, 28 May 2010 15:57:44 -0400 Subject: 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. --- modules/calendar/e-task-shell-content.c | 44 +++++++++++++++++++++++---------- 1 file changed, 31 insertions(+), 13 deletions(-) (limited to 'modules/calendar/e-task-shell-content.c') diff --git a/modules/calendar/e-task-shell-content.c b/modules/calendar/e-task-shell-content.c index fdbfa758a4..b2744a883e 100644 --- a/modules/calendar/e-task-shell-content.c +++ b/modules/calendar/e-task-shell-content.c @@ -264,6 +264,31 @@ task_shell_content_model_row_changed_cb (ETaskShellContent *task_shell_content, task_shell_content, 0, E_TABLE (task_table)); } +static void +task_shell_content_restore_state_cb (EShellWindow *shell_window, + EShellView *shell_view, + EShellContent *shell_content) +{ + ETaskShellContentPrivate *priv; + GConfBridge *bridge; + GObject *object; + const gchar *key; + + priv = E_TASK_SHELL_CONTENT_GET_PRIVATE (shell_content); + + /* Bind GObject properties to GConf keys. */ + + bridge = gconf_bridge_get (); + + object = G_OBJECT (priv->paned); + key = "/apps/evolution/calendar/display/task_hpane_position"; + gconf_bridge_bind_property_delayed (bridge, key, object, "hposition"); + + object = G_OBJECT (priv->paned); + key = "/apps/evolution/calendar/display/task_vpane_position"; + gconf_bridge_bind_property_delayed (bridge, key, object, "vposition"); +} + static GtkOrientation task_shell_content_get_orientation (ETaskShellContent *task_shell_content) { @@ -395,12 +420,10 @@ task_shell_content_constructed (GObject *object) EShellView *shell_view; GalViewInstance *view_instance; icaltimezone *timezone; - GConfBridge *bridge; GtkTargetList *target_list; GtkTargetEntry *targets; GtkWidget *container; GtkWidget *widget; - const gchar *key; gint n_targets; priv = E_TASK_SHELL_CONTENT_GET_PRIVATE (object); @@ -521,17 +544,12 @@ task_shell_content_constructed (GObject *object) gal_view_instance_load (view_instance); priv->view_instance = view_instance; - /* Bind GObject properties to GConf keys. */ - - bridge = gconf_bridge_get (); - - object = G_OBJECT (priv->paned); - key = "/apps/evolution/calendar/display/task_hpane_position"; - gconf_bridge_bind_property_delayed (bridge, key, object, "hposition"); - - object = G_OBJECT (priv->paned); - key = "/apps/evolution/calendar/display/task_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::tasks", + G_CALLBACK (task_shell_content_restore_state_cb), + shell_content); } static guint32 -- cgit v1.2.3