Last Comment Bug 62885 - Message/Mark All Read doesn't get disabled when there are no (zero) unread messages/all messages are read
: Message/Mark All Read doesn't get disabled when there are no (zero) unread me...
Status: RESOLVED FIXED
:
Product: SeaMonkey
Classification: Client Software
Component: MailNews: Message Display (show other bugs)
: Trunk
: All All
-- trivial (vote)
: seamonkey2.1b3
Assigned To: Edmund Wong (:ewong)
:
:
Mentors:
Depends on:
Blocks: 650702
  Show dependency treegraph
 
Reported: 2000-12-14 16:34 PST by stephend@netscape.com (gone - use stephen.donner@gmail.com instead)
Modified: 2011-04-17 18:01 PDT (History)
12 users (show)
See Also:
Crash Signature:
(edit)
QA Whiteboard:
Iteration: ---
Points: ---


Attachments
Patch to disable "Mark all" when all mail in folder has been read (4.28 KB, patch)
2009-06-24 06:29 PDT, Jan Horak
no flags Details | Diff | Splinter Review
Path 0.2 (697 bytes, patch)
2009-06-24 08:40 PDT, Jan Horak
mozilla: review-
Details | Diff | Splinter Review
Disable Message->Mark All Read when there are no (zero) unread messages. (824 bytes, patch)
2011-02-25 18:59 PST, Edmund Wong (:ewong)
no flags Details | Diff | Splinter Review
Disable Message->Mark All Read when there are no (zero) unread messages. (v2) (707 bytes, patch)
2011-02-25 21:41 PST, Edmund Wong (:ewong)
mnyromyr: review-
Details | Diff | Splinter Review
Disable Message->Mark All Read when there are no (zero) unread messages. [Checkin: comment 30] (1.15 KB, patch)
2011-03-10 04:42 PST, Edmund Wong (:ewong)
mnyromyr: review+
mnyromyr: superreview+
Details | Diff | Splinter Review

Description User image stephend@netscape.com (gone - use stephen.donner@gmail.com instead) 2000-12-14 16:34:20 PST
Build ID : 2000121408.

Message/Mark All Read doesn't get ghosted after a successful marking.

Steps to Repro:

1. Go to any newsgroup
2. Go to Message/Mark All Read

Expected Results:

This function should Mark All Messages As Read and then become ghosted out like
As Read/Thread As Read already are.

Actual Results:

Function is not ghosted out.
Comment 1 User image stephend@netscape.com (gone - use stephen.donner@gmail.com instead) 2000-12-14 16:36:25 PST
Saw this also on my Windows 2000 box, 2000121404.
Comment 2 User image (not reading, please use seth@sspitzer.org instead) 2000-12-14 16:42:34 PST
ghosted == disabled.  updating topic, accepting.
Comment 3 User image laurel 2001-01-17 13:40:28 PST
Hmmm, don't know all the rules, here, but 4.x doesn't disable it.
In the case of As Read/Thread Read, those are message selection related items as
opposed to All Read being overall group/folder related so applicable rules might
differ.  In your example, I don't know if you had anything selected in the
thread/message panes or whether you were operating solely on overall
group/folder selection.
If you select a message which has no unread components, As Read and Thread Read
are still enabled (4.x or 6.x), too.  So I'm not sure of your point.

Comment 4 User image stephend@netscape.com (gone - use stephen.donner@gmail.com instead) 2001-01-19 19:57:24 PST
It's not news specific.  You can go to a folder that has only read messages, no
new ones. Put focus in the message/thread window and make sure you've got only
read messages selected.  You'll see that some menu items are still available,
like Mark All Read.  This would be a fine option, if you had even a single
unread message, which I don't. 
Comment 5 User image Arun Prasannan (polar) 2009-02-18 21:54:31 PST
This bug is being marked EXPIRED as it has seen no activity in a very long time.

If you think that the issue reported might still be relevant, please test with a recent release of SeaMonkey and if the problem persists feel free to re-open the report. Thank you.

