diff options
author | Matthew Barnes <mbarnes@redhat.com> | 2009-11-13 10:27:40 +0800 |
---|---|---|
committer | Matthew Barnes <mbarnes@redhat.com> | 2009-11-14 00:26:43 +0800 |
commit | c5e04ca04066ae2d92d3999626ef91d5d0606cab (patch) | |
tree | 4c4cc28faa947d29d9f6e575680549daf95ae753 /modules | |
parent | ba89f0b2c4993c562a1bdb0f5ce90b654c3b68b5 (diff) | |
download | gsoc2013-evolution-c5e04ca04066ae2d92d3999626ef91d5d0606cab.tar.gz gsoc2013-evolution-c5e04ca04066ae2d92d3999626ef91d5d0606cab.tar.zst gsoc2013-evolution-c5e04ca04066ae2d92d3999626ef91d5d0606cab.zip |
EWebView popup menu enhancements.
Bumps the GtkHtml dependency to 3.29.2 for gtk_html_unselect_all().
Diffstat (limited to 'modules')
-rw-r--r-- | modules/addressbook/e-book-shell-content.c | 30 | ||||
-rw-r--r-- | modules/addressbook/e-book-shell-content.h | 3 | ||||
-rw-r--r-- | modules/addressbook/e-book-shell-view-actions.c | 57 | ||||
-rw-r--r-- | modules/calendar/e-memo-shell-content.c | 10 | ||||
-rw-r--r-- | modules/calendar/e-memo-shell-view-actions.c | 57 | ||||
-rw-r--r-- | modules/calendar/e-task-shell-content.c | 10 | ||||
-rw-r--r-- | modules/calendar/e-task-shell-view-actions.c | 57 |
7 files changed, 166 insertions, 58 deletions
diff --git a/modules/addressbook/e-book-shell-content.c b/modules/addressbook/e-book-shell-content.c index 4eccc971df..1c121adc61 100644 --- a/modules/addressbook/e-book-shell-content.c +++ b/modules/addressbook/e-book-shell-content.c @@ -26,6 +26,7 @@ #include "e-util/e-binding.h" #include "e-util/e-selection.h" #include "e-util/gconf-bridge.h" +#include "shell/e-shell-utils.h" #include "widgets/misc/e-paned.h" #define E_BOOK_SHELL_CONTENT_GET_PRIVATE(obj) \ @@ -182,6 +183,10 @@ static void book_shell_content_constructed (GObject *object) { EBookShellContentPrivate *priv; + EShell *shell; + EShellView *shell_view; + EShellWindow *shell_window; + EShellContent *shell_content; GConfBridge *bridge; GtkWidget *container; GtkWidget *widget; @@ -192,6 +197,11 @@ book_shell_content_constructed (GObject *object) /* Chain up to parent's constructed() method. */ G_OBJECT_CLASS (parent_class)->constructed (object); + shell_content = E_SHELL_CONTENT (object); + shell_view = e_shell_content_get_shell_view (shell_content); + shell_window = e_shell_view_get_shell_window (shell_view); + shell = e_shell_window_get_shell (shell_window); + container = GTK_WIDGET (object); widget = e_paned_new (GTK_ORIENTATION_VERTICAL); @@ -199,9 +209,7 @@ book_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 = widget; @@ -221,9 +229,7 @@ book_shell_content_constructed (GObject *object) gtk_paned_pack2 (GTK_PANED (container), widget, FALSE, FALSE); gtk_widget_show (widget); - e_binding_new ( - object, "preview-visible", - widget, "visible"); + e_binding_new (object, "preview-visible", widget, "visible"); container = widget; @@ -231,12 +237,13 @@ book_shell_content_constructed (GObject *object) 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 ( - priv->preview, "send-message", + widget, "send-message", G_CALLBACK (book_shell_content_send_message_cb), object); /* Bind GObject properties to GConf keys. */ @@ -474,6 +481,15 @@ 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) { diff --git a/modules/addressbook/e-book-shell-content.h b/modules/addressbook/e-book-shell-content.h index 31f8c35838..138b60d175 100644 --- a/modules/addressbook/e-book-shell-content.h +++ b/modules/addressbook/e-book-shell-content.h @@ -93,6 +93,9 @@ 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 diff --git a/modules/addressbook/e-book-shell-view-actions.c b/modules/addressbook/e-book-shell-view-actions.c index 0ec4eac2e6..495aed6f1d 100644 --- a/modules/addressbook/e-book-shell-view-actions.c +++ b/modules/addressbook/e-book-shell-view-actions.c @@ -830,18 +830,11 @@ static GtkActionEntry contact_entries[] = { { "contact-open", NULL, - N_("_Open"), + N_("_Open Contact"), "<Control>o", N_("View the current contact"), G_CALLBACK (action_contact_open_cb) }, - { "contact-save-as", - GTK_STOCK_SAVE_AS, - N_("Save as vCard..."), - NULL, - N_("Save selected contacts as a vCard"), - G_CALLBACK (action_contact_save_as_cb) }, - { "contact-select-all", GTK_STOCK_SELECT_ALL, NULL, @@ -923,10 +916,6 @@ static EPopupActionEntry contact_popup_entries[] = { NULL, "contact-open" }, - { "contact-popup-save-as", - NULL, - "contact-save-as" }, - { "contact-popup-send-message", NULL, "contact-send-message" }, @@ -1035,11 +1024,30 @@ static EPopupActionEntry lockdown_printing_popup_entries[] = { "contact-print" } }; +static GtkActionEntry lockdown_save_to_disk_entries[] = { + + { "contact-save-as", + GTK_STOCK_SAVE_AS, + N_("Save as vCard..."), + NULL, + N_("Save selected contacts as a vCard"), + G_CALLBACK (action_contact_save_as_cb) } +}; + +static EPopupActionEntry lockdown_save_to_disk_popup_entries[] = { + + { "contact-popup-save-as", + NULL, + "contact-save-as" } +}; + void e_book_shell_view_actions_init (EBookShellView *book_shell_view) { EShellView *shell_view; EShellWindow *shell_window; + EBookShellContent *book_shell_content; + EABContactDisplay *contact_preview; GtkActionGroup *action_group; GConfBridge *bridge; GtkAction *action; @@ -1049,6 +1057,9 @@ e_book_shell_view_actions_init (EBookShellView *book_shell_view) shell_view = E_SHELL_VIEW (book_shell_view); shell_window = e_shell_view_get_shell_window (shell_view); + book_shell_content = book_shell_view->priv->book_shell_content; + contact_preview = e_book_shell_content_get_preview (book_shell_content); + /* Contact Actions */ action_group = ACTION_GROUP (CONTACTS); gtk_action_group_add_actions ( @@ -1074,11 +1085,22 @@ e_book_shell_view_actions_init (EBookShellView *book_shell_view) action_group = ACTION_GROUP (LOCKDOWN_PRINTING); gtk_action_group_add_actions ( action_group, lockdown_printing_entries, - G_N_ELEMENTS (lockdown_printing_entries), book_shell_view); + G_N_ELEMENTS (lockdown_printing_entries), + book_shell_view); e_action_group_add_popup_actions ( action_group, lockdown_printing_popup_entries, G_N_ELEMENTS (lockdown_printing_popup_entries)); + /* Lockdown Save-to-Disk Actions */ + action_group = ACTION_GROUP (LOCKDOWN_SAVE_TO_DISK); + gtk_action_group_add_actions ( + action_group, lockdown_save_to_disk_entries, + G_N_ELEMENTS (lockdown_save_to_disk_entries), + book_shell_view); + e_action_group_add_popup_actions ( + action_group, lockdown_save_to_disk_popup_entries, + G_N_ELEMENTS (lockdown_save_to_disk_popup_entries)); + /* Bind GObject properties to GConf keys. */ bridge = gconf_bridge_get (); @@ -1107,6 +1129,15 @@ e_book_shell_view_actions_init (EBookShellView *book_shell_view) e_binding_new ( 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)); } void diff --git a/modules/calendar/e-memo-shell-content.c b/modules/calendar/e-memo-shell-content.c index 0e8d73bbe5..b877efc546 100644 --- a/modules/calendar/e-memo-shell-content.c +++ b/modules/calendar/e-memo-shell-content.c @@ -25,6 +25,7 @@ #include "e-util/e-binding.h" #include "e-util/gconf-bridge.h" +#include "shell/e-shell-utils.h" #include "widgets/menus/gal-view-etable.h" #include "widgets/misc/e-paned.h" @@ -427,9 +428,7 @@ memo_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 = widget; @@ -447,15 +446,14 @@ memo_shell_content_constructed (GObject *object) gtk_paned_pack2 (GTK_PANED (container), widget, FALSE, FALSE); gtk_widget_show (widget); - e_binding_new ( - object, "preview-visible", - widget, "visible"); + 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); diff --git a/modules/calendar/e-memo-shell-view-actions.c b/modules/calendar/e-memo-shell-view-actions.c index 4ffaa519e7..80ebca237d 100644 --- a/modules/calendar/e-memo-shell-view-actions.c +++ b/modules/calendar/e-memo-shell-view-actions.c @@ -682,13 +682,6 @@ static GtkActionEntry memo_entries[] = { NULL, /* XXX Add a tooltip! */ G_CALLBACK (action_memo_open_url_cb) }, - { "memo-save-as", - GTK_STOCK_SAVE_AS, - N_("_Save as iCalendar..."), - NULL, - NULL, /* XXX Add a tooltip! */ - G_CALLBACK (action_memo_save_as_cb) }, - /*** Menus ***/ { "memo-preview-menu", @@ -747,11 +740,7 @@ static EPopupActionEntry memo_popup_entries[] = { { "memo-popup-open-url", NULL, - "memo-open-url" }, - - { "memo-popup-save-as", - NULL, - "memo-save-as" } + "memo-open-url" } }; static GtkToggleActionEntry memo_toggle_entries[] = { @@ -864,11 +853,30 @@ static EPopupActionEntry lockdown_printing_popup_entries[] = { "memo-print" } }; +static GtkActionEntry lockdown_save_to_disk_entries[] = { + + { "memo-save-as", + GTK_STOCK_SAVE_AS, + N_("_Save as iCalendar..."), + NULL, + NULL, /* XXX Add a tooltip! */ + G_CALLBACK (action_memo_save_as_cb) }, +}; + +static EPopupActionEntry lockdown_save_to_disk_popup_entries[] = { + + { "memo-popup-save-as", + NULL, + "memo-save-as" } +}; + void e_memo_shell_view_actions_init (EMemoShellView *memo_shell_view) { EShellView *shell_view; EShellWindow *shell_window; + EMemoShellContent *memo_shell_content; + ECalComponentPreview *memo_preview; GtkActionGroup *action_group; GConfBridge *bridge; GtkAction *action; @@ -878,6 +886,9 @@ e_memo_shell_view_actions_init (EMemoShellView *memo_shell_view) shell_view = E_SHELL_VIEW (memo_shell_view); shell_window = e_shell_view_get_shell_window (shell_view); + memo_shell_content = memo_shell_view->priv->memo_shell_content; + memo_preview = e_memo_shell_content_get_memo_preview (memo_shell_content); + /* Memo Actions */ action_group = ACTION_GROUP (MEMOS); gtk_action_group_add_actions ( @@ -903,11 +914,22 @@ e_memo_shell_view_actions_init (EMemoShellView *memo_shell_view) action_group = ACTION_GROUP (LOCKDOWN_PRINTING); gtk_action_group_add_actions ( action_group, lockdown_printing_entries, - G_N_ELEMENTS (lockdown_printing_entries), memo_shell_view); + G_N_ELEMENTS (lockdown_printing_entries), + memo_shell_view); e_action_group_add_popup_actions ( action_group, lockdown_printing_popup_entries, G_N_ELEMENTS (lockdown_printing_popup_entries)); + /* Lockdown Save-to-Disk Actions */ + action_group = ACTION_GROUP (LOCKDOWN_SAVE_TO_DISK); + gtk_action_group_add_actions ( + action_group, lockdown_save_to_disk_entries, + G_N_ELEMENTS (lockdown_save_to_disk_entries), + memo_shell_view); + e_action_group_add_popup_actions ( + action_group, lockdown_save_to_disk_popup_entries, + G_N_ELEMENTS (lockdown_save_to_disk_popup_entries)); + /* Bind GObject properties to GConf keys. */ bridge = gconf_bridge_get (); @@ -936,6 +958,15 @@ e_memo_shell_view_actions_init (EMemoShellView *memo_shell_view) e_binding_new ( 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)); } void diff --git a/modules/calendar/e-task-shell-content.c b/modules/calendar/e-task-shell-content.c index 8dea4b840b..9dfdd91e8e 100644 --- a/modules/calendar/e-task-shell-content.c +++ b/modules/calendar/e-task-shell-content.c @@ -25,6 +25,7 @@ #include "e-util/e-binding.h" #include "e-util/gconf-bridge.h" +#include "shell/e-shell-utils.h" #include "widgets/menus/gal-view-etable.h" #include "widgets/misc/e-paned.h" @@ -425,9 +426,7 @@ task_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 = widget; @@ -445,15 +444,14 @@ task_shell_content_constructed (GObject *object) gtk_paned_pack2 (GTK_PANED (container), widget, FALSE, FALSE); gtk_widget_show (widget); - e_binding_new ( - object, "preview-visible", - widget, "visible"); + 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); diff --git a/modules/calendar/e-task-shell-view-actions.c b/modules/calendar/e-task-shell-view-actions.c index 07558bfa90..e5063c1d85 100644 --- a/modules/calendar/e-task-shell-view-actions.c +++ b/modules/calendar/e-task-shell-view-actions.c @@ -829,13 +829,6 @@ static GtkActionEntry task_entries[] = { N_("Delete completed tasks"), G_CALLBACK (action_task_purge_cb) }, - { "task-save-as", - GTK_STOCK_SAVE_AS, - N_("_Save as iCalendar..."), - NULL, - NULL, /* XXX Add a tooltip! */ - G_CALLBACK (action_task_save_as_cb) }, - /*** Menus ***/ { "task-actions-menu", @@ -913,11 +906,7 @@ static EPopupActionEntry task_popup_entries[] = { { "task-popup-open-url", NULL, - "task-open-url" }, - - { "task-popup-save-as", - NULL, - "task-save-as" }, + "task-open-url" } }; static GtkToggleActionEntry task_toggle_entries[] = { @@ -1065,11 +1054,30 @@ static EPopupActionEntry lockdown_printing_popup_entries[] = { "task-print" } }; +static GtkActionEntry lockdown_save_to_disk_entries[] = { + + { "task-save-as", + GTK_STOCK_SAVE_AS, + N_("_Save as iCalendar..."), + NULL, + NULL, /* XXX Add a tooltip! */ + G_CALLBACK (action_task_save_as_cb) } +}; + +static EPopupActionEntry lockdown_save_to_disk_popup_entries[] = { + + { "task-popup-save-as", + NULL, + "task-save-as" }, +}; + void e_task_shell_view_actions_init (ETaskShellView *task_shell_view) { EShellView *shell_view; EShellWindow *shell_window; + ETaskShellContent *task_shell_content; + ECalComponentPreview *task_preview; GtkActionGroup *action_group; GConfBridge *bridge; GtkAction *action; @@ -1079,6 +1087,9 @@ e_task_shell_view_actions_init (ETaskShellView *task_shell_view) shell_view = E_SHELL_VIEW (task_shell_view); shell_window = e_shell_view_get_shell_window (shell_view); + task_shell_content = task_shell_view->priv->task_shell_content; + task_preview = e_task_shell_content_get_task_preview (task_shell_content); + /* Task Actions */ action_group = ACTION_GROUP (TASKS); gtk_action_group_add_actions ( @@ -1104,11 +1115,22 @@ e_task_shell_view_actions_init (ETaskShellView *task_shell_view) action_group = ACTION_GROUP (LOCKDOWN_PRINTING); gtk_action_group_add_actions ( action_group, lockdown_printing_entries, - G_N_ELEMENTS (lockdown_printing_entries), task_shell_view); + G_N_ELEMENTS (lockdown_printing_entries), + task_shell_view); e_action_group_add_popup_actions ( action_group, lockdown_printing_popup_entries, G_N_ELEMENTS (lockdown_printing_popup_entries)); + /* Lockdown Save-to-Disk Actions */ + action_group = ACTION_GROUP (LOCKDOWN_SAVE_TO_DISK); + gtk_action_group_add_actions ( + action_group, lockdown_save_to_disk_entries, + G_N_ELEMENTS (lockdown_save_to_disk_entries), + task_shell_view); + e_action_group_add_popup_actions ( + action_group, lockdown_save_to_disk_popup_entries, + G_N_ELEMENTS (lockdown_save_to_disk_popup_entries)); + /* Bind GObject properties to GConf keys. */ bridge = gconf_bridge_get (); @@ -1137,6 +1159,15 @@ e_task_shell_view_actions_init (ETaskShellView *task_shell_view) e_binding_new ( 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)); } void |