From cf100885d02d81d8850ef58936776bf161f99ad6 Mon Sep 17 00:00:00 2001 From: Srinivasa Ragavan Date: Sat, 14 Jan 2006 07:05:08 +0000 Subject: ** Fixes bug #323011 2006-01-14 Srinivasa Ragavan ** Fixes bug #323011 * Makefile.am: Added org-gnome-mail-to-task.xml to build * mail-to-task.c (convert_to_task), (org_gnome_mail_to_task), (org_gnome_mail_to_task_menu): Added Code to handle menu. * org-gnome-mail-to-task.eplug.xml: Added plug to show Convert to Task menu item under Message menu. * org-gnome-mail-to-task.xml: Added UI files for menu item. svn path=/trunk/; revision=31179 --- plugins/mail-to-task/ChangeLog | 11 +++++ plugins/mail-to-task/Makefile.am | 5 +- plugins/mail-to-task/mail-to-task.c | 57 ++++++++++++++++------ .../mail-to-task/org-gnome-mail-to-task.eplug.xml | 13 +++++ plugins/mail-to-task/org-gnome-mail-to-task.xml | 16 ++++++ 5 files changed, 85 insertions(+), 17 deletions(-) create mode 100644 plugins/mail-to-task/org-gnome-mail-to-task.xml (limited to 'plugins') diff --git a/plugins/mail-to-task/ChangeLog b/plugins/mail-to-task/ChangeLog index d6005138c0..6460cfda09 100644 --- a/plugins/mail-to-task/ChangeLog +++ b/plugins/mail-to-task/ChangeLog @@ -1,3 +1,14 @@ +2006-01-14 Srinivasa Ragavan + + ** Fixes bug #323011 + + * Makefile.am: Added org-gnome-mail-to-task.xml to build + * mail-to-task.c (convert_to_task), (org_gnome_mail_to_task), + (org_gnome_mail_to_task_menu): Added Code to handle menu. + * org-gnome-mail-to-task.eplug.xml: Added plug to show Convert to Task + menu item under Message menu. + * org-gnome-mail-to-task.xml: Added UI files for menu item. + 2005-12-21 Chenthill Palanisamy Committing for Hiroyuki Ikezoe diff --git a/plugins/mail-to-task/Makefile.am b/plugins/mail-to-task/Makefile.am index 700f487c6d..8ad9856ce8 100644 --- a/plugins/mail-to-task/Makefile.am +++ b/plugins/mail-to-task/Makefile.am @@ -4,13 +4,14 @@ INCLUDES = \ @EVO_PLUGIN_RULE@ -plugin_DATA = org-gnome-mail-to-task.eplug +plugin_DATA = org-gnome-mail-to-task.eplug org-gnome-mail-to-task.xml plugin_LTLIBRARIES = liborg-gnome-mail-to-task.la liborg_gnome_mail_to_task_la_SOURCES = mail-to-task.c liborg_gnome_mail_to_task_la_LDFLAGS = -module -avoid-version -EXTRA_DIST = org-gnome-mail-to-task.eplug.xml +EXTRA_DIST = org-gnome-mail-to-task.eplug.xml \ + org-gnome-mail-to-task.xml BUILT_SOURCES = $(plugin_DATA) CLEANFILES = $(BUILT_SOURCES) diff --git a/plugins/mail-to-task/mail-to-task.c b/plugins/mail-to-task/mail-to-task.c index b22f766811..65261ccf46 100644 --- a/plugins/mail-to-task/mail-to-task.c +++ b/plugins/mail-to-task/mail-to-task.c @@ -23,6 +23,7 @@ #include #include #include +#include "mail/em-menu.h" #include "mail/em-popup.h" typedef struct { @@ -188,6 +189,7 @@ do_mail_to_task (AsyncData *data) } void org_gnome_mail_to_task (void *ep, EMPopupTargetSelect *t); +void org_gnome_mail_to_task_menu (EPlugin *ep, EMMenuTargetSelect *target); static void copy_uids (char *uid, GPtrArray *uid_array) @@ -195,24 +197,13 @@ copy_uids (char *uid, GPtrArray *uid_array) g_ptr_array_add (uid_array, g_strdup (uid)); } -void -org_gnome_mail_to_task (void *ep, EMPopupTargetSelect *t) +static void +convert_to_task (GPtrArray *uid_array, struct _CamelFolder *folder) { GtkWidget *dialog; GConfClient *conf_client; ESourceList *source_list; - GPtrArray *uid_array = NULL; - - if (t->uids->len > 0) { - /* FIXME Some how in the thread function the values inside t->uids gets freed - and are corrupted which needs to be fixed, this is sought of work around fix for - the gui inresponsiveness */ - uid_array = g_ptr_array_new (); - g_ptr_array_foreach (t->uids, (GFunc)copy_uids, (gpointer) uid_array); - } else { - return; - } - + /* ask the user which tasks list to save to */ conf_client = gconf_client_get_default (); source_list = e_source_list_new_for_gconf (conf_client, "/apps/evolution/tasks/sources"); @@ -246,7 +237,7 @@ org_gnome_mail_to_task (void *ep, EMPopupTargetSelect *t) /* Fill the elements in AsynData */ data = g_new0 (AsyncData, 1); data->client = client; - data->folder = t->folder; + data->folder = folder; data->uids = uid_array; thread = g_thread_create ((GThreadFunc) do_mail_to_task, data, FALSE, &error); @@ -261,6 +252,42 @@ org_gnome_mail_to_task (void *ep, EMPopupTargetSelect *t) g_object_unref (conf_client); g_object_unref (source_list); gtk_widget_destroy (dialog); + +} + +void +org_gnome_mail_to_task (void *ep, EMPopupTargetSelect *t) +{ + GPtrArray *uid_array = NULL; + + if (t->uids->len > 0) { + /* FIXME Some how in the thread function the values inside t->uids gets freed + and are corrupted which needs to be fixed, this is sought of work around fix for + the gui inresponsiveness */ + uid_array = g_ptr_array_new (); + g_ptr_array_foreach (t->uids, (GFunc)copy_uids, (gpointer) uid_array); + } else { + return; + } + + convert_to_task (uid_array, t->folder); +} + +void org_gnome_mail_to_task_menu (EPlugin *ep, EMMenuTargetSelect *t) +{ + GPtrArray *uid_array = NULL; + + if (t->uids->len > 0) { + /* FIXME Some how in the thread function the values inside t->uids gets freed + and are corrupted which needs to be fixed, this is sought of work around fix for + the gui inresponsiveness */ + uid_array = g_ptr_array_new (); + g_ptr_array_foreach (t->uids, (GFunc)copy_uids, (gpointer) uid_array); + } else { + return; + } + + convert_to_task (uid_array, t->folder); } int e_plugin_lib_enable(EPluginLib *ep, int enable); diff --git a/plugins/mail-to-task/org-gnome-mail-to-task.eplug.xml b/plugins/mail-to-task/org-gnome-mail-to-task.eplug.xml index e82afd1ecf..d28665c88d 100644 --- a/plugins/mail-to-task/org-gnome-mail-to-task.eplug.xml +++ b/plugins/mail-to-task/org-gnome-mail-to-task.eplug.xml @@ -21,5 +21,18 @@ activate="org_gnome_mail_to_task"/> + + + + + + + + diff --git a/plugins/mail-to-task/org-gnome-mail-to-task.xml b/plugins/mail-to-task/org-gnome-mail-to-task.xml new file mode 100644 index 0000000000..6b8033c8e5 --- /dev/null +++ b/plugins/mail-to-task/org-gnome-mail-to-task.xml @@ -0,0 +1,16 @@ + + + + + + + + + + + + + + -- cgit