From dbedd2f1d19e0c8e9b8565a11eefea10233db2af Mon Sep 17 00:00:00 2001 From: Vivek Jain Date: Fri, 29 Jul 2005 05:34:17 +0000 Subject: for status strack removed "Item" tag entries, included a factory method 2005-07-29 Vivek Jain * 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 --- plugins/groupwise-features/ChangeLog | 10 ++++ .../org-gnome-groupwise-features.eplug.xml | 10 +--- plugins/groupwise-features/status-track.c | 65 ++++++++++++++++------ 3 files changed, 58 insertions(+), 27 deletions(-) diff --git a/plugins/groupwise-features/ChangeLog b/plugins/groupwise-features/ChangeLog index 3e28878ed5..4e98487433 100644 --- a/plugins/groupwise-features/ChangeLog +++ b/plugins/groupwise-features/ChangeLog @@ -1,3 +1,13 @@ +2005-07-29 Vivek Jain + + * 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 * org-gnome-groupwise-features.eplug.xml: Added the hook for diff --git a/plugins/groupwise-features/org-gnome-groupwise-features.eplug.xml b/plugins/groupwise-features/org-gnome-groupwise-features.eplug.xml index eb9f31b569..7bc8028ef6 100644 --- a/plugins/groupwise-features/org-gnome-groupwise-features.eplug.xml +++ b/plugins/groupwise-features/org-gnome-groupwise-features.eplug.xml @@ -43,15 +43,7 @@ - - - + +#include #include @@ -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); + +} -- cgit v1.2.3