diff options
author | Vivek Jain <jvivek@novell.com> | 2005-07-29 13:34:17 +0800 |
---|---|---|
committer | Jain Vivek <jvivek@src.gnome.org> | 2005-07-29 13:34:17 +0800 |
commit | dbedd2f1d19e0c8e9b8565a11eefea10233db2af (patch) | |
tree | 08afa409e88f1293ae70122b6aa1613d863b4876 | |
parent | 63780df37cc068f441247111f50f3d056a76b0d6 (diff) | |
download | gsoc2013-evolution-dbedd2f1d19e0c8e9b8565a11eefea10233db2af.tar.gz gsoc2013-evolution-dbedd2f1d19e0c8e9b8565a11eefea10233db2af.tar.zst gsoc2013-evolution-dbedd2f1d19e0c8e9b8565a11eefea10233db2af.zip |
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
-rw-r--r-- | plugins/groupwise-features/ChangeLog | 10 | ||||
-rw-r--r-- | plugins/groupwise-features/org-gnome-groupwise-features.eplug.xml | 10 | ||||
-rw-r--r-- | 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 <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 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 @@ <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 diff --git a/plugins/groupwise-features/status-track.c b/plugins/groupwise-features/status-track.c index e4b208a812..5accfae565 100644 --- a/plugins/groupwise-features/status-track.c +++ b/plugins/groupwise-features/status-track.c @@ -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); + +} |