From a9ce8971bd4898b129fd6ff7e622204f3798ebaf Mon Sep 17 00:00:00 2001 From: Jeffrey Stedfast Date: Wed, 18 Feb 2004 20:36:53 +0000 Subject: Pass flags to em_popup_target_new_folder() instead of just an isstore arg. 2004-02-18 Jeffrey Stedfast * em-folder-tree.c (emft_tree_button_press): Pass flags to em_popup_target_new_folder() instead of just an isstore arg. (emft_tree_button_press): Fake the fi flags for vTrash/vJunk so that em-popup.c can disable the delete flag for these. svn path=/trunk/; revision=24787 --- mail/ChangeLog | 2 ++ mail/em-folder-tree.c | 7 ++++++- 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/mail/ChangeLog b/mail/ChangeLog index a2bae13be6..d68f31dca7 100644 --- a/mail/ChangeLog +++ b/mail/ChangeLog @@ -2,6 +2,8 @@ * em-folder-tree.c (emft_tree_button_press): Pass flags to em_popup_target_new_folder() instead of just an isstore arg. + (emft_tree_button_press): Fake the fi flags for vTrash/vJunk so + that em-popup.c can disable the delete flag for these. * em-popup.c (em_popup_target_new_folder): Instead of taking an isstore argument, take a flags argument so that our caller can diff --git a/mail/em-folder-tree.c b/mail/em-folder-tree.c index 28f70ac3b4..fa537761ab 100644 --- a/mail/em-folder-tree.c +++ b/mail/em-folder-tree.c @@ -2209,6 +2209,7 @@ emft_tree_button_press (GtkWidget *treeview, GdkEventButton *event, EMFolderTree GtkTreeModel *model; GtkTreeIter iter; GSList *menus = NULL; + guint32 info_flags = 0; guint32 flags = 0; gboolean isstore; char *uri, *path; @@ -2242,11 +2243,15 @@ emft_tree_button_press (GtkWidget *treeview, GdkEventButton *event, EMFolderTree if (!(store == local && is_special_local_folder (folder_name))) flags |= EM_POPUP_FOLDER_DELETE; + /* hack for vTrash/vJunk */ + if (!strcmp (folder_name, CAMEL_VTRASH_NAME) || !strcmp (folder_name, CAMEL_VJUNK_NAME)) + info_flags |= CAMEL_FOLDER_VIRTUAL | CAMEL_FOLDER_NOINFERIORS; + /* handle right-click by opening a context menu */ emp = em_popup_new ("com.ximian.mail.storageset.popup.select"); /* FIXME: pass valid fi->flags here */ - target = em_popup_target_new_folder (uri, /* fi->flags */ 0, flags); + target = em_popup_target_new_folder (uri, info_flags, flags); for (i = 0; i < sizeof (emft_popup_menu) / sizeof (emft_popup_menu[0]); i++) { EMPopupItem *item = &emft_popup_menu[i]; -- cgit v1.2.3