aboutsummaryrefslogtreecommitdiffstats
path: root/plugins/groupwise-features
diff options
context:
space:
mode:
authorSankar P <psankar@novell.com>2006-07-17 16:13:31 +0800
committerSankarasivasubramanian Pasupathilingam <psankar@src.gnome.org>2006-07-17 16:13:31 +0800
commitda64d1035ced76cd973f29d14a54f0e5372fe130 (patch)
tree754dd101172d3c857f81413558934ae0f2a937d0 /plugins/groupwise-features
parent2ff305262ba811264e63a226224dcda7e194324b (diff)
downloadgsoc2013-evolution-da64d1035ced76cd973f29d14a54f0e5372fe130.tar
gsoc2013-evolution-da64d1035ced76cd973f29d14a54f0e5372fe130.tar.gz
gsoc2013-evolution-da64d1035ced76cd973f29d14a54f0e5372fe130.tar.bz2
gsoc2013-evolution-da64d1035ced76cd973f29d14a54f0e5372fe130.tar.lz
gsoc2013-evolution-da64d1035ced76cd973f29d14a54f0e5372fe130.tar.xz
gsoc2013-evolution-da64d1035ced76cd973f29d14a54f0e5372fe130.tar.zst
gsoc2013-evolution-da64d1035ced76cd973f29d14a54f0e5372fe130.zip
Added support for GroupWise Message Retract mail-retract.c,
2006-07-17 Sankar P <psankar@novell.com> * Added support for GroupWise Message Retract * Files added: mail-retract.c, org-gnome-mail-retract-errors.xml * Files modified: org-gnome-groupwise-features.eplug.xml, Makefile.am svn path=/trunk/; revision=32325
Diffstat (limited to 'plugins/groupwise-features')
-rw-r--r--plugins/groupwise-features/ChangeLog6
-rw-r--r--plugins/groupwise-features/Makefile.am9
-rw-r--r--plugins/groupwise-features/mail-retract.c92
-rw-r--r--plugins/groupwise-features/org-gnome-groupwise-features.eplug.xml7
-rw-r--r--plugins/groupwise-features/org-gnome-mail-retract-errors.xml8
5 files changed, 118 insertions, 4 deletions
diff --git a/plugins/groupwise-features/ChangeLog b/plugins/groupwise-features/ChangeLog
index 227dfce6f7..752ced4961 100644
--- a/plugins/groupwise-features/ChangeLog
+++ b/plugins/groupwise-features/ChangeLog
@@ -1,3 +1,9 @@
+2006-07-17 Sankar P <psankar@novell.com>
+
+ * Added support for GroupWise Message Retract
+ * Files added: mail-retract.c, org-gnome-mail-retract-errors.xml
+ * Files modified: org-gnome-groupwise-features.eplug.xml, Makefile.am
+
2006-06-29 Andre Klapper <a9016009@gmx.de>
* proxy-login.c: add translator comments to the string "Proxy
diff --git a/plugins/groupwise-features/Makefile.am b/plugins/groupwise-features/Makefile.am
index 138945bfb3..3ece8b0569 100644
--- a/plugins/groupwise-features/Makefile.am
+++ b/plugins/groupwise-features/Makefile.am
@@ -38,7 +38,8 @@ liborg_gnome_groupwise_features_la_SOURCES = \
proxy.c \
proxy-login.h \
proxy-login.c \
- process-meeting.c
+ process-meeting.c \
+ mail-retract.c
liborg_gnome_groupwise_features_la_LIBADD= \
$(top_builddir)/e-util/libeutil.la \
@@ -64,7 +65,8 @@ glade_DATA = \
error_DATA = \
org-gnome-shared-folder.errors.xml \
org-gnome-proxy-errors.xml \
- org-gnome-proxy-login-errors.xml
+ org-gnome-proxy-login-errors.xml \
+ org-gnome-mail-retract-errors.xml
errordir = $(privdatadir)/errors
@@ -75,6 +77,7 @@ EXTRA_DIST = \
$(glade_DATA) \
org-gnome-compose-send-options.xml \
org-gnome-groupwise-features.eplug.xml \
- org-gnome-proxy-login-errors.xml
+ org-gnome-proxy-login-errors.xml \
+ org-gnome-mail-retract-errors.xml
CLEANFILES = $(BUILT_SOURCES)
diff --git a/plugins/groupwise-features/mail-retract.c b/plugins/groupwise-features/mail-retract.c
new file mode 100644
index 0000000000..a4580d3f5f
--- /dev/null
+++ b/plugins/groupwise-features/mail-retract.c
@@ -0,0 +1,92 @@
+/* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*-
+ *
+ * Author:
+ * Sankar P ( psankar@novell.com )
+ *
+ * Copyright 2004 Novell, Inc. (www.novell.com)
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of version 2 of the GNU General Public
+ * License as published by the Free Software Foundation.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Street #330, Boston, MA 02111-1307, USA.
+ *
+ */
+
+#ifdef HAVE_CONFIG_H
+#include <config.h>
+#endif
+
+#include <mail/em-popup.h>
+#include <mail/em-folder-view.h>
+#include <glib/gi18n-lib.h>
+#include <share-folder.h>
+#include <e-gw-connection.h>
+#include <camel/camel-store.h>
+#include <camel/camel-folder.h>
+#include <e-util/e-error.h>
+
+void org_gnome_retract_message (EPlugin *ep, EMPopupTargetSelect *t);
+
+
+static void retract_mail_settings (EPopup *ep, EPopupItem *item, void *data)
+{
+ EGwConnection *cnc;
+ CamelFolder *folder = (CamelFolder *)data;
+ CamelStore *store = folder->parent_store;
+ char *id;
+
+ cnc = get_cnc (store);
+ id = (char *)item->user_data;
+
+ if (e_gw_connection_retract_request (cnc, id, NULL, FALSE, FALSE) != E_GW_CONNECTION_STATUS_OK )
+ e_error_run (NULL, "org.gnome.evolution.message.retract:retract-failure", NULL);
+ else {
+ GtkWidget *dialog;
+ dialog = gtk_message_dialog_new (NULL, GTK_DIALOG_MODAL, GTK_MESSAGE_INFO, GTK_BUTTONS_CLOSE, "Message retracted succesfully");
+ gtk_dialog_run (GTK_DIALOG(dialog));
+ gtk_widget_destroy (dialog);
+ }
+}
+
+static EPopupItem popup_items[] = {
+{ E_POPUP_ITEM, "50.emfv.06", N_("Retract Mail"), retract_mail_settings, NULL, NULL, 0, EM_POPUP_SELECT_MANY|EM_FOLDER_VIEW_SELECT_LISTONLY}
+};
+
+static void popup_free (EPopup *ep, GSList *items, void *data)
+{
+ g_slist_free (items);
+}
+
+void org_gnome_retract_message (EPlugin *ep, EMPopupTargetSelect *t)
+{
+ GSList *menus = NULL;
+ GPtrArray *uids;
+ int i = 0;
+ static int first = 0;
+
+ uids = t->uids;
+ if (g_strrstr (t->uri, "groupwise://") && !g_ascii_strcasecmp((t->folder)->full_name, "Sent Items")) {
+
+ /* for translation*/
+ if (!first) {
+ popup_items[0].label = _(popup_items[0].label);
+ popup_items[0].user_data = g_strdup((char *) g_ptr_array_index(uids, 0));
+ }
+
+ first++;
+
+ for (i = 0; i < sizeof (popup_items) / sizeof (popup_items[0]); i++)
+ menus = g_slist_prepend (menus, &popup_items[i]);
+
+ e_popup_add_items (t->target.popup, menus, NULL, popup_free, t->folder);
+ }
+ return ;
+}
diff --git a/plugins/groupwise-features/org-gnome-groupwise-features.eplug.xml b/plugins/groupwise-features/org-gnome-groupwise-features.eplug.xml
index 7bc8028ef6..1d0bffec73 100644
--- a/plugins/groupwise-features/org-gnome-groupwise-features.eplug.xml
+++ b/plugins/groupwise-features/org-gnome-groupwise-features.eplug.xml
@@ -93,7 +93,12 @@
<menu id="org.gnome.evolution.calendar.view.popup" target="select" factory = "org_gnome_accept">
</menu>
</hook>
-
+
+ <hook class="org.gnome.evolution.mail.popup:1.0">
+ <menu id="org.gnome.evolution.mail.folderview.popup" target="select"
+ factory = "org_gnome_retract_message">
+ </menu>
+ </hook>
</e-plugin>
diff --git a/plugins/groupwise-features/org-gnome-mail-retract-errors.xml b/plugins/groupwise-features/org-gnome-mail-retract-errors.xml
new file mode 100644
index 0000000000..37cc8c8eed
--- /dev/null
+++ b/plugins/groupwise-features/org-gnome-mail-retract-errors.xml
@@ -0,0 +1,8 @@
+<?xml version="1.0" encoding="UTF-8"?>
+
+<error-list domain="org.gnome.evolution.message.retract">
+ <error id="retract-failure" type="error">
+ <primary>Message retract failed</primary>
+ <secondary>The server did not allow the selected message to be retracted.</secondary>
+ </error>
+</error-list>