diff options
author | Matthew Barnes <mbarnes@redhat.com> | 2009-09-13 11:35:45 +0800 |
---|---|---|
committer | Matthew Barnes <mbarnes@redhat.com> | 2009-09-13 11:35:45 +0800 |
commit | e841a0b22395bae0097f89a208c8b5309f77166b (patch) | |
tree | 7d29aee2c1fd0b1addbacd3517dc47cc5b99bb9b /modules | |
parent | 43594a8b6eeeb072a672041cd72b2b211dd56958 (diff) | |
download | gsoc2013-evolution-e841a0b22395bae0097f89a208c8b5309f77166b.tar.gz gsoc2013-evolution-e841a0b22395bae0097f89a208c8b5309f77166b.tar.zst gsoc2013-evolution-e841a0b22395bae0097f89a208c8b5309f77166b.zip |
Bug 594863 - Message body doesn't allow right click pop up menu
Diffstat (limited to 'modules')
-rw-r--r-- | modules/mail/e-mail-shell-content.c | 20 | ||||
-rw-r--r-- | modules/mail/e-mail-shell-view-private.c | 45 |
2 files changed, 60 insertions, 5 deletions
diff --git a/modules/mail/e-mail-shell-content.c b/modules/mail/e-mail-shell-content.c index 60ddde7727..10c714a176 100644 --- a/modules/mail/e-mail-shell-content.c +++ b/modules/mail/e-mail-shell-content.c @@ -588,6 +588,25 @@ mail_shell_content_get_message_list (EMailReader *reader) return MESSAGE_LIST (priv->message_list); } +static GtkMenu * +mail_shell_content_get_popup_menu (EMailReader *reader) +{ + EShellView *shell_view; + EShellWindow *shell_window; + EShellContent *shell_content; + GtkUIManager *ui_manager; + GtkWidget *widget; + + shell_content = E_SHELL_CONTENT (reader); + shell_view = e_shell_content_get_shell_view (shell_content); + shell_window = e_shell_view_get_shell_window (shell_view); + + ui_manager = e_shell_window_get_ui_manager (shell_window); + widget = gtk_ui_manager_get_widget (ui_manager, "/mail-preview-popup"); + + return GTK_MENU (widget); +} + static EShellBackend * mail_shell_content_get_shell_backend (EMailReader *reader) { @@ -720,6 +739,7 @@ mail_shell_content_reader_init (EMailReaderIface *iface) iface->get_hide_deleted = mail_shell_content_get_hide_deleted; iface->get_html_display = mail_shell_content_get_html_display; iface->get_message_list = mail_shell_content_get_message_list; + iface->get_popup_menu = mail_shell_content_get_popup_menu; iface->get_shell_backend = mail_shell_content_get_shell_backend; iface->get_window = mail_shell_content_get_window; iface->set_folder = mail_shell_content_set_folder; diff --git a/modules/mail/e-mail-shell-view-private.c b/modules/mail/e-mail-shell-view-private.c index 7f48329136..db0d3e39e4 100644 --- a/modules/mail/e-mail-shell-view-private.c +++ b/modules/mail/e-mail-shell-view-private.c @@ -162,6 +162,36 @@ mail_shell_view_message_list_right_click_cb (EShellView *shell_view, return TRUE; } +static gboolean +mail_shell_view_popup_event_cb (EMailShellView *mail_shell_view, + GdkEventButton *event, + const gchar *uri) +{ + EShellView *shell_view; + EMailReader *reader; + GtkMenu *menu; + + if (uri != NULL) + return FALSE; + + shell_view = E_SHELL_VIEW (mail_shell_view); + reader = E_MAIL_READER (mail_shell_view->priv->mail_shell_content); + menu = e_mail_reader_get_popup_menu (reader); + + e_shell_view_update_actions (shell_view); + + if (event == NULL) + gtk_menu_popup ( + menu, NULL, NULL, NULL, NULL, + 0, gtk_get_current_event_time ()); + else + gtk_menu_popup ( + menu, NULL, NULL, NULL, NULL, + event->button, event->time); + + return TRUE; +} + static void mail_shell_view_reader_changed_cb (EMailShellView *mail_shell_view, EMailReader *reader) @@ -318,7 +348,7 @@ e_mail_shell_view_private_constructed (EMailShellView *mail_shell_view) GtkUIManager *ui_manager; MessageList *message_list; EMailReader *reader; - GtkHTML *html; + EWebView *web_view; const gchar *source; guint merge_id; gint ii = 0; @@ -356,7 +386,7 @@ e_mail_shell_view_private_constructed (EMailShellView *mail_shell_view) folder_tree = e_mail_shell_sidebar_get_folder_tree (mail_shell_sidebar); selection = gtk_tree_view_get_selection (GTK_TREE_VIEW (folder_tree)); - html = EM_FORMAT_HTML (html_display)->html; + web_view = E_WEB_VIEW (EM_FORMAT_HTML (html_display)->html); g_signal_connect_swapped ( folder_tree, "folder-selected", @@ -415,18 +445,23 @@ e_mail_shell_view_private_constructed (EMailShellView *mail_shell_view) mail_shell_view); g_signal_connect_swapped ( - html, "key-press-event", + web_view, "key-press-event", G_CALLBACK (mail_shell_view_key_press_event_cb), mail_shell_view); + g_signal_connect_swapped ( + web_view, "popup-event", + G_CALLBACK (mail_shell_view_popup_event_cb), + mail_shell_view); + g_signal_connect_data ( - html, "scroll", + web_view, "scroll", G_CALLBACK (mail_shell_view_scroll_cb), mail_shell_view, (GClosureNotify) NULL, G_CONNECT_AFTER | G_CONNECT_SWAPPED); g_signal_connect_swapped ( - html, "status-message", + web_view, "status-message", G_CALLBACK (mail_shell_view_reader_status_message_cb), mail_shell_view); |