From e64003fb707be425164d6dba2a4712f29c4ffad7 Mon Sep 17 00:00:00 2001 From: "S.Antony Vincent Pandian" Date: Mon, 26 Sep 2005 06:23:19 +0000 Subject: Fixes #208647 2005-09-26 S.Antony Vincent Pandian Fixes #208647 * em-folder-tree.c : Have added a menu item Empty Trash in the folder tree's context menu and also added its callback. svn path=/trunk/; revision=30373 --- mail/em-folder-tree.c | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) (limited to 'mail/em-folder-tree.c') diff --git a/mail/em-folder-tree.c b/mail/em-folder-tree.c index 29142c596a..0fdd1a65bf 100644 --- a/mail/em-folder-tree.c +++ b/mail/em-folder-tree.c @@ -2012,6 +2012,12 @@ emft_popup_rename_folder (EPopup *ep, EPopupItem *pitem, void *data) } } +static void +emft_popup_empty_trash (EPopup *ep, EPopupItem *pitem, void *data) +{ + em_utils_empty_trash (data); +} + static void emft_popup_properties (EPopup *ep, EPopupItem *pitem, void *data) { @@ -2051,6 +2057,7 @@ static EPopupItem emft_popup_items[] = { { E_POPUP_BAR, "80.emc" }, { E_POPUP_ITEM, "80.emc.00", N_("_Properties"), emft_popup_properties, NULL, "stock_folder-properties", 0, EM_POPUP_FOLDER_FOLDER|EM_POPUP_FOLDER_SELECT } }; +static EPopupItem trash_popup_item = {E_POPUP_ITEM, "20.emc.03", N_("_Empty Trash"), emft_popup_empty_trash,NULL,NULL, 1, EM_POPUP_FOLDER_FOLDER|EM_POPUP_FOLDER_SELECT}; static void emft_popup_free(EPopup *ep, GSList *items, void *data) @@ -2070,6 +2077,7 @@ emft_popup (EMFolderTree *emft, GdkEvent *event) GSList *menus = NULL; guint32 info_flags = 0; guint32 flags = 0; + guint32 folder_type_flags = 0; gboolean isstore; char *uri, *full_name; GtkMenu *menu; @@ -2088,7 +2096,7 @@ emft_popup (EMFolderTree *emft, GdkEvent *event) gtk_tree_model_get (model, &iter, COL_POINTER_CAMEL_STORE, &store, COL_STRING_URI, &uri, COL_STRING_FULL_NAME, &full_name, - COL_BOOL_IS_STORE, &isstore, -1); + COL_BOOL_IS_STORE, &isstore, COL_UINT_FLAGS, &folder_type_flags, -1); /* Stores have full_name == NULL, otherwise its just a placeholder */ /* NB: This is kind of messy */ @@ -2129,6 +2137,9 @@ emft_popup (EMFolderTree *emft, GdkEvent *event) for (i = 0; i < sizeof (emft_popup_items) / sizeof (emft_popup_items[0]); i++) menus = g_slist_prepend (menus, &emft_popup_items[i]); + if ((folder_type_flags & CAMEL_FOLDER_TYPE_MASK) == CAMEL_FOLDER_TYPE_TRASH) + menus = g_slist_prepend (menus, &trash_popup_item); + e_popup_add_items ((EPopup *)emp, menus, NULL, emft_popup_free, emft); menu = e_popup_create_menu_once ((EPopup *)emp, (EPopupTarget *)target, 0); -- cgit