for status strack removed "Item" tag entries, included a factory method

2005-07-29  Vivek Jain <jvivek@novell.com>

	* org-gnome-groupwise-features.eplug.xml:
	for status strack  removed "Item" tag entries, included a factory method

	* status-track.c :  (org_gnome_track_status): converted to
	 factory method to add the item, moved most of its code to
	new function (track_status), which is a callback for the click
	 **Fixes #311721

svn path=/trunk/; revision=29927
This commit is contained in:
Vivek Jain
2005-07-29 05:34:17 +00:00
committed by Jain Vivek
parent 63780df37c
commit dbedd2f1d1
3 changed files with 58 additions and 27 deletions

View File

@ -1,3 +1,13 @@
2005-07-29 Vivek Jain <jvivek@novell.com>
* org-gnome-groupwise-features.eplug.xml:
for status strack removed "Item" tag entries, included a factory method
* status-track.c : (org_gnome_track_status): converted to
factory method to add the item, moved most of its code to
new function (track_status), which is a callback for the click
**Fixes #311721
2005-07-27 Sankar P <psankar@novell.com>
* org-gnome-groupwise-features.eplug.xml: Added the hook for

View File

@ -43,15 +43,7 @@
<menu id="org.gnome.evolution.mail.foldertree.popup" target="folder" factory = "org_gnome_create_option">
</menu>
<menu id="org.gnome.evolution.mail.folderview.popup" target="select" factory = "org_gnome_junk_settings"/>
<menu id="org.gnome.evolution.mail.folderview.popup" target="select">
<item
type="item"
path="21.gw_status_tracking"
label="Track Message Status"
enable="one"
visible="one"
activate="org_gnome_track_status"/>
</menu>
<menu id="org.gnome.evolution.mail.folderview.popup" target="select" factory = "org_gnome_track_status"/>
</hook>
<hook class="org.gnome.evolution.addressbook.config:1.0">
<group

View File

@ -32,7 +32,8 @@
#include "camel/camel-folder.h"
#include "camel/camel-medium.h"
#include "camel/camel-mime-message.h"
#include "mail/em-popup.h"
#include <mail/em-popup.h>
#include <mail/em-folder-view.h>
#include <e-gw-connection.h>
@ -68,13 +69,11 @@ add_detail (GtkTable *table, char *label, char *value, int row)
row++;
return row ;
}
/*
* The format for the options is:
* 0 1 2 3 4 5 6 7 8 9
* X-gw-status-opt: /TO/CC/BCC;name;email;delivered;opened;accepted;deleted;declined;completed;undelivered::
*/
void org_gnome_track_status (void *ep, EMPopupTargetSelect *t)
static void
track_status (EPopup *ep, EPopupItem *item, void *data)
{
EMPopupTargetSelect *t = (EMPopupTargetSelect *)data;
CamelMimeMessage *msg = NULL ;
const CamelInternetAddress *from ;
const char *namep, *addp ;
@ -94,17 +93,6 @@ void org_gnome_track_status (void *ep, EMPopupTargetSelect *t)
int row = 0;
/*check if it is a groupwise account*/
str = strstr (t->uri, "groupwise") ;
if (!str) {
g_warning ("Status tracking available for groupwise account only") ;
return ;
}
str = strstr (t->uri, "Sent Items") ;
if (!str) {
g_warning ("Status tracking available for a sent folder only") ;
return ;
}
/*Get message*/
msg = camel_folder_get_message (t->folder, g_ptr_array_index (t->uids, 0), NULL);
if (!msg) {
@ -235,3 +223,44 @@ void org_gnome_track_status (void *ep, EMPopupTargetSelect *t)
g_strfreev (temp1) ;
}
/*
* The format for the options is:
* 0 1 2 3 4 5 6 7 8 9
* X-gw-status-opt: /TO/CC/BCC;name;email;delivered;opened;accepted;deleted;declined;completed;undelivered::
*/
static EPopupItem popup_items[] = {
{ E_POPUP_ITEM, "50.emfv.05", N_("Track Message Status..."), track_status, NULL, NULL, 0, EM_POPUP_SELECT_ONE|EM_FOLDER_VIEW_SELECT_LISTONLY}
};
static void
popup_free (EPopup *ep, GSList *items, void *data)
{
g_slist_free (items);
}
void org_gnome_track_status (void *ep, EMPopupTargetSelect *t)
{
GSList *menus = NULL;
int i = 0;
static int first = 0;
if (! g_strrstr (t->uri, "groupwise://") || g_ascii_strncasecmp ((t->folder)->full_name, "Sent Items", 10))
return;
/* for translation*/
if (!first) {
popup_items[0].label = _(popup_items[0].label);
}
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);
}