aboutsummaryrefslogtreecommitdiffstats
path: root/modules/addressbook
diff options
context:
space:
mode:
authorMatthew Barnes <mbarnes@redhat.com>2010-01-18 06:47:08 +0800
committerMatthew Barnes <mbarnes@redhat.com>2010-01-18 12:54:06 +0800
commit39ee1b7890e06779b47f0fc11925d12caa206c39 (patch)
tree563aeba407e45e91cb9986caa159d11dca7e4823 /modules/addressbook
parent3e7c7808cc65c22bc40a7d1d30ffa0044097a6ff (diff)
downloadgsoc2013-evolution-39ee1b7890e06779b47f0fc11925d12caa206c39.tar
gsoc2013-evolution-39ee1b7890e06779b47f0fc11925d12caa206c39.tar.gz
gsoc2013-evolution-39ee1b7890e06779b47f0fc11925d12caa206c39.tar.bz2
gsoc2013-evolution-39ee1b7890e06779b47f0fc11925d12caa206c39.tar.lz
gsoc2013-evolution-39ee1b7890e06779b47f0fc11925d12caa206c39.tar.xz
gsoc2013-evolution-39ee1b7890e06779b47f0fc11925d12caa206c39.tar.zst
gsoc2013-evolution-39ee1b7890e06779b47f0fc11925d12caa206c39.zip
Give all preview panes a search bar.
Use Shift+Ctrl+F as the accelerator for consistency with the mailer.
Diffstat (limited to 'modules/addressbook')
-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
5 files changed, 68 insertions, 43 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);