diff options
author | Srinivasa Ragavan <sragavan@src.gnome.org> | 2007-07-04 03:08:03 +0800 |
---|---|---|
committer | Srinivasa Ragavan <sragavan@src.gnome.org> | 2007-07-04 03:08:03 +0800 |
commit | 2a1f72d4008b5ad48129846f689d30b63450b9f9 (patch) | |
tree | ca8a6172bb540295e71011647bcd342033831b4c | |
parent | 24c422f89dcba8b085bc15ea6e3230d85472f4e9 (diff) | |
download | gsoc2013-evolution-2a1f72d4008b5ad48129846f689d30b63450b9f9.tar gsoc2013-evolution-2a1f72d4008b5ad48129846f689d30b63450b9f9.tar.gz gsoc2013-evolution-2a1f72d4008b5ad48129846f689d30b63450b9f9.tar.bz2 gsoc2013-evolution-2a1f72d4008b5ad48129846f689d30b63450b9f9.tar.lz gsoc2013-evolution-2a1f72d4008b5ad48129846f689d30b63450b9f9.tar.xz gsoc2013-evolution-2a1f72d4008b5ad48129846f689d30b63450b9f9.tar.zst gsoc2013-evolution-2a1f72d4008b5ad48129846f689d30b63450b9f9.zip |
** Added the hook for plugging into Send/Receive dialog for the
Evolution RSS plugin.
svn path=/trunk/; revision=33749
-rw-r--r-- | mail/ChangeLog | 9 | ||||
-rw-r--r-- | mail/em-event.c | 19 | ||||
-rw-r--r-- | mail/em-event.h | 19 | ||||
-rw-r--r-- | mail/mail-send-recv.c | 12 |
4 files changed, 57 insertions, 2 deletions
diff --git a/mail/ChangeLog b/mail/ChangeLog index 26cdbdeacd..37ecdd21f0 100644 --- a/mail/ChangeLog +++ b/mail/ChangeLog @@ -1,3 +1,12 @@ +2007-07-04 Srinivasa Ragavan <sragavan@novell.com> + + ** Added the hook for plugging into Send/Receive dialog for the + Evolution RSS plugin. + + * em-event.c: (em_event_target_new_send_receive): + * em-event.h: + * mail-send-recv.c: (build_dialog), (mail_send_receive): + 2007-07-03 simon.zheng <simon.zheng@sun.com> ** Fix for bug #453294 diff --git a/mail/em-event.c b/mail/em-event.c index b139302a3d..eed4e32ebb 100644 --- a/mail/em-event.c +++ b/mail/em-event.c @@ -176,6 +176,19 @@ em_event_target_new_message(EMEvent *eme, CamelFolder *folder, CamelMimeMessage return t; } +EMEventTargetSendReceive * +em_event_target_new_send_receive(EMEvent *eme, GtkWidget *table, gpointer *data, int row, guint32 flags) +{ + EMEventTargetSendReceive *t = e_event_target_new(&eme->popup, EM_EVENT_TARGET_SEND_RECEIVE, sizeof(*t)); + + t->table = table; + t->data = data; + t->row = row; + t->target.mask = ~flags; + + return t; +} + /* ********************************************************************** */ static void *emeh_parent_class; @@ -197,10 +210,16 @@ static const EEventHookTargetMask emeh_message_masks[] = { { 0 } }; +static const EEventHookTargetMask emeh_send_receive_masks[] = { + { "sendreceive", EM_EVENT_SEND_RECEIVE }, + { 0 } +}; + static const EEventHookTargetMap emeh_targets[] = { { "folder", EM_EVENT_TARGET_FOLDER, emeh_folder_masks }, { "message", EM_EVENT_TARGET_MESSAGE, emeh_message_masks }, { "composer", EM_EVENT_TARGET_COMPOSER, emeh_composer_masks}, + { "sendreceive", EM_EVENT_TARGET_SEND_RECEIVE, emeh_send_receive_masks}, { 0 } }; diff --git a/mail/em-event.h b/mail/em-event.h index 90bb23dca4..7ad3f693a9 100644 --- a/mail/em-event.h +++ b/mail/em-event.h @@ -35,6 +35,7 @@ extern "C" { struct _CamelFolder; struct _CamelMimeMessage; struct _EMsgComposer; +struct _GtkWidget; typedef struct _EMEvent EMEvent; typedef struct _EMEventClass EMEventClass; @@ -44,6 +45,7 @@ enum _em_event_target_t { EM_EVENT_TARGET_FOLDER, EM_EVENT_TARGET_MESSAGE, EM_EVENT_TARGET_COMPOSER, + EM_EVENT_TARGET_SEND_RECEIVE, }; /* Flags that describe TARGET_FOLDER */ @@ -61,6 +63,11 @@ enum { EM_EVENT_COMPOSER_SEND_OPTION = 1<< 0, }; +/* Flags that describe TARGET_SEND_RECEIVE*/ +enum { + EM_EVENT_SEND_RECEIVE = 1<< 0, +}; + typedef struct _EMEventTargetFolder EMEventTargetFolder; struct _EMEventTargetFolder { @@ -87,6 +94,17 @@ struct _EMEventTargetComposer { struct _EMsgComposer *composer; }; +typedef struct _EMEventTargetSendReceive EMEventTargetSendReceive; + +struct _EMEventTargetSendReceive { + EEventTarget target; + + struct _GtkWidget *table; + gpointer *data; + int row; +}; + + typedef struct _EEventItem EMEventItem; /* The object */ @@ -107,6 +125,7 @@ EMEvent *em_event_peek(void); EMEventTargetFolder *em_event_target_new_folder(EMEvent *emp, const char *uri, guint32 flags); EMEventTargetComposer *em_event_target_new_composer(EMEvent *emp, const struct _EMsgComposer *composer, guint32 flags); EMEventTargetMessage *em_event_target_new_message(EMEvent *emp, struct _CamelFolder *folder, struct _CamelMimeMessage *message, const char *uid, guint32 flags); +EMEventTargetSendReceive * em_event_target_new_send_receive(EMEvent *eme, struct _GtkWidget *table, gpointer *data, int row, guint32 flags); /* ********************************************************************** */ diff --git a/mail/mail-send-recv.c b/mail/mail-send-recv.c index dbaee11c61..c7fa00655f 100644 --- a/mail/mail-send-recv.c +++ b/mail/mail-send-recv.c @@ -56,6 +56,7 @@ #include "mail-ops.h" #include "mail-send-recv.h" #include "mail-folder-cache.h" +#include "em-event.h" #include <e-util/e-icon-factory.h> #define d(x) @@ -381,7 +382,8 @@ build_dialog (EAccountList *accounts, CamelFolder *outbox, const char *destinati EAccount *account; EIterator *iter; GList *icon_list; - + EMEventTargetSendReceive *target; + gd = (GtkDialog *)(send_recv_dialog = gtk_dialog_new_with_buttons(_("Send & Receive Mail"), NULL, GTK_DIALOG_NO_SEPARATOR, NULL)); gtk_window_set_modal ((GtkWindow *) gd, FALSE); @@ -535,6 +537,10 @@ build_dialog (EAccountList *accounts, CamelFolder *outbox, const char *destinati g_object_unref (iter); + /* Hook: If some one wants to hook on to the sendreceive dialog, this is the way to go. */ + target = em_event_target_new_send_receive (em_event_peek(), table, data, row, EM_EVENT_SEND_RECEIVE); + e_event_emit (em_event_peek(), "mail.sendreceive", target); + if (outbox && destination) { info = g_hash_table_lookup (data->active, SEND_URI_KEY); if (info == NULL) { @@ -936,7 +942,9 @@ mail_send_receive (void) mail_get_store(info->uri, info->cancel, receive_update_got_store, info); break; default: - g_assert_not_reached (); + /* Commented for pluggable hooks*/ + /* g_assert_not_reached () */ + break; } scan = scan->next; } |