Re: [evolution-patches] Mailer : Patch for bug#311719 (UI)





On 8/17/05, Not Zed <notzed ximian com> wrote:
On Fri, 2005-08-12 at 00:03 +0530, Antony Vincent Pandian wrote:
>         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<<18,
> +       EM_POPUP_SELECT_NOT_JUNK           = 1<<19,
>  };

Wrong spot! Can't you read the _LAST bit ...

have detected the place where i had gone wrong.the 2 flags must be above the _LAST bit or else  it affects the flags in  em-folder-view.h

have rectified it.

>
>  /**
> --- /home/evolution/Antony/junk_disable_bug/em-popup.c  2005-08-10
> 18:37:12.000000000 +0530
> +++ em-popup.c  2005-08-11 23:51:58.576898696 +0530
> @@ -229,6 +229,11 @@ em_popup_target_new_select(EMPopup *emp,
>                 else
>                         mask &= ~EM_POPUP_SELECT_MARK_IMPORTANT;
>
> +               if (flags & CAMEL_MESSAGE_JUNK)
> +                       mask &= ~EM_POPUP_SELECT_NOT_JUNK;
> +               else if ((flags & CAMEL_MESSAGE_DELETED) !=
> CAMEL_MESSAGE_DELETED)
> +                       mask &= ~EM_POPUP_SELECT_JUNK;

This isn't a test for not-junk, its a test for not deleted.

checked for junk and based on that the masks are set.

Anyway you missed all the hook-loading stuff.  As i said grep for
deleted case-insensitively in em-popup.c, there are other instances you
need to "copy".


all the hook stuff are also added and it works fine to me.

--
adfa(evolution-2.4:20087): gtkhtml-WARNING **: cannot find icon:
'stock_insert-url' in gnome




--
Luv,
S.Antony Vincent Pandian
--- /home/evolution/Antony/junk_disable_bug/em-popup.h	2005-08-10 18:37:07.000000000 +0530
+++ em-popup.h	2005-08-24 18:14:57.287514736 +0530
@@ -83,9 +83,10 @@ enum _em_popup_target_t {
  * which might be added to the addressbook. i.e. it isn't a message in
  * the Sent or Drafts folders.
  * @EM_POPUP_SELECT_FOLDER: A folder is set on the selection.
+ * @EM_POPUP_SELECT_JUNK: Message(s) are marked not junk.
+ * @EM_POPUP_SELECT_MARK_NOJUNK: Message(s) are marked junk.
  * @EM_POPUP_SELECT_LAST: The last bit used, can be used to add
  * additional types from derived application code.
- * 
  **/
 enum _em_popup_target_select_t {
 	EM_POPUP_SELECT_ONE                = 1<<1,
@@ -103,7 +104,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_MARK_JUNK	   = 1<<17,
+	EM_POPUP_SELECT_MARK_NOJUNK	   = 1<<18,
+	EM_POPUP_SELECT_LAST               = 1<<19,     /* reserve 2 slots */
 };
 
 /**
--- /home/evolution/Antony/junk_disable_bug/em-popup.c	2005-08-10 18:37:12.000000000 +0530
+++ em-popup.c	2005-08-19 16:51:52.000000000 +0530
@@ -229,6 +229,11 @@ em_popup_target_new_select(EMPopup *emp,
 		else
 			mask &= ~EM_POPUP_SELECT_MARK_IMPORTANT;
 
+		if ((flags & CAMEL_MESSAGE_JUNK) == CAMEL_MESSAGE_JUNK)
+			mask &= ~EM_POPUP_SELECT_MARK_NOJUNK;
+		else
+			mask &= ~EM_POPUP_SELECT_MARK_JUNK;
+
 		tmp = camel_message_info_user_tag(info, "follow-up");
 		if (tmp && *tmp) {
 			mask &= ~EM_POPUP_SELECT_FLAG_CLEAR;
@@ -830,6 +835,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 },
+	{ "mark_junk", EM_POPUP_SELECT_MARK_JUNK },
+	{ "mark_nojunk", EM_POPUP_SELECT_MARK_NOJUNK },
 	{ 0 }
 };
 
--- /home/evolution/Antony/junk_disable_bug/em-folder-view.c	2005-08-09 23:40:36.000000000 +0530
+++ em-folder-view.c	2005-08-19 16:34:00.000000000 +0530
@@ -1055,8 +1055,8 @@ static EPopupItem emfv_popup_items[] = {
 	{ E_POPUP_ITEM, "50.emfv.01", N_("Mark as U_nread"), 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_MARK_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_MARK_NOJUNK },
 	{ 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 },
@@ -1768,8 +1768,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_MARK_JUNK },
+	{ "MessageMarkAsNotJunk",     EM_POPUP_SELECT_MANY|EM_POPUP_SELECT_MARK_NOJUNK },
 	{ "MessageFollowUpFlag",      EM_POPUP_SELECT_MANY },
 	{ "MessageMove",              EM_POPUP_SELECT_MANY },
 	{ "MessageOpen",              EM_POPUP_SELECT_MANY },
--- /home/evolution/Antony/empty_trash_bug/ChangeLog	2005-08-05 18:34:26.000000000 +0530
+++ /home/evolution/Antony/junk_disable_bug/ChangeLog	2005-08-12 00:00:28.000000000 +0530
@@ -1,3 +1,10 @@
+2005-08-10 S.Antony Vincent Pandian <santony gmail com>
+
+	* em-folder-view.c : Fix #311719.Add two flags each for junk and  
+	not junk.Based on the place where the message resides,the Mark as
+	junk and Mark as Not Junk menu items in the right click popup
+	menu item are made visible or invisible. 
+
 2005-07-29  Shreyas Srinivasan  <sshreyas novell com>
 
 	* mail-ops.c: Fix #311223. Include <camel/camel-multipart.h>


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