aboutsummaryrefslogtreecommitdiffstats
path: root/plugins/mail-to-task/mail-to-task.c
diff options
context:
space:
mode:
authorSrinivasa Ragavan <sragavan@novell.com>2006-01-14 15:05:08 +0800
committerSrinivasa Ragavan <sragavan@src.gnome.org>2006-01-14 15:05:08 +0800
commitcf100885d02d81d8850ef58936776bf161f99ad6 (patch)
tree9c52ef118e05f1807697ac591a60849f532c8cd7 /plugins/mail-to-task/mail-to-task.c
parenta3050eb44cc5c1c1c07e6981f8ca8fba365ed829 (diff)
downloadgsoc2013-evolution-cf100885d02d81d8850ef58936776bf161f99ad6.tar
gsoc2013-evolution-cf100885d02d81d8850ef58936776bf161f99ad6.tar.gz
gsoc2013-evolution-cf100885d02d81d8850ef58936776bf161f99ad6.tar.bz2
gsoc2013-evolution-cf100885d02d81d8850ef58936776bf161f99ad6.tar.lz
gsoc2013-evolution-cf100885d02d81d8850ef58936776bf161f99ad6.tar.xz
gsoc2013-evolution-cf100885d02d81d8850ef58936776bf161f99ad6.tar.zst
gsoc2013-evolution-cf100885d02d81d8850ef58936776bf161f99ad6.zip
** Fixes bug #323011
2006-01-14 Srinivasa Ragavan <sragavan@novell.com> ** 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
Diffstat (limited to 'plugins/mail-to-task/mail-to-task.c')
-rw-r--r--plugins/mail-to-task/mail-to-task.c57
1 files changed, 42 insertions, 15 deletions
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 <camel/camel-mime-message.h>
#include <camel/camel-stream.h>
#include <camel/camel-stream-mem.h>
+#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);