[evolution-patches] Fix for enabling menu/popup/toolbutton for JUNK messages



Hi,

I have attached the patch that enable/disables the menu/popup/toolbutton
wrt the message flags.

-Srini.

Index: ChangeLog
===================================================================
RCS file: /cvs/gnome/evolution/mail/ChangeLog,v
retrieving revision 1.3716
diff -u -p -r1.3716 ChangeLog
--- ChangeLog	29 Sep 2005 08:35:57 -0000	1.3716
+++ ChangeLog	3 Oct 2005 08:56:14 -0000
@@ -1,3 +1,10 @@
+2005-10-03  Srinivasa Ragavan <sragavan novell com>
+
+	* em-folder-view.c (emfv_ena) (emfv_popup_items): Mark visible with
+	  junk flags as well.
+	* em-popup.[ch] (em_popup_target_new_select): Set the flags
+	  for junk respectively.
+	
 2005-09-29  Parthasarathi Susarla <sparthasarathi novell com>
 	
 	** See bug 317284
Index: em-folder-view.c
===================================================================
RCS file: /cvs/gnome/evolution/mail/em-folder-view.c,v
retrieving revision 1.132
diff -u -p -r1.132 em-folder-view.c
--- em-folder-view.c	28 Sep 2005 10:34:18 -0000	1.132
+++ em-folder-view.c	3 Oct 2005 08:56:14 -0000
@@ -1056,8 +1056,8 @@ static EPopupItem emfv_popup_items[] = {
 	{ E_POPUP_ITEM, "50.emfv.01", N_("Mark as _Unread"), emfv_popup_mark_unread, NULL, "stock_mail-unread", EM_POPUP_SELECT_MARK_UNREAD|EM_FOLDER_VIEW_SELECT_LISTONLY },
 	{ E_POPUP_ITEM, "50.emfv.02", N_("Mark as _Important"), emfv_popup_mark_important, NULL, "stock_mail-priority-high", EM_POPUP_SELECT_MARK_IMPORTANT|EM_FOLDER_VIEW_SELECT_LISTONLY },
 	{ E_POPUP_ITEM, "50.emfv.03", N_("_Mark as Unimportant"), emfv_popup_mark_unimportant, NULL, NULL, EM_POPUP_SELECT_MARK_UNIMPORTANT|EM_FOLDER_VIEW_SELECT_LISTONLY },
-	{ E_POPUP_ITEM, "50.emfv.04", N_("Mark as _Junk"), emfv_popup_mark_junk, NULL, "stock_spam", EM_POPUP_SELECT_MANY|EM_FOLDER_VIEW_SELECT_LISTONLY },
-	{ E_POPUP_ITEM, "50.emfv.05", N_("Mark as _Not Junk"), emfv_popup_mark_nojunk, NULL, "stock_not-spam", EM_POPUP_SELECT_MANY|EM_FOLDER_VIEW_SELECT_LISTONLY },
+	{ E_POPUP_ITEM, "50.emfv.04", N_("Mark as _Junk"), emfv_popup_mark_junk, NULL, "stock_spam", EM_POPUP_SELECT_MANY|EM_FOLDER_VIEW_SELECT_LISTONLY|EM_POPUP_SELECT_JUNK },
+	{ E_POPUP_ITEM, "50.emfv.05", N_("Mark as _Not Junk"), emfv_popup_mark_nojunk, NULL, "stock_not-spam", EM_POPUP_SELECT_MANY|EM_FOLDER_VIEW_SELECT_LISTONLY|EM_POPUP_SELECT_NOT_JUNK },
 	{ E_POPUP_ITEM, "50.emfv.06", N_("Mark for Follo_w Up..."), emfv_popup_flag_followup, NULL, "stock_mail-flag-for-followup",  EM_POPUP_SELECT_FLAG_FOLLOWUP|EM_FOLDER_VIEW_SELECT_LISTONLY },
 
 	{ E_POPUP_SUBMENU, "60.label.00", N_("Label"), NULL, NULL, NULL, EM_POPUP_SELECT_MANY|EM_FOLDER_VIEW_SELECT_LISTONLY },
@@ -1770,8 +1770,8 @@ static const EMFolderViewEnable emfv_ena
 	{ "MessageMarkAsUnRead",      EM_POPUP_SELECT_MANY|EM_POPUP_SELECT_MARK_UNREAD },
 	{ "MessageMarkAsImportant",   EM_POPUP_SELECT_MANY|EM_POPUP_SELECT_MARK_IMPORTANT },
 	{ "MessageMarkAsUnimportant", EM_POPUP_SELECT_MANY|EM_POPUP_SELECT_MARK_UNIMPORTANT },
-	{ "MessageMarkAsJunk",        EM_POPUP_SELECT_MANY },
-	{ "MessageMarkAsNotJunk",     EM_POPUP_SELECT_MANY },
+	{ "MessageMarkAsJunk",        EM_POPUP_SELECT_MANY|EM_POPUP_SELECT_JUNK },
+	{ "MessageMarkAsNotJunk",     EM_POPUP_SELECT_MANY|EM_POPUP_SELECT_NOT_JUNK },
 	{ "MessageFollowUpFlag",      EM_POPUP_SELECT_MANY },
 	{ "MessageMove",              EM_POPUP_SELECT_MANY },
 	{ "MessageOpen",              EM_POPUP_SELECT_MANY },
Index: em-popup.c
===================================================================
RCS file: /cvs/gnome/evolution/mail/em-popup.c,v
retrieving revision 1.37
diff -u -p -r1.37 em-popup.c
--- em-popup.c	25 Jul 2005 04:23:41 -0000	1.37
+++ em-popup.c	3 Oct 2005 08:56:15 -0000
@@ -218,6 +218,10 @@ em_popup_target_new_select(EMPopup *emp,
 			mask &= ~EM_POPUP_SELECT_MARK_UNREAD;
 		else
 			mask &= ~EM_POPUP_SELECT_MARK_READ;
+		if ((flags & CAMEL_MESSAGE_JUNK))
+			mask &= ~EM_POPUP_SELECT_NOT_JUNK;
+		else
+			mask &= ~EM_POPUP_SELECT_JUNK;
 		
 		if (flags & CAMEL_MESSAGE_DELETED)
 			mask &= ~EM_POPUP_SELECT_UNDELETE;
@@ -830,6 +834,8 @@ static const EPopupHookTargetMask emph_s
 	{ "flag_clear", EM_POPUP_SELECT_FLAG_CLEAR },
 	{ "add_sender", EM_POPUP_SELECT_ADD_SENDER },
 	{ "folder", EM_POPUP_SELECT_FOLDER },
+	{ "junk", EM_POPUP_SELECT_JUNK },
+	{ "not_junk", EM_POPUP_SELECT_NOT_JUNK },	
 	{ 0 }
 };
 
Index: em-popup.h
===================================================================
RCS file: /cvs/gnome/evolution/mail/em-popup.h,v
retrieving revision 1.12
diff -u -p -r1.12 em-popup.h
--- em-popup.h	25 Jul 2005 04:23:41 -0000	1.12
+++ em-popup.h	3 Oct 2005 08:56:15 -0000
@@ -103,7 +103,9 @@ enum _em_popup_target_select_t {
 	EM_POPUP_SELECT_FLAG_CLEAR         = 1<<13,
 	EM_POPUP_SELECT_ADD_SENDER         = 1<<14,
 	EM_POPUP_SELECT_FOLDER             = 1<<15,     /* do we have any folder at all? */
-	EM_POPUP_SELECT_LAST               = 1<<17,     /* reserve 2 slots */
+	EM_POPUP_SELECT_JUNK               = 1<<16,
+	EM_POPUP_SELECT_NOT_JUNK           = 1<<17,
+	EM_POPUP_SELECT_LAST               = 1<<18,	
 };
 
 /**


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]