aboutsummaryrefslogtreecommitdiffstats
path: root/modules
diff options
context:
space:
mode:
Diffstat (limited to 'modules')
-rw-r--r--modules/addressbook/e-book-shell-content.c61
-rw-r--r--modules/addressbook/e-book-shell-content.h7
-rw-r--r--modules/addressbook/e-book-shell-view-actions.c37
-rw-r--r--modules/addressbook/e-book-shell-view-actions.h2
-rw-r--r--modules/addressbook/e-book-shell-view.c4
-rw-r--r--modules/calendar/e-memo-shell-content.c59
-rw-r--r--modules/calendar/e-memo-shell-content.h7
-rw-r--r--modules/calendar/e-memo-shell-view-actions.c37
-rw-r--r--modules/calendar/e-memo-shell-view-actions.h2
-rw-r--r--modules/calendar/e-memo-shell-view-private.c7
-rw-r--r--modules/calendar/e-memo-shell-view.c13
-rw-r--r--modules/calendar/e-task-shell-content.c59
-rw-r--r--modules/calendar/e-task-shell-content.h7
-rw-r--r--modules/calendar/e-task-shell-view-actions.c37
-rw-r--r--modules/calendar/e-task-shell-view-actions.h2
-rw-r--r--modules/calendar/e-task-shell-view-private.c7
-rw-r--r--modules/calendar/e-task-shell-view.c13
-rw-r--r--modules/mail/e-mail-shell-content.c45
18 files changed, 243 insertions, 163 deletions
diff --git a/modules/addressbook/e-book-shell-content.c b/modules/addressbook/e-book-shell-content.c
index a7a616fc18..55b833269e 100644
--- a/modules/addressbook/e-book-shell-content.c
+++ b/modules/addressbook/e-book-shell-content.c
@@ -28,6 +28,7 @@
#include "e-util/gconf-bridge.h"
#include "shell/e-shell-utils.h"
#include "widgets/misc/e-paned.h"
+#include "widgets/misc/e-preview-pane.h"
#include "e-book-shell-view.h"
#define E_BOOK_SHELL_CONTENT_GET_PRIVATE(obj) \
@@ -37,7 +38,7 @@
struct _EBookShellContentPrivate {
GtkWidget *paned;
GtkWidget *notebook;
- GtkWidget *preview;
+ GtkWidget *preview_pane;
GtkOrientation orientation;
@@ -171,9 +172,9 @@ book_shell_content_dispose (GObject *object)
priv->notebook = NULL;
}
- if (priv->preview != NULL) {
- g_object_unref (priv->preview);
- priv->preview = NULL;
+ if (priv->preview_pane != NULL) {
+ g_object_unref (priv->preview_pane);
+ priv->preview_pane = NULL;
}
/* Chain up to parent's dispose() method. */
@@ -221,32 +222,24 @@ book_shell_content_constructed (GObject *object)
priv->notebook = g_object_ref (widget);
gtk_widget_show (widget);
- 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 = eab_contact_display_new ();
eab_contact_display_set_mode (
EAB_CONTACT_DISPLAY (widget),
EAB_CONTACT_DISPLAY_RENDER_NORMAL);
e_shell_configure_web_view (shell, E_WEB_VIEW (widget));
- gtk_container_add (GTK_CONTAINER (container), widget);
- priv->preview = g_object_ref (widget);
gtk_widget_show (widget);
g_signal_connect_swapped (
widget, "send-message",
G_CALLBACK (book_shell_content_send_message_cb), object);
+ 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");
+
/* Bind GObject properties to GConf keys. */
bridge = gconf_bridge_get ();
@@ -569,24 +562,19 @@ e_book_shell_content_set_current_view (EBookShellContent *book_shell_content,
g_object_notify (G_OBJECT (book_shell_content), "current-view");
}
-EABContactDisplay *
-e_book_shell_content_get_preview (EBookShellContent *book_shell_content)
-{
- g_return_val_if_fail (
- E_IS_BOOK_SHELL_CONTENT (book_shell_content), NULL);
-
- return EAB_CONTACT_DISPLAY (book_shell_content->priv->preview);
-}
-
EContact *
e_book_shell_content_get_preview_contact (EBookShellContent *book_shell_content)
{
+ EPreviewPane *preview_pane;
EABContactDisplay *display;
+ EWebView *web_view;
g_return_val_if_fail (
E_IS_BOOK_SHELL_CONTENT (book_shell_content), NULL);
- display = EAB_CONTACT_DISPLAY (book_shell_content->priv->preview);
+ preview_pane = E_PREVIEW_PANE (book_shell_content->priv->preview_pane);
+ web_view = e_preview_pane_get_web_view (preview_pane);
+ display = EAB_CONTACT_DISPLAY (web_view);
return eab_contact_display_get_contact (display);
}
@@ -595,16 +583,29 @@ void
e_book_shell_content_set_preview_contact (EBookShellContent *book_shell_content,
EContact *preview_contact)
{
+ EPreviewPane *preview_pane;
EABContactDisplay *display;
+ EWebView *web_view;
g_return_if_fail (E_IS_BOOK_SHELL_CONTENT (book_shell_content));
- display = EAB_CONTACT_DISPLAY (book_shell_content->priv->preview);
+ preview_pane = E_PREVIEW_PANE (book_shell_content->priv->preview_pane);
+ web_view = e_preview_pane_get_web_view (preview_pane);
+ display = EAB_CONTACT_DISPLAY (web_view);
eab_contact_display_set_contact (display, preview_contact);
g_object_notify (G_OBJECT (book_shell_content), "preview-contact");
}
+EPreviewPane *
+e_book_shell_content_get_preview_pane (EBookShellContent *book_shell_content)
+{
+ g_return_val_if_fail (
+ E_IS_BOOK_SHELL_CONTENT (book_shell_content), NULL);
+
+ return E_PREVIEW_PANE (book_shell_content->priv->preview_pane);
+}
+
gboolean
e_book_shell_content_get_preview_visible (EBookShellContent *book_shell_content)
{
diff --git a/modules/addressbook/e-book-shell-content.h b/modules/addressbook/e-book-shell-content.h
index 6ed5b38a62..595e366736 100644
--- a/modules/addressbook/e-book-shell-content.h
+++ b/modules/addressbook/e-book-shell-content.h
@@ -28,6 +28,8 @@
#include <shell/e-shell-searchbar.h>
#include <shell/e-shell-view.h>
+#include <misc/e-preview-pane.h>
+
#include "addressbook/gui/widgets/e-addressbook-view.h"
#include "eab-composer-util.h"
@@ -90,14 +92,13 @@ EAddressbookView *
void e_book_shell_content_set_current_view
(EBookShellContent *book_shell_content,
EAddressbookView *addressbook_view);
-EABContactDisplay *
- e_book_shell_content_get_preview
- (EBookShellContent *book_shell_content);
EContact * e_book_shell_content_get_preview_contact
(EBookShellContent *book_shell_content);
void e_book_shell_content_set_preview_contact
(EBookShellContent *book_shell_content,
EContact *preview_contact);
+EPreviewPane * e_book_shell_content_get_preview_pane
+ (EBookShellContent *book_shell_content);
gboolean e_book_shell_content_get_preview_visible
(EBookShellContent *book_shell_content);
void e_book_shell_content_set_preview_visible
diff --git a/modules/addressbook/e-book-shell-view-actions.c b/modules/addressbook/e-book-shell-view-actions.c
index e791f8e08d..32b227c723 100644
--- a/modules/addressbook/e-book-shell-view-actions.c
+++ b/modules/addressbook/e-book-shell-view-actions.c
@@ -341,6 +341,19 @@ action_contact_delete_cb (GtkAction *action,
}
static void
+action_contact_find_cb (GtkAction *action,
+ EBookShellView *book_shell_view)
+{
+ EBookShellContent *book_shell_content;
+ EPreviewPane *preview_pane;
+
+ book_shell_content = book_shell_view->priv->book_shell_content;
+ preview_pane = e_book_shell_content_get_preview_pane (book_shell_content);
+
+ e_preview_pane_show_search_bar (preview_pane);
+}
+
+static void
action_contact_forward_cb (GtkAction *action,
EBookShellView *book_shell_view)
{
@@ -722,6 +735,13 @@ static GtkActionEntry contact_entries[] = {
N_("Delete selected contacts"),
G_CALLBACK (action_contact_delete_cb) },
+ { "contact-find",
+ GTK_STOCK_FIND,
+ N_("_Find in Contact..."),
+ "<Shift><Control>f",
+ N_("Search for text in the displayed contact"),
+ G_CALLBACK (action_contact_find_cb) },
+
{ "contact-forward",
"mail-forward",
N_("_Forward Contact..."),
@@ -961,7 +981,8 @@ e_book_shell_view_actions_init (EBookShellView *book_shell_view)
EShellView *shell_view;
EShellWindow *shell_window;
EShellSearchbar *searchbar;
- EABContactDisplay *contact_preview;
+ EPreviewPane *preview_pane;
+ EWebView *web_view;
GtkActionGroup *action_group;
GConfBridge *bridge;
GtkAction *action;
@@ -973,7 +994,8 @@ e_book_shell_view_actions_init (EBookShellView *book_shell_view)
book_shell_content = book_shell_view->priv->book_shell_content;
searchbar = e_book_shell_content_get_searchbar (book_shell_content);
- contact_preview = e_book_shell_content_get_preview (book_shell_content);
+ preview_pane = e_book_shell_content_get_preview_pane (book_shell_content);
+ web_view = e_preview_pane_get_web_view (preview_pane);
/* Contact Actions */
action_group = ACTION_GROUP (CONTACTS);
@@ -1050,14 +1072,9 @@ e_book_shell_view_actions_init (EBookShellView *book_shell_view)
ACTION (CONTACT_PREVIEW), "active",
ACTION (CONTACT_VIEW_VERTICAL), "sensitive");
- e_web_view_set_open_proxy (
- E_WEB_VIEW (contact_preview), ACTION (CONTACT_OPEN));
-
- e_web_view_set_print_proxy (
- E_WEB_VIEW (contact_preview), ACTION (CONTACT_PRINT));
-
- e_web_view_set_save_as_proxy (
- E_WEB_VIEW (contact_preview), ACTION (CONTACT_SAVE_AS));
+ e_web_view_set_open_proxy (web_view, ACTION (CONTACT_OPEN));
+ e_web_view_set_print_proxy (web_view, ACTION (CONTACT_PRINT));
+ e_web_view_set_save_as_proxy (web_view, ACTION (CONTACT_SAVE_AS));
}
void
diff --git a/modules/addressbook/e-book-shell-view-actions.h b/modules/addressbook/e-book-shell-view-actions.h
index 250ec5fa99..ef40dd169f 100644
--- a/modules/addressbook/e-book-shell-view-actions.h
+++ b/modules/addressbook/e-book-shell-view-actions.h
@@ -49,6 +49,8 @@
E_SHELL_WINDOW_ACTION ((window), "contact-copy")
#define E_SHELL_WINDOW_ACTION_CONTACT_DELETE(window) \
E_SHELL_WINDOW_ACTION ((window), "contact-delete")
+#define E_SHELL_WINDOW_ACTION_CONTACT_FIND(window) \
+ E_SHELL_WINDOW_ACTION ((window), "contact-find")
#define E_SHELL_WINDOW_ACTION_CONTACT_FORWARD(window) \
E_SHELL_WINDOW_ACTION ((window), "contact-forward")
#define E_SHELL_WINDOW_ACTION_CONTACT_MOVE(window) \
diff --git a/modules/addressbook/e-book-shell-view.c b/modules/addressbook/e-book-shell-view.c
index 555ab13abf..3ecea2c49f 100644
--- a/modules/addressbook/e-book-shell-view.c
+++ b/modules/addressbook/e-book-shell-view.c
@@ -327,6 +327,10 @@ book_shell_view_update_actions (EShellView *shell_view)
sensitive = source_is_editable && any_contacts_selected;
gtk_action_set_sensitive (action, sensitive);
+ action = ACTION (CONTACT_FIND);
+ sensitive = single_contact_selected;
+ gtk_action_set_sensitive (action, sensitive);
+
action = ACTION (CONTACT_FORWARD);
sensitive = any_contacts_selected;
gtk_action_set_sensitive (action, sensitive);
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
diff --git a/modules/calendar/e-memo-shell-content.h b/modules/calendar/e-memo-shell-content.h
index 16aae229b2..4567a94aa9 100644
--- a/modules/calendar/e-memo-shell-content.h
+++ b/modules/calendar/e-memo-shell-content.h
@@ -27,9 +27,9 @@
#include <shell/e-shell-view.h>
#include <calendar/gui/e-memo-table.h>
-#include <calendar/gui/e-cal-component-preview.h>
#include <menus/gal-view-instance.h>
+#include <misc/e-preview-pane.h>
/* Standard GObject macros */
#define E_TYPE_MEMO_SHELL_CONTENT \
@@ -78,11 +78,10 @@ void e_memo_shell_content_register_type
GtkWidget * e_memo_shell_content_new(EShellView *shell_view);
ECalModel * e_memo_shell_content_get_memo_model
(EMemoShellContent *memo_shell_conent);
-ECalComponentPreview *
- e_memo_shell_content_get_memo_preview
- (EMemoShellContent *memo_shell_content);
EMemoTable * e_memo_shell_content_get_memo_table
(EMemoShellContent *memo_shell_content);
+EPreviewPane * e_memo_shell_content_get_preview_pane
+ (EMemoShellContent *memo_shell_content);
gboolean e_memo_shell_content_get_preview_visible
(EMemoShellContent *memo_shell_content);
void e_memo_shell_content_set_preview_visible
diff --git a/modules/calendar/e-memo-shell-view-actions.c b/modules/calendar/e-memo-shell-view-actions.c
index 1c0a7ef9ef..24aced8528 100644
--- a/modules/calendar/e-memo-shell-view-actions.c
+++ b/modules/calendar/e-memo-shell-view-actions.c
@@ -56,6 +56,19 @@ action_memo_delete_cb (GtkAction *action,
}
static void
+action_memo_find_cb (GtkAction *action,
+ EMemoShellView *memo_shell_view)
+{
+ EMemoShellContent *memo_shell_content;
+ EPreviewPane *preview_pane;
+
+ memo_shell_content = memo_shell_view->priv->memo_shell_content;
+ preview_pane = e_memo_shell_content_get_preview_pane (memo_shell_content);
+
+ e_preview_pane_show_search_bar (preview_pane);
+}
+
+static void
action_memo_forward_cb (GtkAction *action,
EMemoShellView *memo_shell_view)
{
@@ -564,6 +577,13 @@ static GtkActionEntry memo_entries[] = {
N_("Delete selected memos"),
G_CALLBACK (action_memo_delete_cb) },
+ { "memo-find",
+ GTK_STOCK_FIND,
+ N_("_Find in Memo..."),
+ "<Shift><Control>f",
+ N_("Search for text in the displayed memo"),
+ G_CALLBACK (action_memo_find_cb) },
+
{ "memo-forward",
"mail-forward",
N_("_Forward as iCalendar..."),
@@ -831,7 +851,8 @@ e_memo_shell_view_actions_init (EMemoShellView *memo_shell_view)
EShellView *shell_view;
EShellWindow *shell_window;
EShellSearchbar *searchbar;
- ECalComponentPreview *memo_preview;
+ EPreviewPane *preview_pane;
+ EWebView *web_view;
GtkActionGroup *action_group;
GConfBridge *bridge;
GtkAction *action;
@@ -843,7 +864,8 @@ e_memo_shell_view_actions_init (EMemoShellView *memo_shell_view)
memo_shell_content = memo_shell_view->priv->memo_shell_content;
searchbar = e_memo_shell_content_get_searchbar (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 Actions */
action_group = ACTION_GROUP (MEMOS);
@@ -920,14 +942,9 @@ e_memo_shell_view_actions_init (EMemoShellView *memo_shell_view)
ACTION (MEMO_PREVIEW), "active",
ACTION (MEMO_VIEW_VERTICAL), "sensitive");
- e_web_view_set_open_proxy (
- E_WEB_VIEW (memo_preview), ACTION (MEMO_OPEN));
-
- e_web_view_set_print_proxy (
- E_WEB_VIEW (memo_preview), ACTION (MEMO_PRINT));
-
- e_web_view_set_save_as_proxy (
- E_WEB_VIEW (memo_preview), ACTION (MEMO_SAVE_AS));
+ e_web_view_set_open_proxy (web_view, ACTION (MEMO_OPEN));
+ e_web_view_set_print_proxy (web_view, ACTION (MEMO_PRINT));
+ e_web_view_set_save_as_proxy (web_view, ACTION (MEMO_SAVE_AS));
}
void
diff --git a/modules/calendar/e-memo-shell-view-actions.h b/modules/calendar/e-memo-shell-view-actions.h
index 5b49ca06b1..c9d144b5d4 100644
--- a/modules/calendar/e-memo-shell-view-actions.h
+++ b/modules/calendar/e-memo-shell-view-actions.h
@@ -27,6 +27,8 @@
/* Memo Actions */
#define E_SHELL_WINDOW_ACTION_MEMO_DELETE(window) \
E_SHELL_WINDOW_ACTION ((window), "memo-delete")
+#define E_SHELL_WINDOW_ACTION_MEMO_FIND(window) \
+ E_SHELL_WINDOW_ACTION ((window), "memo-find")
#define E_SHELL_WINDOW_ACTION_MEMO_FORWARD(window) \
E_SHELL_WINDOW_ACTION ((window), "memo-forward")
#define E_SHELL_WINDOW_ACTION_MEMO_NEW(window) \
diff --git a/modules/calendar/e-memo-shell-view-private.c b/modules/calendar/e-memo-shell-view-private.c
index 583af2af17..9e2be0fe7d 100644
--- a/modules/calendar/e-memo-shell-view-private.c
+++ b/modules/calendar/e-memo-shell-view-private.c
@@ -430,18 +430,23 @@ e_memo_shell_view_update_timezone (EMemoShellView *memo_shell_view)
EMemoShellContent *memo_shell_content;
EMemoShellSidebar *memo_shell_sidebar;
ECalComponentPreview *memo_preview;
+ EPreviewPane *preview_pane;
+ EWebView *web_view;
icaltimezone *timezone;
ECalModel *model;
GList *clients, *iter;
memo_shell_content = memo_shell_view->priv->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);
model = e_memo_shell_content_get_memo_model (memo_shell_content);
timezone = e_cal_model_get_timezone (model);
memo_shell_sidebar = memo_shell_view->priv->memo_shell_sidebar;
clients = e_memo_shell_sidebar_get_clients (memo_shell_sidebar);
+ web_view = e_preview_pane_get_web_view (preview_pane);
+ memo_preview = E_CAL_COMPONENT_PREVIEW (web_view);
+
for (iter = clients; iter != NULL; iter = iter->next) {
ECal *client = iter->data;
diff --git a/modules/calendar/e-memo-shell-view.c b/modules/calendar/e-memo-shell-view.c
index 07a58aa1c9..870d5aedc8 100644
--- a/modules/calendar/e-memo-shell-view.c
+++ b/modules/calendar/e-memo-shell-view.c
@@ -61,7 +61,9 @@ memo_shell_view_execute_search (EShellView *shell_view)
EActionComboBox *combo_box;
GtkRadioAction *action;
ECalComponentPreview *memo_preview;
+ EPreviewPane *preview_pane;
EMemoTable *memo_table;
+ EWebView *web_view;
ECalModel *model;
gchar *query;
gchar *temp;
@@ -155,8 +157,11 @@ memo_shell_view_execute_search (EShellView *shell_view)
e_cal_model_set_search_query (model, query);
g_free (query);
- 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);
e_cal_component_preview_clear (memo_preview);
}
@@ -220,6 +225,10 @@ memo_shell_view_update_actions (EShellView *shell_view)
label = _("Delete Memo");
g_object_set (action, "label", label, NULL);
+ action = ACTION (MEMO_FIND);
+ sensitive = single_memo_selected;
+ gtk_action_set_sensitive (action, sensitive);
+
action = ACTION (MEMO_FORWARD);
sensitive = single_memo_selected;
gtk_action_set_sensitive (action, sensitive);
diff --git a/modules/calendar/e-task-shell-content.c b/modules/calendar/e-task-shell-content.c
index 11bc28af62..fd76fe7513 100644
--- a/modules/calendar/e-task-shell-content.c
+++ b/modules/calendar/e-task-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-tasks.h"
#define E_TASK_SHELL_CONTENT_GET_PRIVATE(obj) \
@@ -50,7 +52,7 @@
struct _ETaskShellContentPrivate {
GtkWidget *paned;
GtkWidget *task_table;
- GtkWidget *task_preview;
+ GtkWidget *preview_pane;
ECalModel *task_model;
GalViewInstance *view_instance;
@@ -192,10 +194,15 @@ task_shell_content_cursor_change_cb (ETaskShellContent *task_shell_content,
ECalModel *task_model;
ECalModelComponent *comp_data;
ECalComponent *comp;
+ EPreviewPane *preview_pane;
+ EWebView *web_view;
const gchar *uid;
task_model = e_task_shell_content_get_task_model (task_shell_content);
- task_preview = e_task_shell_content_get_task_preview (task_shell_content);
+ preview_pane = e_task_shell_content_get_preview_pane (task_shell_content);
+
+ web_view = e_preview_pane_get_web_view (preview_pane);
+ task_preview = E_CAL_COMPONENT_PREVIEW (web_view);
if (e_table_selected_count (table) != 1) {
e_cal_component_preview_clear (task_preview);
@@ -223,8 +230,13 @@ task_shell_content_selection_change_cb (ETaskShellContent *task_shell_content,
ETable *table)
{
ECalComponentPreview *task_preview;
+ EPreviewPane *preview_pane;
+ EWebView *web_view;
+
+ preview_pane = e_task_shell_content_get_preview_pane (task_shell_content);
- task_preview = e_task_shell_content_get_task_preview (task_shell_content);
+ web_view = e_preview_pane_get_web_view (preview_pane);
+ task_preview = E_CAL_COMPONENT_PREVIEW (web_view);
if (e_table_selected_count (table) != 1)
e_cal_component_preview_clear (task_preview);
@@ -345,9 +357,9 @@ task_shell_content_dispose (GObject *object)
priv->task_table = NULL;
}
- if (priv->task_preview != NULL) {
- g_object_unref (priv->task_preview);
- priv->task_preview = NULL;
+ if (priv->preview_pane != NULL) {
+ g_object_unref (priv->preview_pane);
+ priv->preview_pane = NULL;
}
if (priv->task_model != NULL) {
@@ -442,25 +454,10 @@ task_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->task_preview = g_object_ref (widget);
gtk_widget_show (widget);
g_signal_connect_swapped (
@@ -468,6 +465,13 @@ task_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 task table. */
e_table_set_state (
@@ -703,23 +707,22 @@ e_task_shell_content_get_task_model (ETaskShellContent *task_shell_content)
return task_shell_content->priv->task_model;
}
-ECalComponentPreview *
-e_task_shell_content_get_task_preview (ETaskShellContent *task_shell_content)
+ETaskTable *
+e_task_shell_content_get_task_table (ETaskShellContent *task_shell_content)
{
g_return_val_if_fail (
E_IS_TASK_SHELL_CONTENT (task_shell_content), NULL);
- return E_CAL_COMPONENT_PREVIEW (
- task_shell_content->priv->task_preview);
+ return E_TASK_TABLE (task_shell_content->priv->task_table);
}
-ETaskTable *
-e_task_shell_content_get_task_table (ETaskShellContent *task_shell_content)
+EPreviewPane *
+e_task_shell_content_get_preview_pane (ETaskShellContent *task_shell_content)
{
g_return_val_if_fail (
E_IS_TASK_SHELL_CONTENT (task_shell_content), NULL);
- return E_TASK_TABLE (task_shell_content->priv->task_table);
+ return E_PREVIEW_PANE (task_shell_content->priv->preview_pane);
}
gboolean
diff --git a/modules/calendar/e-task-shell-content.h b/modules/calendar/e-task-shell-content.h
index dd39f8c6ce..d4e67d1b95 100644
--- a/modules/calendar/e-task-shell-content.h
+++ b/modules/calendar/e-task-shell-content.h
@@ -27,10 +27,10 @@
#include <shell/e-shell-view.h>
#include <calendar/gui/e-cal-model.h>
-#include <calendar/gui/e-cal-component-preview.h>
#include <calendar/gui/e-task-table.h>
#include <menus/gal-view-instance.h>
+#include <misc/e-preview-pane.h>
/* Standard GObject macros */
#define E_TYPE_TASK_SHELL_CONTENT \
@@ -82,11 +82,10 @@ void e_task_shell_content_register_type
GtkWidget * e_task_shell_content_new(EShellView *shell_view);
ECalModel * e_task_shell_content_get_task_model
(ETaskShellContent *task_shell_content);
-ECalComponentPreview *
- e_task_shell_content_get_task_preview
- (ETaskShellContent *task_shell_content);
ETaskTable * e_task_shell_content_get_task_table
(ETaskShellContent *task_shell_content);
+EPreviewPane * e_task_shell_content_get_preview_pane
+ (ETaskShellContent *task_shell_content);
gboolean e_task_shell_content_get_preview_visible
(ETaskShellContent *task_shell_content);
void e_task_shell_content_set_preview_visible
diff --git a/modules/calendar/e-task-shell-view-actions.c b/modules/calendar/e-task-shell-view-actions.c
index bd3d0627ff..c18882dd2b 100644
--- a/modules/calendar/e-task-shell-view-actions.c
+++ b/modules/calendar/e-task-shell-view-actions.c
@@ -87,6 +87,19 @@ action_task_delete_cb (GtkAction *action,
}
static void
+action_task_find_cb (GtkAction *action,
+ ETaskShellView *task_shell_view)
+{
+ ETaskShellContent *task_shell_content;
+ EPreviewPane *preview_pane;
+
+ task_shell_content = task_shell_view->priv->task_shell_content;
+ preview_pane = e_task_shell_content_get_preview_pane (task_shell_content);
+
+ e_preview_pane_show_search_bar (preview_pane);
+}
+
+static void
action_task_forward_cb (GtkAction *action,
ETaskShellView *task_shell_view)
{
@@ -688,6 +701,13 @@ static GtkActionEntry task_entries[] = {
N_("Delete selected tasks"),
G_CALLBACK (action_task_delete_cb) },
+ { "task-find",
+ GTK_STOCK_FIND,
+ N_("_Find in Task..."),
+ "<Shift><Control>f",
+ N_("Search for text in the displayed task"),
+ G_CALLBACK (action_task_find_cb) },
+
{ "task-forward",
"mail-forward",
N_("_Forward as iCalendar..."),
@@ -1030,7 +1050,8 @@ e_task_shell_view_actions_init (ETaskShellView *task_shell_view)
EShellView *shell_view;
EShellWindow *shell_window;
EShellSearchbar *searchbar;
- ECalComponentPreview *task_preview;
+ EPreviewPane *preview_pane;
+ EWebView *web_view;
GtkActionGroup *action_group;
GConfBridge *bridge;
GtkAction *action;
@@ -1042,7 +1063,8 @@ e_task_shell_view_actions_init (ETaskShellView *task_shell_view)
task_shell_content = task_shell_view->priv->task_shell_content;
searchbar = e_task_shell_content_get_searchbar (task_shell_content);
- task_preview = e_task_shell_content_get_task_preview (task_shell_content);
+ preview_pane = e_task_shell_content_get_preview_pane (task_shell_content);
+ web_view = e_preview_pane_get_web_view (preview_pane);
/* Task Actions */
action_group = ACTION_GROUP (TASKS);
@@ -1119,14 +1141,9 @@ e_task_shell_view_actions_init (ETaskShellView *task_shell_view)
ACTION (TASK_PREVIEW), "active",
ACTION (TASK_VIEW_VERTICAL), "sensitive");
- e_web_view_set_open_proxy (
- E_WEB_VIEW (task_preview), ACTION (TASK_OPEN));
-
- e_web_view_set_print_proxy (
- E_WEB_VIEW (task_preview), ACTION (TASK_PRINT));
-
- e_web_view_set_save_as_proxy (
- E_WEB_VIEW (task_preview), ACTION (TASK_SAVE_AS));
+ e_web_view_set_open_proxy (web_view, ACTION (TASK_OPEN));
+ e_web_view_set_print_proxy (web_view, ACTION (TASK_PRINT));
+ e_web_view_set_save_as_proxy (web_view, ACTION (TASK_SAVE_AS));
}
void
diff --git a/modules/calendar/e-task-shell-view-actions.h b/modules/calendar/e-task-shell-view-actions.h
index f323fb38f9..afa9fe3e1b 100644
--- a/modules/calendar/e-task-shell-view-actions.h
+++ b/modules/calendar/e-task-shell-view-actions.h
@@ -29,6 +29,8 @@
E_SHELL_WINDOW_ACTION ((window), "task-assign")
#define E_SHELL_WINDOW_ACTION_TASK_DELETE(window) \
E_SHELL_WINDOW_ACTION ((window), "task-delete")
+#define E_SHELL_WINDOW_ACTION_TASK_FIND(window) \
+ E_SHELL_WINDOW_ACTION ((window), "task-find")
#define E_SHELL_WINDOW_ACTION_TASK_FORWARD(window) \
E_SHELL_WINDOW_ACTION ((window), "task-forward")
#define E_SHELL_WINDOW_ACTION_TASK_MARK_COMPLETE(window) \
diff --git a/modules/calendar/e-task-shell-view-private.c b/modules/calendar/e-task-shell-view-private.c
index 6704a3b4c0..4b04185d0d 100644
--- a/modules/calendar/e-task-shell-view-private.c
+++ b/modules/calendar/e-task-shell-view-private.c
@@ -580,18 +580,23 @@ e_task_shell_view_update_timezone (ETaskShellView *task_shell_view)
ETaskShellContent *task_shell_content;
ETaskShellSidebar *task_shell_sidebar;
ECalComponentPreview *task_preview;
+ EPreviewPane *preview_pane;
+ EWebView *web_view;
icaltimezone *timezone;
ECalModel *model;
GList *clients, *iter;
task_shell_content = task_shell_view->priv->task_shell_content;
- task_preview = e_task_shell_content_get_task_preview (task_shell_content);
+ preview_pane = e_task_shell_content_get_preview_pane (task_shell_content);
model = e_task_shell_content_get_task_model (task_shell_content);
timezone = e_cal_model_get_timezone (model);
task_shell_sidebar = task_shell_view->priv->task_shell_sidebar;
clients = e_task_shell_sidebar_get_clients (task_shell_sidebar);
+ web_view = e_preview_pane_get_web_view (preview_pane);
+ task_preview = E_CAL_COMPONENT_PREVIEW (web_view);
+
for (iter = clients; iter != NULL; iter = iter->next) {
ECal *client = iter->data;
diff --git a/modules/calendar/e-task-shell-view.c b/modules/calendar/e-task-shell-view.c
index 36b9db5b56..b2146f5e59 100644
--- a/modules/calendar/e-task-shell-view.c
+++ b/modules/calendar/e-task-shell-view.c
@@ -100,7 +100,9 @@ task_shell_view_execute_search (EShellView *shell_view)
EActionComboBox *combo_box;
GtkRadioAction *action;
ECalComponentPreview *task_preview;
+ EPreviewPane *preview_pane;
ETaskTable *task_table;
+ EWebView *web_view;
ECalModel *model;
time_t start_range;
time_t end_range;
@@ -268,8 +270,11 @@ task_shell_view_execute_search (EShellView *shell_view)
e_cal_model_set_search_query (model, query);
g_free (query);
- task_preview =
- e_task_shell_content_get_task_preview (task_shell_content);
+ preview_pane =
+ e_task_shell_content_get_preview_pane (task_shell_content);
+
+ web_view = e_preview_pane_get_web_view (preview_pane);
+ task_preview = E_CAL_COMPONENT_PREVIEW (web_view);
e_cal_component_preview_clear (task_preview);
}
@@ -348,6 +353,10 @@ task_shell_view_update_actions (EShellView *shell_view)
label = _("Delete Task");
g_object_set (action, "label", label, NULL);
+ action = ACTION (TASK_FIND);
+ sensitive = single_task_selected;
+ gtk_action_set_sensitive (action, sensitive);
+
action = ACTION (TASK_FORWARD);
sensitive = single_task_selected;
gtk_action_set_sensitive (action, sensitive);
diff --git a/modules/mail/e-mail-shell-content.c b/modules/mail/e-mail-shell-content.c
index 5ba85b27b7..423f3ec0c2 100644
--- a/modules/mail/e-mail-shell-content.c
+++ b/modules/mail/e-mail-shell-content.c
@@ -30,6 +30,8 @@
#include "widgets/menus/gal-view-etable.h"
#include "widgets/menus/gal-view-instance.h"
#include "widgets/misc/e-paned.h"
+#include "widgets/misc/e-preview-pane.h"
+#include "widgets/misc/e-search-bar.h"
#include "em-utils.h"
#include "mail-config.h"
@@ -37,7 +39,6 @@
#include "message-list.h"
#include "e-mail-reader.h"
-#include "e-mail-search-bar.h"
#include "e-mail-shell-backend.h"
#include "e-mail-shell-view-actions.h"
@@ -361,6 +362,7 @@ mail_shell_content_constructed (GObject *object)
EShellContent *shell_content;
EShellBackend *shell_backend;
EShellView *shell_view;
+ ESearchBar *search_bar;
EMailReader *reader;
GtkWidget *message_list;
GConfBridge *bridge;
@@ -390,9 +392,7 @@ mail_shell_content_constructed (GObject *object)
priv->paned = g_object_ref (widget);
gtk_widget_show (widget);
- e_binding_new (
- object, "orientation",
- widget, "orientation");
+ e_binding_new (object, "orientation", widget, "orientation");
container = priv->paned;
@@ -415,34 +415,19 @@ mail_shell_content_constructed (GObject *object)
container = priv->paned;
- widget = gtk_vbox_new (FALSE, 1);
+ gtk_widget_show (GTK_WIDGET (web_view));
+
+ widget = e_preview_pane_new (web_view);
gtk_paned_pack2 (GTK_PANED (container), widget, FALSE, FALSE);
gtk_widget_show (widget);
- e_binding_new (
- object, "preview-visible",
- widget, "visible");
-
- container = widget;
-
- 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_container_add (GTK_CONTAINER (widget), GTK_WIDGET (web_view));
- gtk_box_pack_start (GTK_BOX (container), widget, TRUE, TRUE, 0);
- gtk_widget_show (GTK_WIDGET (web_view));
- gtk_widget_show (widget);
+ e_binding_new (object, "preview-visible", widget, "visible");
- widget = e_mail_search_bar_new (web_view);
- gtk_box_pack_start (GTK_BOX (container), widget, FALSE, FALSE, 0);
- priv->search_bar = g_object_ref (widget);
- gtk_widget_hide (widget);
+ search_bar = e_preview_pane_get_search_bar (E_PREVIEW_PANE (widget));
+ priv->search_bar = g_object_ref (search_bar);
g_signal_connect_swapped (
- widget, "changed",
+ search_bar, "changed",
G_CALLBACK (em_format_redraw), priv->html_display);
/* Load the view instance. */
@@ -928,13 +913,13 @@ void
e_mail_shell_content_set_search_strings (EMailShellContent *mail_shell_content,
GSList *search_strings)
{
- EMailSearchBar *search_bar;
+ ESearchBar *search_bar;
ESearchingTokenizer *tokenizer;
g_return_if_fail (E_IS_MAIL_SHELL_CONTENT (mail_shell_content));
- search_bar = E_MAIL_SEARCH_BAR (mail_shell_content->priv->search_bar);
- tokenizer = e_mail_search_bar_get_tokenizer (search_bar);
+ search_bar = E_SEARCH_BAR (mail_shell_content->priv->search_bar);
+ tokenizer = e_search_bar_get_tokenizer (search_bar);
e_searching_tokenizer_set_secondary_case_sensitivity (tokenizer, FALSE);
e_searching_tokenizer_set_secondary_search_string (tokenizer, NULL);
@@ -945,7 +930,7 @@ e_mail_shell_content_set_search_strings (EMailShellContent *mail_shell_content,
search_strings = g_slist_next (search_strings);
}
- e_mail_search_bar_changed (search_bar);
+ e_search_bar_changed (search_bar);
}
void