From cf9a0987d91a362480ba13fc6f901c27c8e40a08 Mon Sep 17 00:00:00 2001 From: Not Zed Date: Thu, 13 May 2004 06:57:22 +0000 Subject: re-enabled the reply to selection stuff. I worked out how to make it work; 2004-05-13 Not Zed * em-folder-view.c (emfv_message_reply): re-enabled the reply to selection stuff. I worked out how to make it work; I think. * em-format-html-display.c (efhd_html_button_press_event): if we aren't on a clickable object, do a null popup event instead. * em-folder-view.c (emfv_format_popup_event): do the full popup if we aren't on anything (not on a uri or part). See #8414. svn path=/trunk/; revision=25894 --- mail/em-folder-view.c | 23 +++++++++++++---------- 1 file changed, 13 insertions(+), 10 deletions(-) (limited to 'mail/em-folder-view.c') diff --git a/mail/em-folder-view.c b/mail/em-folder-view.c index fae2f6f11f..d5c1d9c2e6 100644 --- a/mail/em-folder-view.c +++ b/mail/em-folder-view.c @@ -1237,15 +1237,9 @@ emfv_message_reply(EMFolderView *emfv, int mode) /* HACK: Nasty internal gtkhtml poking going on here */ - /* Disabled since there's no simple way to find out if - gtkhtml has the primary selection right now */ - - /* Ugh, to use the clipboard we need to request the selection - and have an async callback - painful to deal with */ - - /*clip = gtk_clipboard_get(GDK_SELECTION_PRIMARY);*/ - if (FALSE /*gtk_clipboard_get_owner(clip) == (GObject *)emfv->preview*/ + if (((EMFormatHTML *)emfv->preview)->html->engine->selection && ((EMFormatHTML *)emfv->preview)->html->engine->primary) { + /* && GTK_WIDGET_HAS_FOCUS(emfv->preview->formathtml.html)*/ CamelMimeMessage *msg, *src; struct _camel_header_raw *header; HTMLEngineSaveState *state; @@ -1275,8 +1269,6 @@ emfv_message_reply(EMFolderView *emfv, int mode) } else { em_utils_reply_to_message_by_uid (emfv->folder, emfv->list->cursor_uid, mode); } - - /*g_object_unref(clip);*/ } static void @@ -2094,6 +2086,17 @@ emfv_format_popup_event(EMFormatHTMLDisplay *efhd, GdkEventButton *event, const EMPopupTarget *target; GtkMenu *menu; + if (uri == NULL && part == NULL) { + /* So we don't try and popup with nothing selected - rather odd result! */ + GPtrArray *uids = message_list_get_selected(emfv->list); + int doit = uids->len > 0; + + message_list_free_uids(emfv->list, uids); + if (doit) + emfv_popup(emfv, event); + return doit; + } + /* FIXME: this maybe should just fit on em-html-display, it has access to the snooped part type */ -- cgit v1.2.3