Re: [Evolution-hackers] Thinking about menus
- From: Benjamin Kahn <xkahn ximian com>
- To: Evolution Hackers List <evolution-hackers ximian com>
- Subject: Re: [Evolution-hackers] Thinking about menus
- Date: Fri, 21 Jan 2005 15:22:03 -0500
Attached is the latest version of the context menus patch ONLY. It
should be very similar to the last patch I sent to this list, and it
compiles for me.
It appears that the full menu reorganization isn't going to happen for
Evolution 2.2, so I've put up the latest version of the full menu patch
at:
http://primates.ximian.com/~xkahn/evolution-context-and-mailer-menus.patch
note that this patch won't apply well when the context menu stuff is
applied. :^) But I'll try to update it when that happens.
On Mon, 2005-01-10 at 12:25 -0500, Benjamin Kahn wrote:
> With Evolution 2.2 fast approaching with a new plugin architecture, I
> (along with Rodney and a bunch of other people) have been looking at the
> Evolution menus.
>
> We've started with with the mailer context menus and the main mailer
> menus. This is needed because the current menus are a discouraging mess
> and with menu merging from plugins, things are only going to get
> worse.
>
> The goals are:
>
> * Get rid of the Actions menu.
> * Make it obvious where to find things. (Eliminate seeking as
> much as possible)
> * Make common operations available without using submenus.
> * Move closer to the HIG recommendations.
> ( http://developer.gnome.org/projects/gup/hig/2.0/menus-standard.html )
> * Provide a good structure for plugins to add new menu items.
> * Umm... And simplicity.
>
> I've posted screenshots of the effort to the Evolution Blog:
> http://codeblogs.ximian.com/blogs/evolution/archives/000441.html
>
> The latest version of the glade mockup is here: (I'll try to keep this
> current)
> http://primates.ximian.com/~xkahn/evo-menus/evo-menus.tar.gz
> NOTE: Evolution does not use glade to create menus. This is simply a
> mockup. It will never be the official version.)
>
> I am generating a patch for Evolution that uses the new menus. I'm
> about 50% done.
>
> And, obviously, a similar layout needs to be designed for the other
> components.
>
> _______________________________________________
> evolution-hackers maillist - evolution-hackers lists ximian com
> http://lists.ximian.com/mailman/listinfo/evolution-hackers
>
Index: mail/em-folder-view.c
===================================================================
RCS file: /cvs/gnome/evolution/mail/em-folder-view.c,v
retrieving revision 1.100
diff -u -b -r1.100 em-folder-view.c
--- mail/em-folder-view.c 20 Jan 2005 03:56:22 -0000 1.100
+++ mail/em-folder-view.c 21 Jan 2005 18:56:44 -0000
@@ -646,6 +646,40 @@
}
static void
+emfv_popup_source(EPopup *ep, EPopupItem *pitem, void *data)
+{
+ EMFolderView *emfv = data;
+ EMMessageBrowser *emmb;
+ GPtrArray *uids;
+
+ uids = message_list_get_selected(emfv->list);
+
+ emmb = (EMMessageBrowser *)em_message_browser_window_new();
+ em_format_set_session((EMFormat *)((EMFolderView *)emmb)->preview, ((EMFormat *)emfv->preview)->session);
+ em_folder_view_set_folder((EMFolderView *)emmb, emfv->folder, emfv->folder_uri);
+ em_format_set_mode((EMFormat *)((EMFolderView *)emmb)->preview, EM_FORMAT_SOURCE);
+ em_folder_view_set_message((EMFolderView *)emmb, uids->pdata[0], FALSE);
+ gtk_widget_show(emmb->window);
+
+ message_list_free_uids(emfv->list, uids);
+}
+
+static void
+emfv_popup_copy_text(EPopup *ep, EPopupItem *pitem, void *data)
+{
+ EMFolderView *emfv = data;
+ html_engine_copy (((EMFormatHTML *)emfv->preview)->html->engine);
+}
+
+static void
+emfv_popup_selectall(EPopup *ep, EPopupItem *pitem, void *data)
+{
+ EMFolderView *emfv = data;
+ gtk_html_select_all (((EMFormatHTML *)emfv->preview)->html);
+
+}
+
+static void
emfv_popup_reply_sender(EPopup *ep, EPopupItem *pitem, void *data)
{
EMFolderView *emfv = data;
@@ -934,57 +968,72 @@
/* TODO: Move some of these to be 'standard' menu's */
-static EPopupItem emfv_popup_items[] = {
- { E_POPUP_ITEM, "00.emfv.00", N_("_Open"), emfv_popup_open, NULL, NULL, 0 },
- { E_POPUP_ITEM, "00.emfv.01", N_("_Edit as New Message..."), emfv_popup_edit, NULL, NULL, EM_POPUP_SELECT_EDIT },
- { E_POPUP_ITEM, "00.emfv.02", N_("_Save As..."), emfv_popup_saveas, NULL, "stock_save-as", 0 },
- { E_POPUP_ITEM, "00.emfv.03", N_("_Print"), emfv_popup_print, NULL, "stock_print", 0 },
+static EPopupItem emfv_popup_message_items[] = {
+ { E_POPUP_ITEM, "00.emfv.00", N_("Reply to _All"), emfv_popup_reply_all, NULL, "stock_mail-reply-to-all", EM_POPUP_SELECT_ONE },
+ { E_POPUP_ITEM, "00.emfv.01", N_("_Reply to Sender"), emfv_popup_reply_sender, NULL, "stock_mail-reply", EM_POPUP_SELECT_ONE },
+ { E_POPUP_ITEM, "00.emfv.02", N_("_Forward"), emfv_popup_forward, NULL, "stock_mail-forward", EM_POPUP_SELECT_MANY },
{ E_POPUP_BAR, "10.emfv" },
- { E_POPUP_ITEM, "10.emfv.00", N_("_Reply to Sender"), emfv_popup_reply_sender, NULL, "stock_mail-reply", EM_POPUP_SELECT_ONE },
- { E_POPUP_ITEM, "10.emfv.01", N_("Reply to _List"), emfv_popup_reply_list, NULL, NULL, EM_POPUP_SELECT_ONE|EM_POPUP_SELECT_MAILING_LIST },
- { E_POPUP_ITEM, "10.emfv.02", N_("Reply to _All"), emfv_popup_reply_all, NULL, "stock_mail-reply-to-all", EM_POPUP_SELECT_ONE },
- { E_POPUP_ITEM, "10.emfv.03", N_("_Forward"), emfv_popup_forward, NULL, "stock_mail-forward", EM_POPUP_SELECT_MANY },
-
- { E_POPUP_BAR, "20.emfv", NULL, NULL, NULL, NULL, EM_POPUP_SELECT_FLAG_FOLLOWUP|EM_POPUP_SELECT_FLAG_COMPLETED|EM_POPUP_SELECT_FLAG_CLEAR },
- { E_POPUP_ITEM, "20.emfv.00", N_("Follo_w Up..."), emfv_popup_flag_followup, NULL, "stock_mail-flag-for-followup", EM_POPUP_SELECT_FLAG_FOLLOWUP },
- { E_POPUP_ITEM, "20.emfv.01", N_("Fla_g Completed"), emfv_popup_flag_completed, NULL, NULL, EM_POPUP_SELECT_FLAG_COMPLETED },
- { E_POPUP_ITEM, "20.emfv.02", N_("Cl_ear Flag"), emfv_popup_flag_clear, NULL, NULL, EM_POPUP_SELECT_FLAG_CLEAR },
+ { E_POPUP_ITEM, "10.emfv.00", N_("_Save As..."), emfv_popup_saveas, NULL, "stock_save-as", 0 },
+ { E_POPUP_ITEM, "10.emfv.01", N_("_Print"), emfv_popup_print, NULL, "stock_print", 0 },
+
+ { E_POPUP_BAR, "20.emfv" },
+ { E_POPUP_ITEM, "20.emfv.00", N_("Select _All"), emfv_popup_selectall, NULL, NULL, 0 },
{ E_POPUP_BAR, "30.emfv" },
- { E_POPUP_ITEM, "30.emfv.00", N_("Mar_k as Read"), emfv_popup_mark_read, NULL, "stock_mail-open", EM_POPUP_SELECT_MARK_READ },
- { E_POPUP_ITEM, "30.emfv.01", N_("Mark as _Unread"), emfv_popup_mark_unread, NULL, "stock_mail-unread", EM_POPUP_SELECT_MARK_UNREAD },
- { E_POPUP_ITEM, "30.emfv.02", N_("Mark as _Important"), emfv_popup_mark_important, NULL, "stock_mail-priority-high", EM_POPUP_SELECT_MARK_IMPORTANT },
- { E_POPUP_ITEM, "30.emfv.03", N_("_Mark as Unimportant"), emfv_popup_mark_unimportant, NULL, NULL, EM_POPUP_SELECT_MARK_UNIMPORTANT },
- { E_POPUP_ITEM, "30.emfv.04", N_("Mark as _Junk"), emfv_popup_mark_junk, NULL, "stock_spam", EM_POPUP_SELECT_MARK_JUNK },
- { E_POPUP_ITEM, "30.emfv.05", N_("Mark as _Not Junk"), emfv_popup_mark_nojunk, NULL, "stock_not-spam", EM_POPUP_SELECT_MARK_NOJUNK },
+ { E_POPUP_ITEM, "30.emfv.00", N_("_Show Email Source"), emfv_popup_source, NULL, NULL, 0 },
+};
+
+static EPopupItem emfv_popup_selection_items[] = {
+ { E_POPUP_ITEM, "00.emfv.00", N_("_Copy"), emfv_popup_copy_text, NULL, "stock_copy", 0 },
+ { E_POPUP_ITEM, "00.emfv.01", N_("Select _All"), emfv_popup_selectall, NULL, NULL, 0 },
+
+ { E_POPUP_BAR, "10.emfv" },
+ { E_POPUP_ITEM, "10.emfv.00", N_("Quoted Reply"), emfv_popup_reply_all, NULL, "stock_mail-reply-to-all", EM_POPUP_SELECT_ONE },
+ { E_POPUP_ITEM, "10.emfv.01", N_("Quoted R_eply to Sender"), emfv_popup_reply_sender, NULL, "stock_mail-reply", EM_POPUP_SELECT_ONE },
+ { E_POPUP_ITEM, "10.emfv.02", N_("Quoted _Forward"), emfv_popup_forward, NULL, "stock_mail-forward", EM_POPUP_SELECT_MANY },
+
+
+};
+
+static EPopupItem emfv_popup_items[] = {
+ { E_POPUP_ITEM, "10.emfv.00", N_("Reply to _All"), emfv_popup_reply_all, NULL, "stock_mail-reply-to-all", EM_POPUP_SELECT_ONE },
+ { E_POPUP_ITEM, "10.emfv.01", N_("_Reply to Sender"), emfv_popup_reply_sender, NULL, "stock_mail-reply", EM_POPUP_SELECT_ONE },
+ { E_POPUP_ITEM, "10.emfv.02", N_("_Forward"), emfv_popup_forward, NULL, "stock_mail-forward", EM_POPUP_SELECT_MANY },
+
+ { E_POPUP_BAR, "20.emfv" },
+ { E_POPUP_ITEM, "20.emfv.00", N_("_Edit as New Message..."), emfv_popup_edit, NULL, NULL, EM_POPUP_SELECT_EDIT },
+ { E_POPUP_ITEM, "20.emfv.01", N_("_Save As..."), emfv_popup_saveas, NULL, "stock_save-as", 0 },
+ { E_POPUP_ITEM, "20.emfv.02", N_("_Print"), emfv_popup_print, NULL, "stock_print", 0 },
{ E_POPUP_BAR, "40.emfv" },
{ E_POPUP_ITEM, "40.emfv.00", N_("_Delete"), emfv_popup_delete, NULL, "stock_delete", EM_POPUP_SELECT_DELETE },
{ E_POPUP_ITEM, "40.emfv.01", N_("U_ndelete"), emfv_popup_undelete, NULL, "stock_undelete", EM_POPUP_SELECT_UNDELETE },
+ { E_POPUP_ITEM, "40.emfv.02", N_("Mo_ve to Folder..."), emfv_popup_move },
+ { E_POPUP_ITEM, "40.emfv.03", N_("_Copy to Folder..."), emfv_popup_copy },
{ E_POPUP_BAR, "50.emfv" },
- { E_POPUP_ITEM, "50.emfv.00", N_("Mo_ve to Folder..."), emfv_popup_move },
- { E_POPUP_ITEM, "50.emfv.01", N_("_Copy to Folder..."), emfv_popup_copy },
+ { E_POPUP_ITEM, "50.emfv.02", N_("Mark as _Important"), emfv_popup_mark_important, NULL, "stock_mail-priority-high", EM_POPUP_SELECT_MARK_IMPORTANT },
+ { E_POPUP_ITEM, "50.emfv.03", N_("_Mark as Unimportant"), emfv_popup_mark_unimportant, NULL, NULL, EM_POPUP_SELECT_MARK_UNIMPORTANT },
+ { E_POPUP_ITEM, "50.emfv.01", N_("Mark as _Junk"), emfv_popup_mark_junk, NULL, "stock_spam", EM_POPUP_SELECT_MARK_JUNK },
+ { E_POPUP_ITEM, "50.emfv.02", N_("Mark as _Not Junk"), emfv_popup_mark_nojunk, NULL, "stock_not-spam", EM_POPUP_SELECT_MARK_NOJUNK },
+ { E_POPUP_ITEM, "50.emfv.05", N_("Mark for Follo_w Up..."), emfv_popup_flag_followup, NULL, "stock_mail-flag-for-followup", EM_POPUP_SELECT_FLAG_FOLLOWUP },
+
+ { E_POPUP_SUBMENU, "60.label.03", N_("Label") },
+ { E_POPUP_IMAGE, "60.label.03/00.label", N_("None"), emfv_popup_label_clear },
+ { E_POPUP_BAR, "60.label.03/00.label.00" },
+
+ { E_POPUP_BAR, "70.emfv.06", NULL, NULL, NULL, NULL, EM_POPUP_SELECT_FLAG_COMPLETED|EM_POPUP_SELECT_FLAG_CLEAR },
- { E_POPUP_BAR, "60.label" },
- { E_POPUP_SUBMENU, "60.label.00", N_("Label") },
- { E_POPUP_IMAGE, "60.label.00/00.label", N_("None"), emfv_popup_label_clear },
- { E_POPUP_BAR, "60.label.00/00.label.00" },
-
- { E_POPUP_BAR, "70.emfv", NULL, NULL, NULL, NULL, EM_POPUP_SELECT_ADD_SENDER },
- { E_POPUP_ITEM, "70.emfv.00", N_("Add Sender to Address_book"), emfv_popup_add_sender, NULL, NULL, EM_POPUP_SELECT_ADD_SENDER },
-
- { E_POPUP_BAR, "80.emfv" },
- { E_POPUP_ITEM, "80.emfv.00", N_("Appl_y Filters"), emfv_popup_apply_filters, NULL, "stock_mail-filters-apply" },
- { E_POPUP_ITEM, "80.emfv.01", N_("F_ilter Junk"), emfv_popup_filter_junk, NULL, "stock_spam" },
+ { E_POPUP_ITEM, "70.emfv.07", N_("Fla_g Completed"), emfv_popup_flag_completed, NULL, "stock_mail-flag-for-followup-done", EM_POPUP_SELECT_FLAG_COMPLETED },
+ { E_POPUP_ITEM, "70.emfv.08", N_("Cl_ear Flag"), emfv_popup_flag_clear, NULL, NULL, EM_POPUP_SELECT_FLAG_CLEAR },
{ E_POPUP_BAR, "90.filter", NULL, NULL, NULL, NULL, EM_POPUP_SELECT_ONE },
{ E_POPUP_SUBMENU, "90.filter.00", N_("Crea_te Rule From Message"), NULL, NULL, NULL, EM_POPUP_SELECT_ONE },
- { E_POPUP_ITEM, "90.filter.00/00.00", N_("VFolder on _Subject"), emfv_popup_vfolder_subject, NULL, NULL, EM_POPUP_SELECT_ONE },
- { E_POPUP_ITEM, "90.filter.00/00.01", N_("VFolder on Se_nder"), emfv_popup_vfolder_sender, NULL, NULL, EM_POPUP_SELECT_ONE },
- { E_POPUP_ITEM, "90.filter.00/00.02", N_("VFolder on _Recipients"), emfv_popup_vfolder_recipients, NULL, NULL, EM_POPUP_SELECT_ONE },
- { E_POPUP_ITEM, "90.filter.00/00.03", N_("VFolder on Mailing _List"),
+ { E_POPUP_ITEM, "90.filter.00/00.00", N_("vFolder on _Subject"), emfv_popup_vfolder_subject, NULL, NULL, EM_POPUP_SELECT_ONE },
+ { E_POPUP_ITEM, "90.filter.00/00.01", N_("vFolder on Se_nder"), emfv_popup_vfolder_sender, NULL, NULL, EM_POPUP_SELECT_ONE },
+ { E_POPUP_ITEM, "90.filter.00/00.02", N_("vFolder on _Recipients"), emfv_popup_vfolder_recipients, NULL, NULL, EM_POPUP_SELECT_ONE },
+ { E_POPUP_ITEM, "90.filter.00/00.03", N_("vFolder on Mailing _List"),
emfv_popup_vfolder_mlist, NULL, NULL, EM_POPUP_SELECT_ONE|EM_POPUP_SELECT_MAILING_LIST },
{ E_POPUP_BAR, "90.filter.00/10", NULL, NULL, NULL, NULL, EM_POPUP_SELECT_ONE },
@@ -993,6 +1042,7 @@
{ E_POPUP_ITEM, "90.filter.00/10.02", N_("Filter on Re_cipients"), emfv_popup_filter_recipients, NULL, NULL, EM_POPUP_SELECT_ONE },
{ E_POPUP_ITEM, "90.filter.00/10.03", N_("Filter on _Mailing List"),
emfv_popup_filter_mlist, NULL, NULL, EM_POPUP_SELECT_ONE|EM_POPUP_SELECT_MAILING_LIST },
+
};
static void
@@ -1017,6 +1067,74 @@
}
static void
+emfv_popup_message(EMFolderView *emfv, GdkEvent *event)
+{
+ GSList *menus = NULL, *l, *label_list = NULL;
+ GtkMenu *menu;
+ EMPopup *emp;
+ EMPopupTargetSelect *target;
+ int i;
+
+ /** @HookPoint-EMPopup: Message List Context Menu
+ * @Id: org.gnome.evolution.mail.folderview.popup.select
+ * @Type: EMPopup
+ * @Target: EMPopupTargetSelect
+ *
+ * This is the context menu shown on the message list or over a message.
+ */
+ emp = em_popup_new("org.gnome.evolution.mail.folderview.popup");
+ target = em_folder_view_get_popup_target(emfv, emp);
+
+ for (i=0;i<sizeof(emfv_popup_message_items)/sizeof(emfv_popup_message_items[0]);i++)
+ menus = g_slist_prepend(menus, &emfv_popup_message_items[i]);
+
+ e_popup_add_items((EPopup *)emp, NULL, menus, emfv_popup_items_free, emfv);
+
+ menu = e_popup_create_menu_once((EPopup *)emp, (EPopupTarget *)target, 0);
+
+ if (event == NULL || event->type == GDK_KEY_PRESS) {
+ /* FIXME: menu pos function */
+ gtk_menu_popup(menu, NULL, NULL, NULL, NULL, 0, event ? event->key.time : gtk_get_current_event_time());
+ } else {
+ gtk_menu_popup(menu, NULL, NULL, NULL, NULL, event->button.button, event->button.time);
+ }
+}
+
+static void
+emfv_popup_selection(EMFolderView *emfv, GdkEvent *event)
+{
+ GSList *menus = NULL, *l, *label_list = NULL;
+ GtkMenu *menu;
+ EMPopup *emp;
+ EMPopupTargetSelect *target;
+ int i;
+
+ /** @HookPoint-EMPopup: Message List Context Menu
+ * @Id: org.gnome.evolution.mail.folderview.popup.select
+ * @Type: EMPopup
+ * @Target: EMPopupTargetSelect
+ *
+ * This is the context menu shown on the message list or over a message.
+ */
+ emp = em_popup_new("org.gnome.evolution.mail.folderview.popup");
+ target = em_folder_view_get_popup_target(emfv, emp);
+
+ for (i=0;i<sizeof(emfv_popup_selection_items)/sizeof(emfv_popup_selection_items[0]);i++)
+ menus = g_slist_prepend(menus, &emfv_popup_selection_items[i]);
+
+ e_popup_add_items((EPopup *)emp, NULL, menus, emfv_popup_items_free, emfv);
+
+ menu = e_popup_create_menu_once((EPopup *)emp, (EPopupTarget *)target, 0);
+
+ if (event == NULL || event->type == GDK_KEY_PRESS) {
+ /* FIXME: menu pos function */
+ gtk_menu_popup(menu, NULL, NULL, NULL, NULL, 0, event ? event->key.time : gtk_get_current_event_time());
+ } else {
+ gtk_menu_popup(menu, NULL, NULL, NULL, NULL, event->button.button, event->button.time);
+ }
+}
+
+static void
emfv_popup(EMFolderView *emfv, GdkEvent *event)
{
GSList *menus = NULL, *l, *label_list = NULL;
@@ -1050,7 +1168,7 @@
item = g_malloc0(sizeof(*item));
item->type = E_POPUP_IMAGE;
- item->path = g_strdup_printf("60.label.00/00.label.%02d", i++);
+ item->path = g_strdup_printf("60.label.03/00.label.%02d", i++);
item->label = label->name;
item->activate = emfv_popup_label_set;
item->user_data = label->tag;
@@ -1440,6 +1558,56 @@
}
static void
+emp_uri_popup_vfolder_sender(EPopup *ep, EPopupItem *pitem, void *data)
+{
+ EMFolderView *emfv = data;
+ EMPopupTargetURI *t = (EMPopupTargetURI *)ep->target;
+ CamelURL *url;
+ CamelInternetAddress *addr;
+
+ url = camel_url_new(t->uri, NULL);
+ if (url == NULL) {
+ g_warning("cannot parse url '%s'", t->uri);
+ return;
+ }
+
+ if (url->path && url->path[0]) {
+ addr = camel_internet_address_new ();
+ camel_address_decode (CAMEL_ADDRESS (addr), url->path);
+ vfolder_gui_add_from_address (addr, AUTO_FROM, emfv->folder_uri);
+ camel_object_unref (addr);
+ }
+
+ camel_url_free(url);
+
+}
+
+
+static void
+emp_uri_popup_vfolder_recipient(EPopup *ep, EPopupItem *pitem, void *data)
+{
+ EMFolderView *emfv = data;
+ EMPopupTargetURI *t = (EMPopupTargetURI *)ep->target;
+ CamelURL *url;
+ CamelInternetAddress *addr;
+
+ url = camel_url_new(t->uri, NULL);
+ if (url == NULL) {
+ g_warning("cannot parse url '%s'", t->uri);
+ return;
+ }
+
+ if (url->path && url->path[0]) {
+ addr = camel_internet_address_new ();
+ camel_address_decode (CAMEL_ADDRESS (addr), url->path);
+ vfolder_gui_add_from_address (addr, AUTO_TO, emfv->folder_uri);
+ camel_object_unref (addr);
+ }
+
+ camel_url_free(url);
+}
+
+static void
vfolder_type_uid (CamelFolder *folder, const char *uid, const char *uri, int type)
{
struct _filter_data *data;
@@ -2186,8 +2354,26 @@
gtk_selection_owner_set(p->invisible, GDK_SELECTION_CLIPBOARD, gtk_get_current_event_time());
}
+static void
+emp_uri_popup_address_copy(EPopup *ep, EPopupItem *pitem, void *data)
+{
+ EMFolderView *emfv = data;
+ struct _EMFolderViewPrivate *p = emfv->priv;
+
+ g_free(p->selection_uri);
+ p->selection_uri = g_strdup(pitem->user_data);
+
+ gtk_selection_owner_set(p->invisible, GDK_SELECTION_PRIMARY, gtk_get_current_event_time());
+ gtk_selection_owner_set(p->invisible, GDK_SELECTION_CLIPBOARD, gtk_get_current_event_time());
+}
+
static EPopupItem emfv_uri_popups[] = {
- { E_POPUP_ITEM, "00.uri.01", N_("_Copy Link Location"), emp_uri_popup_link_copy, NULL, NULL, EM_POPUP_URI_NOT_MAILTO },
+ { E_POPUP_ITEM, "00.uri.15", N_("_Copy Link Location"), emp_uri_popup_link_copy, NULL, NULL, EM_POPUP_URI_NOT_MAILTO },
+ { E_POPUP_ITEM, "00.uri.15", N_("_Copy Email Address"), emp_uri_popup_address_copy, NULL, NULL, EM_POPUP_URI_MAILTO },
+
+ { E_POPUP_SUBMENU, "20.uri.00", N_("Create _VFolder"), NULL, NULL, NULL, EM_POPUP_URI_MAILTO },
+ { E_POPUP_ITEM, "20.uri.00/00.10", N_("_From this Address"), emp_uri_popup_vfolder_sender, NULL, NULL, EM_POPUP_URI_MAILTO },
+ { E_POPUP_ITEM, "20.uri.00/00.00", N_("_To this Address"), emp_uri_popup_vfolder_recipient, NULL, NULL, EM_POPUP_URI_MAILTO },
};
static void
@@ -2216,9 +2402,18 @@
/* 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;
+ int message_menu = uids->len == 1;
message_list_free_uids(emfv->list, uids);
if (doit)
+ if (message_menu) {
+ int selection = html_engine_is_selection_active(((EMFormatHTML *)efhd)->html->engine);
+
+ if (selection)
+ emfv_popup_selection(emfv, (GdkEvent *)event);
+ else
+ emfv_popup_message(emfv, (GdkEvent *)event);
+ } else
emfv_popup(emfv, (GdkEvent *)event);
return doit;
}
Index: mail/em-popup.c
===================================================================
RCS file: /cvs/gnome/evolution/mail/em-popup.c,v
retrieving revision 1.32
diff -u -b -r1.32 em-popup.c
--- mail/em-popup.c 22 Dec 2004 07:38:16 -0000 1.32
+++ mail/em-popup.c 21 Jan 2005 18:56:44 -0000
@@ -551,7 +551,7 @@
static EPopupItem emp_standard_uri_popups[] = {
{ E_POPUP_ITEM, "00.uri.00", N_("_Open Link in Browser"), emp_uri_popup_link_open, NULL, NULL, EM_POPUP_URI_NOT_MAILTO },
- { E_POPUP_ITEM, "00.uri.10", N_("Se_nd message to..."), emp_uri_popup_address_send, NULL, NULL, EM_POPUP_URI_MAILTO },
+ { E_POPUP_ITEM, "00.uri.10", N_("_Send New Message To..."), emp_uri_popup_address_send, NULL, NULL, EM_POPUP_URI_MAILTO },
{ E_POPUP_ITEM, "00.uri.20", N_("_Add to Addressbook"), emp_uri_popup_address_add, NULL, NULL, EM_POPUP_URI_MAILTO },
};
Index: mail/mail-autofilter.c
===================================================================
RCS file: /cvs/gnome/evolution/mail/mail-autofilter.c,v
retrieving revision 1.51
diff -u -b -r1.51 mail-autofilter.c
--- mail/mail-autofilter.c 17 Jun 2004 07:34:49 -0000 1.51
+++ mail/mail-autofilter.c 21 Jan 2005 18:56:44 -0000
@@ -223,6 +223,29 @@
}
static void
+rule_from_address (FilterRule *rule, RuleContext *context, CamelInternetAddress* addr, int flags)
+{
+ rule->grouping = FILTER_GROUP_ANY;
+
+ if (flags & AUTO_FROM) {
+ const char *name, *address;
+ char *namestr;
+
+ camel_internet_address_get (addr, 0, &name, &address);
+ rule_add_sender (context, rule, address);
+ if (name == NULL || name[0] == '\0')
+ name = address;
+ namestr = g_strdup_printf(_("Mail from %s"), name);
+ filter_rule_set_name (rule, namestr);
+ g_free (namestr);
+ }
+ if (flags & AUTO_TO) {
+ rule_match_recipients (context, rule, addr);
+ }
+
+}
+
+static void
rule_from_message (FilterRule *rule, RuleContext *context, CamelMimeMessage *msg, int flags)
{
CamelInternetAddress *addr;
@@ -285,6 +308,20 @@
rule = em_vfolder_rule_new ();
em_vfolder_rule_add_source (rule, euri);
rule_from_message ((FilterRule *)rule, (RuleContext *)context, msg, flags);
+ g_free(euri);
+
+ return (FilterRule *)rule;
+}
+
+FilterRule *
+em_vfolder_rule_from_address (EMVFolderContext *context, CamelInternetAddress *addr, int flags, const char *source)
+{
+ EMVFolderRule *rule;
+ char *euri = em_uri_from_camel(source);
+
+ rule = em_vfolder_rule_new ();
+ em_vfolder_rule_add_source (rule, euri);
+ rule_from_address ((FilterRule *)rule, (RuleContext *)context, addr, flags);
g_free(euri);
return (FilterRule *)rule;
Index: mail/mail-vfolder.c
===================================================================
RCS file: /cvs/gnome/evolution/mail/mail-vfolder.c,v
retrieving revision 1.128
diff -u -b -r1.128 mail-vfolder.c
--- mail/mail-vfolder.c 17 Jan 2005 09:00:28 -0000 1.128
+++ mail/mail-vfolder.c 21 Jan 2005 18:56:44 -0000
@@ -1102,13 +1102,22 @@
}
void
-vfolder_gui_add_from_message(CamelMimeMessage *msg, int flags, const char *source)
+vfolder_gui_add_from_message(CamelMimeMessage *addr, int flags, const char *source)
{
EMVFolderRule *rule;
- g_return_if_fail (msg != NULL);
+ rule = (EMVFolderRule*)em_vfolder_rule_from_message(context, addr, flags, source);
+ vfolder_gui_add_rule(rule);
+}
- rule = (EMVFolderRule*)em_vfolder_rule_from_message(context, msg, flags, source);
+void
+vfolder_gui_add_from_address(CamelInternetAddress *addr, int flags, const char *source)
+{
+ EMVFolderRule *rule;
+
+ g_return_if_fail (addr != NULL);
+
+ rule = (EMVFolderRule*)em_vfolder_rule_from_address(context, addr, flags, source);
vfolder_gui_add_rule(rule);
}
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]