From 39ee1b7890e06779b47f0fc11925d12caa206c39 Mon Sep 17 00:00:00 2001 From: Matthew Barnes Date: Sun, 17 Jan 2010 17:47:08 -0500 Subject: Give all preview panes a search bar. Use Shift+Ctrl+F as the accelerator for consistency with the mailer. --- modules/calendar/e-memo-shell-content.c | 59 +++++++++++++++++---------------- 1 file changed, 31 insertions(+), 28 deletions(-) (limited to 'modules/calendar/e-memo-shell-content.c') diff --git a/modules/calendar/e-memo-shell-content.c b/modules/calendar/e-memo-shell-content.c index 852c0bbf42..e34af1fbf8 100644 --- a/modules/calendar/e-memo-shell-content.c +++ b/modules/calendar/e-memo-shell-content.c @@ -29,8 +29,10 @@ #include "shell/e-shell-utils.h" #include "widgets/menus/gal-view-etable.h" #include "widgets/misc/e-paned.h" +#include "widgets/misc/e-preview-pane.h" #include "calendar/gui/comp-util.h" +#include "calendar/gui/e-cal-component-preview.h" #include "calendar/gui/e-cal-model-memos.h" #include "calendar/gui/e-memo-table.h" @@ -50,7 +52,7 @@ struct _EMemoShellContentPrivate { GtkWidget *paned; GtkWidget *memo_table; - GtkWidget *memo_preview; + GtkWidget *preview_pane; ECalModel *memo_model; GalViewInstance *view_instance; @@ -192,10 +194,15 @@ memo_shell_content_cursor_change_cb (EMemoShellContent *memo_shell_content, ECalModel *memo_model; ECalModelComponent *comp_data; ECalComponent *comp; + EPreviewPane *preview_pane; + EWebView *web_view; const gchar *uid; memo_model = e_memo_shell_content_get_memo_model (memo_shell_content); - memo_preview = e_memo_shell_content_get_memo_preview (memo_shell_content); + preview_pane = e_memo_shell_content_get_preview_pane (memo_shell_content); + + web_view = e_preview_pane_get_web_view (preview_pane); + memo_preview = E_CAL_COMPONENT_PREVIEW (web_view); if (e_table_selected_count (table) != 1) { e_cal_component_preview_clear (memo_preview); @@ -223,8 +230,13 @@ memo_shell_content_selection_change_cb (EMemoShellContent *memo_shell_content, ETable *table) { ECalComponentPreview *memo_preview; + EPreviewPane *preview_pane; + EWebView *web_view; + + preview_pane = e_memo_shell_content_get_preview_pane (memo_shell_content); - memo_preview = e_memo_shell_content_get_memo_preview (memo_shell_content); + web_view = e_preview_pane_get_web_view (preview_pane); + memo_preview = E_CAL_COMPONENT_PREVIEW (web_view); /* XXX Old code emits a "selection-changed" signal here. */ @@ -347,9 +359,9 @@ memo_shell_content_dispose (GObject *object) priv->memo_table = NULL; } - if (priv->memo_preview != NULL) { - g_object_unref (priv->memo_preview); - priv->memo_preview = NULL; + if (priv->preview_pane != NULL) { + g_object_unref (priv->preview_pane); + priv->preview_pane = NULL; } if (priv->memo_model != NULL) { @@ -445,25 +457,10 @@ memo_shell_content_constructed (GObject *object) container = priv->paned; - widget = gtk_scrolled_window_new (NULL, NULL); - gtk_scrolled_window_set_policy ( - GTK_SCROLLED_WINDOW (widget), - GTK_POLICY_AUTOMATIC, GTK_POLICY_AUTOMATIC); - gtk_scrolled_window_set_shadow_type ( - GTK_SCROLLED_WINDOW (widget), GTK_SHADOW_IN); - gtk_paned_pack2 (GTK_PANED (container), widget, FALSE, FALSE); - gtk_widget_show (widget); - - e_binding_new (object, "preview-visible", widget, "visible"); - - container = widget; - widget = e_cal_component_preview_new (); e_cal_component_preview_set_default_timezone ( E_CAL_COMPONENT_PREVIEW (widget), timezone); e_shell_configure_web_view (shell, E_WEB_VIEW (widget)); - gtk_container_add (GTK_CONTAINER (container), widget); - priv->memo_preview = g_object_ref (widget); gtk_widget_show (widget); g_signal_connect_swapped ( @@ -471,6 +468,13 @@ memo_shell_content_constructed (GObject *object) G_CALLBACK (e_shell_taskbar_set_message), shell_taskbar); + widget = e_preview_pane_new (E_WEB_VIEW (widget)); + gtk_paned_pack2 (GTK_PANED (container), widget, FALSE, FALSE); + priv->preview_pane = g_object_ref (widget); + gtk_widget_show (widget); + + e_binding_new (object, "preview-visible", widget, "visible"); + /* Configure the memo table. */ e_table_set_state ( @@ -681,23 +685,22 @@ e_memo_shell_content_get_memo_model (EMemoShellContent *memo_shell_content) return memo_shell_content->priv->memo_model; } -ECalComponentPreview * -e_memo_shell_content_get_memo_preview (EMemoShellContent *memo_shell_content) +EMemoTable * +e_memo_shell_content_get_memo_table (EMemoShellContent *memo_shell_content) { g_return_val_if_fail ( E_IS_MEMO_SHELL_CONTENT (memo_shell_content), NULL); - return E_CAL_COMPONENT_PREVIEW ( - memo_shell_content->priv->memo_preview); + return E_MEMO_TABLE (memo_shell_content->priv->memo_table); } -EMemoTable * -e_memo_shell_content_get_memo_table (EMemoShellContent *memo_shell_content) +EPreviewPane * +e_memo_shell_content_get_preview_pane (EMemoShellContent *memo_shell_content) { g_return_val_if_fail ( E_IS_MEMO_SHELL_CONTENT (memo_shell_content), NULL); - return E_MEMO_TABLE (memo_shell_content->priv->memo_table); + return E_PREVIEW_PANE (memo_shell_content->priv->preview_pane); } gboolean -- cgit