aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorEttore Perazzoli <ettore@src.gnome.org>2000-09-12 23:22:31 +0800
committerEttore Perazzoli <ettore@src.gnome.org>2000-09-12 23:22:31 +0800
commit5994bc5006075c88b81f378ed858fdc7ac00f8bc (patch)
treee24789c067c2f5d168cd041385a4d990aee69686
parent497e2144ace593643f64eb4dfd48f691d205521b (diff)
downloadgsoc2013-evolution-5994bc5006075c88b81f378ed858fdc7ac00f8bc.tar
gsoc2013-evolution-5994bc5006075c88b81f378ed858fdc7ac00f8bc.tar.gz
gsoc2013-evolution-5994bc5006075c88b81f378ed858fdc7ac00f8bc.tar.bz2
gsoc2013-evolution-5994bc5006075c88b81f378ed858fdc7ac00f8bc.tar.lz
gsoc2013-evolution-5994bc5006075c88b81f378ed858fdc7ac00f8bc.tar.xz
gsoc2013-evolution-5994bc5006075c88b81f378ed858fdc7ac00f8bc.tar.zst
gsoc2013-evolution-5994bc5006075c88b81f378ed858fdc7ac00f8bc.zip
For additional coolness, display the name of the mailing list in the
right-click menu. Also, make the action box appear in the filter dialog and fix a stupid cut & paste bug that prevented the code from checking for the right headers. svn path=/trunk/; revision=5365
-rw-r--r--mail/ChangeLog14
-rw-r--r--mail/mail-autofilter.c2
-rw-r--r--mail/mail-mlist-magic.c2
-rw-r--r--mail/message-list.c23
4 files changed, 34 insertions, 7 deletions
diff --git a/mail/ChangeLog b/mail/ChangeLog
index 78e597b38a..4902063e88 100644
--- a/mail/ChangeLog
+++ b/mail/ChangeLog
@@ -1,5 +1,18 @@
2000-09-12 Ettore Perazzoli <ettore@helixcode.com>
+ * message-list.c (on_right_click): Also display the name of the
+ mailing list in the "Filter on Mailing List" item for additional
+ Coolness factor.
+
+ * mail-autofilter.c (filter_gui_add_for_mailing_list): Create the
+ rule with `filter_filter_new()' so that it also has an action
+ part.
+
+ * mail-mlist-magic.c (get_header): Use the right header name to
+ retrieve the header.
+
+2000-09-12 Ettore Perazzoli <ettore@helixcode.com>
+
* message-list.c (on_right_click): Grey out the mailing list
filter item if `mail_mlist_magic_detect_list()' returns NULL on
this message [i.e., if we cannot figure out a mailing list for
@@ -12,6 +25,7 @@
(check_delivered_to): Likewise.
(check_x_mailing_list): Likewise.
(check_x_loop): Likewise.
+ (get_header): Use the right header name to retrieve the header.
* message-list.c (on_right_click): Mark strings for translation.
diff --git a/mail/mail-autofilter.c b/mail/mail-autofilter.c
index 2b46f4288e..e7c9f8997c 100644
--- a/mail/mail-autofilter.c
+++ b/mail/mail-autofilter.c
@@ -311,7 +311,7 @@ filter_gui_add_for_mailing_list (CamelMimeMessage *msg,
systemrules = g_strdup_printf("%s/evolution/filtertypes.xml", EVOLUTION_DATADIR);
rule_context_load((RuleContext *)fc, systemrules, userrules, NULL, NULL);
- rule = filter_rule_new ();
+ rule = (FilterRule *) filter_filter_new ();
part = rule_context_create_part((RuleContext *)fc, "header");
filter_rule_add_part((FilterRule *)rule, part);
diff --git a/mail/mail-mlist-magic.c b/mail/mail-mlist-magic.c
index 10104db4d0..d02638572e 100644
--- a/mail/mail-mlist-magic.c
+++ b/mail/mail-mlist-magic.c
@@ -81,7 +81,7 @@ get_header (CamelMimeMessage *message,
{
const char *value;
- value = camel_medium_get_header (CAMEL_MEDIUM (message), "Sender");
+ value = camel_medium_get_header (CAMEL_MEDIUM (message), header_name);
if (value == NULL)
return NULL;
diff --git a/mail/message-list.c b/mail/message-list.c
index 305dfc664b..414e419c6e 100644
--- a/mail/message-list.c
+++ b/mail/message-list.c
@@ -1254,22 +1254,35 @@ on_right_click (ETableScrolled *table, gint row, gint col, GdkEvent *event, Mess
{ _("Filter on Mailing List"), NULL, GTK_SIGNAL_FUNC (filter_mlist), 6 },
{ NULL, NULL, NULL, 0 }
};
+ int last_item;
+ char *mailing_list_name;
+
+ /* Evil Hack. */
+
+ last_item = (sizeof (menu) / sizeof (*menu)) - 2;
if (fb->folder != drafts_folder)
enable_mask |= 1;
if (fb->mail_display->current_message == NULL) {
- enable_mask |= 6;
+ enable_mask |= 2;
+ mailing_list_name = NULL;
} else {
- char *mailing_list_name;
-
mailing_list_name = mail_mlist_magic_detect_list (fb->mail_display->current_message,
NULL, NULL);
- if (mailing_list_name == NULL)
- enable_mask |= 4;
+ }
+
+ if (mailing_list_name == NULL) {
+ enable_mask |= 4;
+ menu[last_item].name = g_strdup (_("Filter on Mailing List"));
+ } else {
+ menu[last_item].name = g_strdup_printf (_("Filter on Mailing List (%s)"),
+ mailing_list_name);
}
e_popup_menu_run (menu, (GdkEventButton *)event, enable_mask, 0, fb);
+
+ g_free (menu[last_item].name);
return TRUE;
}