Closed Bug 230466 Opened 20 years ago Closed 20 years ago

Saving an attachment does not bring up a stand alone progress window


(SeaMonkey :: MailNews: Message Display, defect)

Windows 2000
Not set


(Not tracked)



(Reporter: mscott, Assigned: mscott)




(1 file, 2 obsolete files)

Select an attachment. Right click to bring up the context menu. Select SAVE (not

We prompt for a file name and the show save progress inside the main mail window.

We should really create a stand alone progress window like we do if you chose
Attached patch first draft at a fix (obsolete) — Splinter Review
Modify nsMsgSaveListener for the attachment case only, to invoke a progress
dialog (nsIDownload) and feed progress information to it. We also listen for a
cancel event from the dialog and cancel our download.

Some of the remaining issues:

1) we still show progress in the status bar of the main mail window. I don't
think we should do that but maybe it is ok.

2) If the download is a quick one (which is common for mailbox urls or small
imap attachments), we flash the progress dialog then take it down. Ideally we
shouldn't show it at all.

3) When dragging an attachment to the desktop, the dialog comes up as soon as
you initiate the drag. This is because of a drag and drop bug and not us
cc'ing Jason. This one's for him :)
Blocks: 227014
Attached patch updated patch (obsolete) — Splinter Review
This patch refactors things a little differently. By delaying our attempt to
initialize the progress dialog until after the first OnDataAvailable
notifcation is received, when can then figure out just how large the download
is going to be. Then we can try to avoid showing the dialog if we think it is a
small download.

What is a small download? I arbitrarily said 8K (2 OnDataAvailable calls)

This small change made the usability of this feature much better IMHO. I think
it is ready to get checked in.
Attachment #138676 - Attachment is obsolete: true
Attachment #139946 - Flags: superreview?(bienvenu)
Comment on attachment 139946 [details] [diff] [review]
updated patch 

looks good - two nits:

+    if (NS_SUCCEEDED(rv))
+    {	   
+      // Send progress notification.
+      if (mWebProgressListener)
+	 mWebProgressListener->OnProgressChange(nsnull, request, mProgress,
mContentLength, mProgress, mContentLength);

this can just be 
if (NS_SUCCEEDED(rv) && mWebProgressListener)

and this code, which I know you just moved, doesn't need the braces...

+    if (NS_FAILED(rv) && m_messenger)
+    {
+	 m_messenger->Alert("saveAttachmentFailed");
+    else if (!m_dataBuffer)
+    {
+	 m_dataBuffer = (char*) PR_CALLOC(FOUR_K+1);
Attachment #139946 - Flags: superreview?(bienvenu) → superreview+
updating the diff with david's comments
Attachment #139946 - Attachment is obsolete: true
Comment on attachment 139947 [details] [diff] [review]
updated patch with review comments

carrying forward the sr
Attachment #139947 - Flags: superreview+
Closed: 20 years ago
Resolution: --- → FIXED
Blocks: 230700
fixed on the m4 branch now too. 
Product: Browser → Seamonkey
You need to log in before you can comment on or make changes to this bug.