aboutsummaryrefslogtreecommitdiffstats
path: root/plugins
diff options
context:
space:
mode:
Diffstat (limited to 'plugins')
-rw-r--r--plugins/mail-to-task/ChangeLog11
-rw-r--r--plugins/mail-to-task/Makefile.am5
-rw-r--r--plugins/mail-to-task/mail-to-task.c57
-rw-r--r--plugins/mail-to-task/org-gnome-mail-to-task.eplug.xml13
-rw-r--r--plugins/mail-to-task/org-gnome-mail-to-task.xml16
5 files changed, 85 insertions, 17 deletions
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 <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.
+
2005-12-21 Chenthill Palanisamy <pchenthill@novell.com>
Committing for Hiroyuki Ikezoe <poincare@ikezoe.net>
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 <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);
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"/>
</menu>
</hook>
+ <hook class="org.gnome.evolution.mail.bonobomenu:1.0">
+ <menu id="org.gnome.evolution.mail.browser" target="select">
+ <!-- the path to the bonobo menu description -->
+ <ui file="@PLUGINDIR@/org-gnome-mail-to-task.xml"/>
+ <item
+ type="item"
+ verb="ConvertTask"
+ path="/commands/ConvertTask"
+ enable="one"
+ activate="org_gnome_mail_to_task_menu"/>
+ </menu>
+ </hook>
+
</e-plugin>
</e-plugin-list>
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 @@
+<Root>
+ <commands>
+ <cmd name="ConvertTask" _label="Con_vert to Task"
+ _tip="Convert the selected message to a new task"
+ pixtype="stock" pixname="stock_todo"/>
+ </commands>
+
+ <menu>
+ <placeholder name="MessagePlaceholder">
+ <submenu name="Message">
+ <separator f="" name="emaillist5"/>
+ <menuitem name="ConvertTask" verb=""/>
+ </submenu>
+ </placeholder>
+ </menu>
+</Root>