User:Brahmana/Design Proposal 1

From MozillaWiki
Jump to: navigation, search

The current DM provides the [Pause], [Resume] and [Cancel] links and they are sufficient.

Unresolved

The only addition that I would like to make is a small image will tell whether there is server side support for download resume. It is yet to be decided as to what picture can be used to show the resume supported or not.

Whenever a download begins an entry is made in the downloads.rdf file with its entity ID and other related details as to where it is being saved and so on. Each entry will also contain a new flag:

This flag states whether this download has to be auto-restored in the next session (if it is still alive), provided that the user chooses to restore the previous session or restore the downloads, as the case may be. This same flag can be suitably used to state whether there is server side support for resume.


     Flag Values { Exact values are yet to be finalized }
     
     Auto-Restore
     Manual Restore
     No server side support

This flag is by default set to "Auto-Restore" when the download begins if there is server side support else it is set to "No Server side Support".

When the user pauses a download the auto-restore flag is set to "Manual Restore"


There can be two ways in which a session can end.

1) The user ends it manually by exiting the browser process.

There can be two types of downloads going on at this time. The ones that are active and the ones that were manually paused by the user.

If there were any active downloads going on then the user is alerted about it and asked to take necessary action. In the current DM provides the user with options to cancel those downloads or cancel the session termination. Here I plan to provide another option stating "Pause and Save download for resume later". If the user choses this option then download is paused with the auto-restore flag remaining "Auto-Restore" itself.

The next time the browser is restarted, then the user is alerted about the downloads that were stored when the previous session ended:

Unresolved

May be by popping a dialog with a simple list of the auto-restore downloads) and he may choose to continue or cancel them.

Or just start the downloads and use nsIAlertService to popup a sliding message telling the user that auto restore downloads have been started.

The paused downloads remain paused until they are restarted by the user. We can have a toolbarbutton which will be animated to intimate the user about such downloads which are yet to be completed. With this button being clicked the DM window is shown and the user can take necessary action.

2) The browser quits unconditionally (may be because of power failure or the process is killed or a similar reason)

Here again we will have the same two types of downloads, the active ones and the paused ones. The active ones will be having their auto-restore flag set to "Auto-Restore" or "No Server side Support"

When the browser is restarted the user is asked whether to restore the session or start a new session. If the user chooses to restore the previous session, all the live downloads with auto-restore flag set to "Auto-Restore" will be automatically restored without any extra action from the user.

The action is same as said before for the manually paused downloads.


Using Preferences: { Not Finalized }

No extra preference is added and probably no existing preference will be made of apart from browser.download.manager.showWhenStarting