diff options
author | Radek Doulik <rodo@ximian.com> | 2004-03-09 01:53:37 +0800 |
---|---|---|
committer | Radek Doulik <rodo@src.gnome.org> | 2004-03-09 01:53:37 +0800 |
commit | 96dccdb6959e4277c6262710b27984b0a1ed45e4 (patch) | |
tree | 285b8245428a386b0baaf6cf0877aa6b4d11837a /mail | |
parent | c8e7f54abd96a4e5e166f8d840cd2b71b19a7d20 (diff) | |
download | gsoc2013-evolution-96dccdb6959e4277c6262710b27984b0a1ed45e4.tar.gz gsoc2013-evolution-96dccdb6959e4277c6262710b27984b0a1ed45e4.tar.zst gsoc2013-evolution-96dccdb6959e4277c6262710b27984b0a1ed45e4.zip |
new method, filter folder with FILTER_SOURCE_JUNKTEST type filter
2004-03-08 Radek Doulik <rodo@ximian.com>
* mail-ops.c (mail_filter_junk): new method, filter folder with
FILTER_SOURCE_JUNKTEST type filter
* em-folder-view.c: added Filter Junk command and junk icons to
menus, added apply filters icon to popup menu
(emfv_popup_filter_junk): new helper method, calls
mail_filter_junk
svn path=/trunk/; revision=24991
Diffstat (limited to 'mail')
-rw-r--r-- | mail/ChangeLog | 10 | ||||
-rw-r--r-- | mail/em-folder-view.c | 21 | ||||
-rw-r--r-- | mail/mail-ops.c | 8 | ||||
-rw-r--r-- | mail/mail-ops.h | 3 |
4 files changed, 37 insertions, 5 deletions
diff --git a/mail/ChangeLog b/mail/ChangeLog index 7641b3e25b..b904164d5b 100644 --- a/mail/ChangeLog +++ b/mail/ChangeLog @@ -1,3 +1,13 @@ +2004-03-08 Radek Doulik <rodo@ximian.com> + + * mail-ops.c (mail_filter_junk): new method, filter folder with + FILTER_SOURCE_JUNKTEST type filter + + * em-folder-view.c: added Filter Junk command and junk icons to + menus, added apply filters icon to popup menu + (emfv_popup_filter_junk): new helper method, calls + mail_filter_junk + 2004-03-05 Jeffrey Stedfast <fejj@ximian.com> * em-format-html-display.c (em_format_html_display_search): Don't diff --git a/mail/em-folder-view.c b/mail/em-folder-view.c index 8d25f92942..7d104c99e4 100644 --- a/mail/em-folder-view.c +++ b/mail/em-folder-view.c @@ -722,6 +722,14 @@ emfv_popup_apply_filters(GtkWidget *w, EMFolderView *emfv) mail_filter_on_demand(emfv->folder, uids); } +static void +emfv_popup_filter_junk(GtkWidget *w, EMFolderView *emfv) +{ + GPtrArray *uids = message_list_get_selected(emfv->list); + + mail_filter_junk(emfv->folder, uids); +} + /* filter callbacks, this will eventually be a wizard, see filter_type_current/vfolder_type_current for implementation */ @@ -768,8 +776,8 @@ static EMPopupItem emfv_popup_menu[] = { { EM_POPUP_ITEM, "30.emfv.01", N_("Mark as _Unread"), G_CALLBACK(emfv_popup_mark_unread), NULL, "mail-new.xpm", EM_POPUP_SELECT_MARK_UNREAD }, { EM_POPUP_ITEM, "30.emfv.02", N_("Mark as _Important"), G_CALLBACK(emfv_popup_mark_important), NULL, "priority-high.xpm", EM_POPUP_SELECT_MARK_IMPORTANT }, { EM_POPUP_ITEM, "30.emfv.03", N_("_Mark as Unimportant"), G_CALLBACK(emfv_popup_mark_unimportant), NULL, NULL, EM_POPUP_SELECT_MARK_UNIMPORTANT }, - { EM_POPUP_ITEM, "30.emfv.04", N_("Mark as _Junk"), G_CALLBACK(emfv_popup_mark_junk), NULL, NULL, EM_POPUP_SELECT_MARK_JUNK }, - { EM_POPUP_ITEM, "30.emfv.05", N_("Mark as _Not Junk"), G_CALLBACK(emfv_popup_mark_nojunk), NULL, NULL, EM_POPUP_SELECT_MARK_NOJUNK }, + { EM_POPUP_ITEM, "30.emfv.04", N_("Mark as _Junk"), G_CALLBACK(emfv_popup_mark_junk), NULL, "stock-junk-16.png", EM_POPUP_SELECT_MARK_JUNK }, + { EM_POPUP_ITEM, "30.emfv.05", N_("Mark as _Not Junk"), G_CALLBACK(emfv_popup_mark_nojunk), NULL, "stock-notjunk-16.png", EM_POPUP_SELECT_MARK_NOJUNK }, { EM_POPUP_BAR, "40.emfv" }, { EM_POPUP_ITEM, "40.emfv.00", N_("_Delete"), G_CALLBACK(emfv_popup_delete), NULL, "evolution-trash-mini.png", EM_POPUP_SELECT_DELETE }, @@ -788,7 +796,8 @@ static EMPopupItem emfv_popup_menu[] = { { EM_POPUP_ITEM, "70.emfv.00", N_("Add Sender to Address_book"), G_CALLBACK(emfv_popup_add_sender), NULL, NULL, EM_POPUP_SELECT_ONE|EM_POPUP_SELECT_ADD_SENDER }, { EM_POPUP_BAR, "80.emfv" }, - { EM_POPUP_ITEM, "80.emfv.00", N_("Appl_y Filters"), G_CALLBACK(emfv_popup_apply_filters) }, + { EM_POPUP_ITEM, "80.emfv.00", N_("Appl_y Filters"), G_CALLBACK(emfv_popup_apply_filters), NULL, "apply-filters-16.xpm" }, + { EM_POPUP_ITEM, "80.emfv.01", N_("F_ilter Junk"), G_CALLBACK(emfv_popup_filter_junk), NULL, "stock-junk-16.png" }, { EM_POPUP_BAR, "90.filter", NULL, NULL, NULL, NULL, EM_POPUP_SELECT_ONE }, { EM_POPUP_SUBMENU, "90.filter.00", N_("Crea_te Rule From Message"), NULL, NULL, NULL, EM_POPUP_SELECT_ONE }, @@ -906,6 +915,7 @@ from(BonoboUIComponent *uid, void *data, const char *path) \ EMFV_MAP_CALLBACK(emfv_add_sender_addressbook, emfv_popup_add_sender) EMFV_MAP_CALLBACK(emfv_message_apply_filters, emfv_popup_apply_filters) +EMFV_MAP_CALLBACK(emfv_message_filter_junk, emfv_popup_filter_junk) EMFV_MAP_CALLBACK(emfv_message_copy, emfv_popup_copy) EMFV_MAP_CALLBACK(emfv_message_move, emfv_popup_move) EMFV_MAP_CALLBACK(emfv_message_forward, emfv_popup_forward) @@ -1323,6 +1333,7 @@ static BonoboUIVerb emfv_message_verbs[] = { BONOBO_UI_UNSAFE_VERB ("AddSenderToAddressbook", emfv_add_sender_addressbook), BONOBO_UI_UNSAFE_VERB ("MessageApplyFilters", emfv_message_apply_filters), + BONOBO_UI_UNSAFE_VERB ("MessageFilterJunk", emfv_message_filter_junk), BONOBO_UI_UNSAFE_VERB ("MessageCopy", emfv_message_copy), BONOBO_UI_UNSAFE_VERB ("MessageDelete", emfv_message_delete), BONOBO_UI_UNSAFE_VERB ("MessageForward", emfv_message_forward), @@ -1388,11 +1399,14 @@ static EPixmap emfv_message_pixmaps[] = { E_PIXMAP ("/commands/MessageReplySender", "reply.xpm"), E_PIXMAP ("/commands/MessageForward", "forward.xpm"), E_PIXMAP ("/commands/MessageApplyFilters", "apply-filters-16.xpm"), + E_PIXMAP ("/commands/MessageFilterJunk", "stock-junk-16.png"), E_PIXMAP ("/commands/MessageSearch", "search-16.png"), E_PIXMAP ("/commands/MessageSaveAs", "save-as-16.png"), E_PIXMAP ("/commands/MessageMarkAsRead", "mail-read.xpm"), E_PIXMAP ("/commands/MessageMarkAsUnRead", "mail-new.xpm"), E_PIXMAP ("/commands/MessageMarkAsImportant", "priority-high.xpm"), + E_PIXMAP ("/commands/MessageMarkAsJunk", "stock-junk-16.png"), + E_PIXMAP ("/commands/MessageMarkAsNotJunk", "stock-notjunk-16.png"), E_PIXMAP ("/commands/MessageFollowUpFlag", "flag-for-followup-16.png"), E_PIXMAP ("/Toolbar/MailMessageToolbar/MessageReplySender", "buttons/reply.png"), @@ -1429,6 +1443,7 @@ static const EMFolderViewEnable emfv_enable_map[] = { { "AddSenderToAddressbook", EM_POPUP_SELECT_ADD_SENDER }, { "MessageApplyFilters", EM_POPUP_SELECT_MANY }, + { "MessageFilterJunk", EM_POPUP_SELECT_MANY }, { "MessageCopy", EM_POPUP_SELECT_MANY }, { "MessageDelete", EM_POPUP_SELECT_MANY|EM_POPUP_SELECT_DELETE }, { "MessageForward", EM_POPUP_SELECT_MANY }, diff --git a/mail/mail-ops.c b/mail/mail-ops.c index 372d4c2280..d72423b3e9 100644 --- a/mail/mail-ops.c +++ b/mail/mail-ops.c @@ -207,13 +207,19 @@ mail_filter_folder (CamelFolder *source_folder, GPtrArray *uids, e_thread_put (mail_thread_new, (EMsg *)m); } -/* convenience function for it */ +/* convenience functions for it */ void mail_filter_on_demand (CamelFolder *folder, GPtrArray *uids) { mail_filter_folder (folder, uids, FILTER_SOURCE_DEMAND, FALSE, NULL); } +void +mail_filter_junk (CamelFolder *folder, GPtrArray *uids) +{ + mail_filter_folder (folder, uids, FILTER_SOURCE_JUNKTEST, FALSE, NULL); +} + /* ********************************************************************** */ /* Temporary workaround for various issues. Gone before 0.11 */ diff --git a/mail/mail-ops.h b/mail/mail-ops.h index 8c1c3aa4d5..090beef9fc 100644 --- a/mail/mail-ops.h +++ b/mail/mail-ops.h @@ -144,8 +144,9 @@ void mail_filter_folder (CamelFolder *source_folder, GPtrArray *uids, const char *type, gboolean notify, CamelOperation *cancel); -/* convenience function for above */ +/* convenience functions for above */ void mail_filter_on_demand (CamelFolder *folder, GPtrArray *uids); +void mail_filter_junk (CamelFolder *folder, GPtrArray *uids); /* Work Offline */ void mail_prep_offline(const char *uri, CamelOperation *cancel, |