diff options
author | Rodney Dawes <dobey@novell.com> | 2005-02-19 00:43:55 +0800 |
---|---|---|
committer | Rodney Dawes <dobey@src.gnome.org> | 2005-02-19 00:43:55 +0800 |
commit | e6ee91aa2689dcb51a24867fa06b25034ba64607 (patch) | |
tree | 9b98ed26a1bde7d69f662951b740dcb5e7c549d9 /mail/mail-autofilter.c | |
parent | 41475c94d77ff1f0f3192012b19c6ecaa747abd2 (diff) | |
download | gsoc2013-evolution-e6ee91aa2689dcb51a24867fa06b25034ba64607.tar.gz gsoc2013-evolution-e6ee91aa2689dcb51a24867fa06b25034ba64607.tar.zst gsoc2013-evolution-e6ee91aa2689dcb51a24867fa06b25034ba64607.zip |
New method to copy the selected text in the mail display, to the clipboard
2005-02-18 Rodney Dawes <dobey@novell.com>
* mail/em-folder-view.c (emfv_popup_copy_text): New method to copy
the selected text in the mail display, to the clipboard
(emfv_popup_items): Restructure this list for the new context menus
layout that we are moving to, to improve the UI
(emfv_popup): Add a third argument for whether we are on the mail
display or not, so that we can pop up the correct portion of the menus
Pass the on_display argument on to create the popup target
Only generate the label items if we are on the list and not the display
(emp_uri_popup_vfolder_{sender,recipient}): New methods to create
vfolders to and from mailto: addresses from the context menu
(emfv_enable_menus): Create the target here for clicking on the list
(em_folder_view_get_popup_target): Add a third argument so that we
can tell whether we are on the display or not
Set the appropriate flags on the target for whether we are on the
message display,, and whether or not there is selected text in it
(emfv_list_right_click): We aren't rigt-clicking on the display here
(emfv_popup_menu): We aren't right-clicking on the mail display here
(emfv_uri_popups): Add the submenu for creating a vfolder from mailto:
(emfv_format_popup_event): We are right-clickingo nt he display here
* mail/em-folder-view.h: Add the new flags we need for the mail
context menus popup target here
(em_folderiew_get_popup_target): Add the on_display argument
* mail/em-popup.c (emp_standard_uri_popups): Fix the label and mnemonic
for the Send New Message popup item for mailto: addresses
* mail/mail-autofilter.c (rule_from_address):
(em_vfolder_rule_from_address): New methods to create a vfolder based
on a CamelInternetAddress object that we get from the mailer
* mail/mail-vfolder.[ch] (vfolder_gui_add_from_address): New method to
create a vfolder rule based on the mailto: addresses
Fixes #23822
svn path=/trunk/; revision=28814
Diffstat (limited to 'mail/mail-autofilter.c')
-rw-r--r-- | mail/mail-autofilter.c | 37 |
1 files changed, 37 insertions, 0 deletions
diff --git a/mail/mail-autofilter.c b/mail/mail-autofilter.c index fe48b1777a..8084b226f1 100644 --- a/mail/mail-autofilter.c +++ b/mail/mail-autofilter.c @@ -223,6 +223,29 @@ rule_match_mlist(RuleContext *context, FilterRule *rule, const char *mlist) } 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; @@ -293,6 +316,20 @@ em_vfolder_rule_from_message (EMVFolderContext *context, CamelMimeMessage *msg, } 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; +} + +FilterRule * filter_rule_from_message (EMFilterContext *context, CamelMimeMessage *msg, int flags) { EMFilterRule *rule; |