http://www.seamonkey-project.org/
Comment 6 User image Mark Banner (:standard8) 2009-02-19 01:18:19 PST
Bulk reopening incorrectly expired bugs - no activity does not constitute no bug - these need proper checking.
Comment 7 User image Philip Chee 2009-02-23 08:07:31 PST
Problem still exists.
Comment 8 User image Shriram (irc: Mavericks) Away 2009-03-08 20:14:04 PDT
Is someone working on a patch for this?
Comment 9 User image Kent James (:rkent) 2009-03-08 20:54:08 PDT
Probably (In reply to comment #8)
> Is someone working on a patch for this?

Probably not, since it is unassigned.
Comment 10 User image Shriram (irc: Mavericks) Away 2009-03-19 15:40:33 PDT
So, referring to comment #4
Comment 11 User image Shriram (irc: Mavericks) Away 2009-03-19 15:45:48 PDT
ignore my last comment.
referring to comment #3, I think if the "Mark all read " feature is to be ghosted out, then it would make sense to disable the "Mark read" feature for the one read message or X read messages out of all messages.
So, do users request this feature to be enabled?
This issue also exists in the latest version of seamonkey(2.01bpre)
Comment 12 User image Jan Horak 2009-06-24 06:29:08 PDT
Created attachment 384850 [details] [diff] [review]
Patch to disable "Mark all" when all mail in folder has been read
Comment 13 User image Jan Horak 2009-06-24 08:40:57 PDT
Created attachment 384879 [details] [diff] [review]
Path 0.2

I'm sorry I forgot to remove bogus diffs from patch file.
Comment 14 User image Phil Ringnalda (:philor) 2009-08-28 20:41:19 PDT
Comment on attachment 384879 [details] [diff] [review]
Path 0.2

Sorry, for no reason I can explain, I just can't wrap my head around whether or not this is the right thing to do, so I'm going to punt.
Comment 15 User image David :Bienvenu 2009-08-28 20:48:03 PDT
Comment on attachment 384879 [details] [diff] [review]
Path 0.2

doesn't mark all read work on multiple folders now?
Comment 16 User image David :Bienvenu 2009-08-28 20:50:36 PDT
If this is for marking the messages in the thread pane read, I would go through the view's folder to see if there are any unread, not the folder pane selection...
Comment 17 User image David :Bienvenu 2009-08-31 15:50:03 PDT
Comment on attachment 384879 [details] [diff] [review]
Path 0.2

this seems wrong to me per my previous comment.
Comment 18 User image Edmund Wong (:ewong) 2011-02-25 00:00:40 PST
If jhorak@redhat.com does not object, I'd like to take this bug for a spin.
Comment 19 User image Jens Hatlak (:InvisibleSmiley) 2011-02-25 00:25:10 PST
(In reply to comment #18)
> If jhorak@redhat.com does not object, I'd like to take this bug for a spin.

This bug is not assigned to anyone -> free to take.
Comment 20 User image Edmund Wong (:ewong) 2011-02-25 18:55:51 PST
Taking this bug for a spin.
Comment 21 User image Edmund Wong (:ewong) 2011-02-25 18:59:40 PST
Created attachment 515280 [details] [diff] [review]
Disable Message->Mark All Read when there are no (zero) unread messages.
Comment 22 User image Philip Chee 2011-02-25 20:36:09 PST
You should follow the style in rest of the code in DefaultController.

+             var dbView = GetDBView();
+             var numRead = dbView.msgFolder.getNumUnread(false);
+             if (numRead <= 0) {
+               return false;
+             }
+             return true;

All the above can be replaced by:

return (gDBView && gDBView.msgFolder.getNumUnread(true) > 0) // Use true See Comment 16.

Also you've fixed the wrong line (supportsCommand:). You should fix it in the isCommandEnabled: section.
Comment 23 User image Edmund Wong (:ewong) 2011-02-25 21:41:41 PST
Created attachment 515291 [details] [diff] [review]
Disable Message->Mark All Read when there are no (zero) unread messages. (v2)
Comment 24 User image Philip Chee 2011-02-26 02:20:15 PST
> +        return (gDBView && (gDBView.msgFolder.getNumUnread(false) <= 0));
I think you want the condition to be > 0
Comment 25 User image Jens Hatlak (:InvisibleSmiley) 2011-02-26 02:58:56 PST
(In reply to comment #24)
> > +        return (gDBView && (gDBView.msgFolder.getNumUnread(false) <= 0));
> I think you want the condition to be > 0

I'd just wait for Karsten's review. For example the parentheses are unnecessary, too (except for the function call ones of course), but that's just a matter of style (i.e. I think there's no point in uploading new patches unless you have a crystal ball or something similar telling you what the reviewer wants).
Comment 26 User image Karsten Düsterloh 2011-03-09 15:13:00 PST
Comment on attachment 515291 [details] [diff] [review]
Disable Message->Mark All Read when there are no (zero) unread messages. (v2)

>Bug 62885 - Disable Message->Mark All Read when there are no (zero) unread messages.
                              =============
>       case "cmd_markAsRead":

This is the wrong command, you need to fix cmd_markAllRead. 

>+        return (gDBView && (gDBView.msgFolder.getNumUnread(false) <= 0));

This should be >0 and you need none of the braces.
Besides, you could just mimic e.g. cmd_markThreadAsRead and check GetNumSelectedMessages().
But don't forget the old condition...

>       case "cmd_markThreadAsRead":
>         return GetNumSelectedMessages() > 0;
>       case "button_next":

It'd be a good idea if you make your hg do 8 lines of context, i.e. this into your global .hgrc:
[diff]
git=true
showfunc=true
unified=8

[defaults]
diff=-U 8
qdiff=-U 8
Comment 27 User image Karsten Düsterloh 2011-03-09 23:32:47 PST
(In reply to comment #26)
> check GetNumSelectedMessages().

Oops, that nonsense, of course. getNumUnread is the right function.
Comment 28 User image Edmund Wong (:ewong) 2011-03-10 04:42:03 PST
Created attachment 518336 [details] [diff] [review]
Disable Message->Mark All Read when there are no (zero) unread messages. [Checkin: comment 30]
Comment 29 User image Karsten Düsterloh 2011-03-10 14:57:01 PST
Comment on attachment 518336 [details] [diff] [review]
Disable Message->Mark All Read when there are no (zero) unread messages. [Checkin: comment 30]

r/moa=me.
Comment 30 User image Jens Hatlak (:InvisibleSmiley) 2011-03-11 09:17:49 PST
Comment on attachment 518336 [details] [diff] [review]
Disable Message->Mark All Read when there are no (zero) unread messages. [Checkin: comment 30]

http://hg.mozilla.org/comm-central/rev/3b55dfd8506e
Comment 31 User image Jim Porter (:squib) 2011-03-12 13:12:34 PST
Should this be fixed for Thunderbird as well?
Comment 32 User image Jens Hatlak (:InvisibleSmiley) 2011-03-12 13:18:06 PST
(In reply to comment #31)
> Should this be fixed for Thunderbird as well?

That sounds like a question you should ask a TB reviewer, in a TB bug. ;-)

Note You need to log in before you can comment on or make changes to this bug.