diff options
-rw-r--r-- | mail/ChangeLog | 15 | ||||
-rw-r--r-- | mail/em-composer-utils.c | 8 | ||||
-rw-r--r-- | mail/em-event.c | 28 | ||||
-rw-r--r-- | mail/em-event.h | 15 | ||||
-rw-r--r-- | mail/em-folder-view.c | 2 |
5 files changed, 66 insertions, 2 deletions
diff --git a/mail/ChangeLog b/mail/ChangeLog index 4161d2da6e..a045865c04 100644 --- a/mail/ChangeLog +++ b/mail/ChangeLog @@ -1,3 +1,18 @@ +2004-10-21 Not Zed <NotZed@Ximian.com> + + * em-composer-utils.c (em_utils_reply_to_message): emit a + 'message.replying' event with a message target. + +2004-10-21 Nat <nat@novell.com> + + * em-event.c (em_event_target_new_message): new target type for + message-related events. + +2004-10-21 Not Zed <NotZed@Ximian.com> + + * em-folder-view.c (emfv_format_popup_event): put 'evolution' back + in the popup hook names. + 2004-10-19 JP Rosevear <jpr@novell.com> * em-account-editor.c, em-composer-prefs.c, em-config.c, diff --git a/mail/em-composer-utils.c b/mail/em-composer-utils.c index 3b723643bb..217aebdc57 100644 --- a/mail/em-composer-utils.c +++ b/mail/em-composer-utils.c @@ -45,6 +45,7 @@ #include "composer/e-msg-composer.h" #include "em-format-html.h" #include "em-format-quote.h" +#include "em-event.h" #include "e-util/e-account-list.h" @@ -1745,6 +1746,8 @@ em_utils_reply_to_message(CamelFolder *folder, const char *uid, CamelMimeMessage EAccount *account; const char *postto = NULL; guint32 flags; + EMEvent *eme; + EMEventTargetMessage *target; if (folder && uid && message == NULL) { struct _reply_data *rd = g_malloc0(sizeof(*rd)); @@ -1758,6 +1761,11 @@ em_utils_reply_to_message(CamelFolder *folder, const char *uid, CamelMimeMessage } g_return_if_fail(message != NULL); + + /* EVENT: message.replying definition */ + eme = em_event_peek(); + target = em_event_target_new_message(eme, folder, message, uid, 0); + e_event_emit((EEvent *)eme, "message.replying", (EEventTarget *)target); account = guess_account (message, folder); flags = CAMEL_MESSAGE_ANSWERED | CAMEL_MESSAGE_SEEN; diff --git a/mail/em-event.c b/mail/em-event.c index a41494dd43..279cd1acb9 100644 --- a/mail/em-event.c +++ b/mail/em-event.c @@ -68,6 +68,13 @@ eme_target_free(EEvent *ep, EEventTarget *t) g_free(s->uri); break; } + case EM_EVENT_TARGET_MESSAGE: { + EMEventTargetMessage *s = (EMEventTargetMessage *)t; + + g_object_unref(s->folder); + g_object_unref(s->message); + g_free(s->uid); + break; } } ((EEventClass *)eme_parent)->target_free(ep, t); @@ -130,6 +137,21 @@ em_event_target_new_folder (EMEvent *eme, const char *uri, guint32 flags) return t; } +EMEventTargetMessage * +em_event_target_new_message(EMEvent *eme, CamelFolder *folder, CamelMimeMessage *message, const char *uid, guint32 flags) +{ + EMEventTargetMessage *t = e_event_target_new(&eme->popup, EM_EVENT_TARGET_MESSAGE, sizeof(*t)); + + t->uid = g_strdup (uid); + t->folder = folder; + camel_object_ref(folder); + t->message = message; + camel_object_ref(message); + t->target.mask = ~flags; + + return t; +} + /* ********************************************************************** */ static void *emeh_parent_class; @@ -139,8 +161,14 @@ static const EEventHookTargetMask emeh_folder_masks[] = { { "newmail", EM_EVENT_FOLDER_NEWMAIL }, { 0 } }; + +static const EEventHookTargetMask emeh_message_masks[] = { + { 0 } +}; + static const EEventHookTargetMap emeh_targets[] = { { "folder", EM_EVENT_TARGET_FOLDER, emeh_folder_masks }, + { "message", EM_EVENT_TARGET_MESSAGE, emeh_message_masks }, { 0 } }; diff --git a/mail/em-event.h b/mail/em-event.h index 05c62d9f50..83b0d83b36 100644 --- a/mail/em-event.h +++ b/mail/em-event.h @@ -32,13 +32,16 @@ extern "C" { #pragma } #endif /* __cplusplus */ +struct _CamelFolder; +struct _CamelMimeMessage; + typedef struct _EMEvent EMEvent; typedef struct _EMEventClass EMEventClass; /* Current target description */ -/* Types of popup tagets */ enum _em_event_target_t { EM_EVENT_TARGET_FOLDER, + EM_EVENT_TARGET_MESSAGE, }; /* Flags that describe TARGET_FOLDER */ @@ -53,6 +56,15 @@ struct _EMEventTargetFolder { char *uri; }; +typedef struct _EMEventTargetMessage EMEventTargetMessage; + +struct _EMEventTargetMessage { + EEventTarget target; + struct _CamelFolder *folder; + char *uid; + struct _CamelMimeMessage *message; +}; + typedef struct _EEventItem EMEventItem; /* The object */ @@ -71,6 +83,7 @@ GType em_event_get_type(void); EMEvent *em_event_peek(void); EMEventTargetFolder *em_event_target_new_folder(EMEvent *emp, const char *uri, guint32 flags); +EMEventTargetMessage *em_event_target_new_message(EMEvent *emp, struct _CamelFolder *folder, struct _CamelMimeMessage *message, const char *uid, guint32 flags); /* ********************************************************************** */ diff --git a/mail/em-folder-view.c b/mail/em-folder-view.c index e1293428e3..61d5a4c1ab 100644 --- a/mail/em-folder-view.c +++ b/mail/em-folder-view.c @@ -2195,7 +2195,7 @@ emfv_format_popup_event(EMFormatHTMLDisplay *efhd, GdkEventButton *event, const /* FIXME: this maybe should just fit on em-html-display, it has access to the snooped part type */ - emp = em_popup_new("org.gnome.mail.folderview.popup.uri"); + emp = em_popup_new("org.gnome.evolution.mail.folderview.popup.uri"); if (part) target = (EPopupTarget *)em_popup_target_new_part(emp, part, NULL); else { |