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/calendar | |
parent | db89f125033c70a3043be9b0a3061ef1e66d9428 (diff) | |
download | gsoc2013-evolution-732e7096a18a2e2bb9074bdf8026af037d9f8685.tar gsoc2013-evolution-732e7096a18a2e2bb9074bdf8026af037d9f8685.tar.gz gsoc2013-evolution-732e7096a18a2e2bb9074bdf8026af037d9f8685.tar.bz2 gsoc2013-evolution-732e7096a18a2e2bb9074bdf8026af037d9f8685.tar.lz gsoc2013-evolution-732e7096a18a2e2bb9074bdf8026af037d9f8685.tar.xz 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/calendar')
-rw-r--r-- | modules/calendar/e-memo-shell-content.c | 46 | ||||
-rw-r--r-- | modules/calendar/e-task-shell-content.c | 44 |
2 files changed, 64 insertions, 26 deletions
diff --git a/modules/calendar/e-memo-shell-content.c b/modules/calendar/e-memo-shell-content.c index 279f063035..f9188dedc5 100644 --- a/modules/calendar/e-memo-shell-content.c +++ b/modules/calendar/e-memo-shell-content.c @@ -266,6 +266,31 @@ memo_shell_content_model_row_changed_cb (EMemoShellContent *memo_shell_content, memo_shell_content, 0, E_TABLE (memo_table)); } +static void +memo_shell_content_restore_state_cb (EShellWindow *shell_window, + EShellView *shell_view, + EShellContent *shell_content) +{ + EMemoShellContentPrivate *priv; + GConfBridge *bridge; + GObject *object; + const gchar *key; + + priv = E_MEMO_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/memo_hpane_position"; + gconf_bridge_bind_property_delayed (bridge, key, object, "hposition"); + + object = G_OBJECT (priv->paned); + key = "/apps/evolution/calendar/display/memo_vpane_position"; + gconf_bridge_bind_property_delayed (bridge, key, object, "vposition"); +} + static GtkOrientation memo_shell_content_get_orientation (EMemoShellContent *memo_shell_content) { @@ -395,14 +420,13 @@ memo_shell_content_constructed (GObject *object) EShellBackend *shell_backend; EShellContent *shell_content; EShellTaskbar *shell_taskbar; + EShellWindow *shell_window; GalViewInstance *view_instance; icaltimezone *timezone; - GConfBridge *bridge; GtkTargetList *target_list; GtkTargetEntry *targets; GtkWidget *container; GtkWidget *widget; - const gchar *key; gint n_targets; priv = E_MEMO_SHELL_CONTENT_GET_PRIVATE (object); @@ -414,6 +438,7 @@ memo_shell_content_constructed (GObject *object) shell_view = e_shell_content_get_shell_view (shell_content); shell_backend = e_shell_view_get_shell_backend (shell_view); shell_taskbar = e_shell_view_get_shell_taskbar (shell_view); + shell_window = e_shell_view_get_shell_window (shell_view); shell = e_shell_backend_get_shell (shell_backend); shell_settings = e_shell_get_shell_settings (shell); @@ -524,17 +549,12 @@ memo_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/memo_hpane_position"; - gconf_bridge_bind_property_delayed (bridge, key, object, "hposition"); - - object = G_OBJECT (priv->paned); - key = "/apps/evolution/calendar/display/memo_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::memos", + G_CALLBACK (memo_shell_content_restore_state_cb), + shell_content); } static guint32 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 |