Closed Bug 38327 Opened 24 years ago Closed 23 years ago

disable / enable "Send Unsent Messages" when appropriate

Categories

(SeaMonkey :: MailNews: Message Display, defect, P3)

defect

Tracking

(Not tracked)

VERIFIED FIXED
mozilla0.9.3

People

(Reporter: nbaca, Assigned: doronr)

References

Details

(Keywords: polish)

Attachments

(7 files)

Build 2000-04-28-09M10: NT4, Linux 6.0, Mac 9.0 Overview: With only the Inbox or Trash folder selected the File menu should: 1. Disable a. Open Message b. Open/Save Attachment c. Save As - File - Template d. Send Unsent Messages (If no messages are in the Unsent Messages folder) e. Rename Folder f. Page Setup g. Print Preview h. Print 2. Enable: a. Send Unsent Messages (If messages are in the Unsent Messages folder) Note: The spec does not have this level of detail. Please state your opinion if it differs.
QA Contact: lchiang → nbaca
Keywords: ui
Looks good. Actually, this applied to Inbox, Trash and Draft, Templates and Sent (if they are set as the defaults to receive Drafts, Sent, Templates) as well. This also applied to any user created folder as well. Except, "Rename Folder..." would need to be available.
Target Milestone: --- → M18
nominating as nsbeta3 polish
Keywords: nsbeta3, polish
per mail triage: remove nsbeta3 nomination and move to future milestone. For the short term, we will combine items here into three bugs (in 3pane) to address for nsbetat3: 1. delete, change text, move menuitems; 2. enable/disable and text changes on context (dynamic); 3. accelerator keys to work. When this bug gets revisited after the first release, we'll need to see what items remaining that need to be addressed.
Keywords: nsbeta3
Target Milestone: M18 → Future
I'm stealing this bug. But I have one question, I think i have a patch that hides the attachment menu [it also makes the menu work...] is that ok or do you really want me to disable it?
Assignee: putterman → timeless
OS: Windows 95 → All
Target Milestone: Future → ---
I think disabling would be good. It should also only be disabled if there's no message displayed that has attachments. That's great if you have a fix to implement the menu.
accepting.
Status: NEW → ASSIGNED
Attached patch proposed patch (deleted) — Splinter Review
-> me attached patch that fixes this bug (parts of it were already fixed, change rename folder to show for user created ones and made sure send notsent was hidden for non-notsent folders and greyed out if notsent was selected but empty). Also made sure that "send notsent" context menu behaves correctly. cc: hwaara/sspitzer, any comments or even r=/sr=? thanks
Keywords: patch
Target Milestone: --- → mozilla0.9.1
r=timeless, please add //XXX intl warning to all relevant places
Assignee: timeless → doronr
Status: ASSIGNED → NEW
Keywords: approval
- var popupNode = document.getElementById('folderPaneContext'); + var popupNode = document.getElementById('folderPaneContext'); Next time, attach a -uw if you intend to make whitespace changes. + var folderResource = RDF.GetResource(selectedItems[0].getAttribute('id')); + var msgFolder = folderResource.QueryInterface (Components.interfaces.nsIMsgFolder); I may be wrong, but isn't this where you usually use GetFirstSelectedMsgFolder ()? + ShowMenuItem("menu_sendunsentmsgs", specialFolder == 'Unsent Messages'); I don't think it's healthy to mix single quotes and double quotes like that. Please use one of them and be consistent (as long as it doesn't affect the code). + var unreadCount = msgFolder.getTotalMessages(false); + EnableMenuItem("menu_sendunsentmsgs", (unreadCount > 0)); unreadCount is misleading. What unreadCount is storing is the total amount of messages - unread or read doesn't matter - that are in that folder. Please change the name of that variable to reflect its contents.
Keywords: approval
I'm requesting timeless to revoke his r=, since doron asked me for review, and since the patch is not error-free (yet).
Attached patch new patch (deleted) — Splinter Review
new patch, i did a diff -u cause the spacing changes are too few to warrant 2 patches.
+ var msgFolder = [...] Can you rename msgFolder in all places there and in the other file to be "unsentFolder" (which really reflects what folder it is)? + ShowMenuItem("folderPaneContext-sendUnsentMessages", (unsentCount > 0)); + EnableMenuItem("folderPaneContext-sendUnsentMessages", true); You don't want to Enable the menuitem if it's not visible. So do something like this: if (unsentCount > 0) { ShowMenuItem(..., true); EnableMenuItem(..., true); } after those changes. r=hwaara
Attached patch another patch (deleted) — Splinter Review
new patch that reflects hwaara's comments. any sr=?
Status: NEW → ASSIGNED
0.9.2, unless someone sr='s this before the 0.9.1 deadline
Keywords: review
Target Milestone: mozilla0.9.1 → mozilla0.9.2
r=hwaara I doubt this is a good time to ask for sr= for non-0.9.1 blockers, so I would re-ask after the freeze if I were you.
can i get an sr= on this? sspitzer perhaps?
-> 0.9.3, need sr
Whiteboard: needs sr=
Target Milestone: mozilla0.9.2 → mozilla0.9.3
doron, thanks for being patient. I'll review this later today.
sorry again, I did not get a chance to get to it. on my plate for tomorrow.
comments: 1) rename is already properly enabled / disabled. see IsRenameFolderEnabled() it uses the CanRename property of nsIMsgFolder (indirectly, going through the folder datasource.) more than just the "special folders" can't be renamed. 2) "Send Unsent Messages" should always appear in the menu, but should be disabled if there are no unsent messages. (your patch hides it unless the user selected the unsent msgs folder, which is incorrect.) we need to use cmd_sendUnsentMsgs and implement IsSendUnsentMsgsEnabled(), which is non-trivial. I've got the start of this fix, based on your initial. I'll attach it and you can run with it.
updating summary to reflect the issue.
Summary: 3pane, Inbox/Trash selected: File menu → disable / enable (or hide, for folder content menu) "Send Unsent Messages" when appropriate
whoops, minor revision coming to that patch.
the patch I'm about to submit is blocked by some interface changes that are part of mohan's fix to #79865
Depends on: 79865
Keywords: review
Whiteboard: needs sr=
Seems someone fixed the rename issue, it was not working for me before. as for IsSendUnsentMsgsEnabled(), is the way I did it before wrong? + var folderResource = RDF.GetResource(selectedItems[0].getAttribute('id')); + var msgFolder = folderResource.QueryInterface(Components.interfaces.nsIMsgFolder); + var unsentCount = msgFolder.getTotalMessages(false);
+ var folderResource = RDF.GetResource(selectedItems[0].getAttribute('id')); + var msgFolder = folderResource.QueryInterface(Components.interfaces.nsIMsgFolder); + var unsentCount = msgFolder.getTotalMessages(false); that works if your selected folder is the unsent messages folder. what if it isn't? "send unsent messages" should be enabled if there are unsent messages, no matter what folder is selected. but we should use your code in my new IsSendUnsentMsgsEnabled(folderNode), when we've got a folderNode. we only get a folderNode when we're coming from the context menu for the "Unsent Messages" folder. I'll update the patch.
working on this bug, I've found some related problems. (these problems aren't cause by this fix, they've been there all along.) 1) can't send unsent if no folder selected 2) if fail in the middle of send unsent, still thinks there is no unsent 3) sending unsent needs to loop over all identities 4) migrating a pop account leaves you with two "unsent messages" folders: one on "Local Folders", on on the pop account. we set the sendlater uri pref to the pop folder, but if we were to delete the pop account, sending later would break. I'll log additional bugs on these issues.
reviewed and tested. looks good. r=bhuvan. caveat : once mohan lands his fix for bug 79865 (before this one), there will be conflicts. watch out.
I plan on letting mohan land first, and then I'll fix the conflicts.
if mohan's landing requires a change to this patch, I'll go for another round of reviews.
sr=mscott
"If its items that are only temporarily unavailable, because the is no trash to empty or no unsent messages to send, I would think disabling is appropriate" I need to update the patch to disable (instead of hide) the "Send Unsent Messages" item in the context menu. also, mohan has landed, so I'll attach a new patch that is current to the trunk.
Summary: disable / enable (or hide, for folder content menu) "Send Unsent Messages" when appropriate → disable / enable "Send Unsent Messages" when appropriate
fixed.
Status: ASSIGNED → RESOLVED
Closed: 23 years ago
Resolution: --- → FIXED
Build 2001-08-10-03: WinMe Build 2001-08-10-04: Mac 9.04 Build 2001-08-10-06: Linux RH 6.2 Verified Fixed. Unsent Messages menu item is enabled when a message is in the Unsent Messages folder and disabled if no messages are in the Unsent Messages folder (POP, IMAP, News). Also noticed that the Open Message appeared disabled when appropriate. Also the Rename Folder menu item appeared disabled for "Special Folders" and enabled for all others.
Status: RESOLVED → VERIFIED
Product: Browser → Seamonkey
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: