Extension Manager:API Rewrite: Difference between revisions

No edit summary
Line 25: Line 25:


==AddonInstall==
==AddonInstall==
The [[Extension Manager:API Rewrite:API#AddonInstall|AddonInstall]] object represents an add-on that is not yet installed or has just been installed. It may come from an update check to an existing add-on, a request to install a new add-on or a search for new add-ons. It tracks the high level progress of any necessary downloads and installation of the add-on.
The [[Extension Manager:API Rewrite:API#AddonInstall|AddonInstall]] object represents an add-on that is not yet installed or has just been installed. It may come from an update check to an existing add-on, a request to install a new add-on or a search for new add-ons. It tracks the high level progress of any necessary downloads, dependencies and installation of the add-on.


The AddonInstall goes through a set of states:
The AddonInstall goes through a set of states:
[[File:AddonInstallStates.png|center]]


;Available :Represents an add-on that is known to be available for install. Depending on where the AddonInstall came from there may be very little information about the add-on available.
;Available :Represents an add-on that is known to be available for install. Depending on where the AddonInstall came from there may be very little information about the add-on available.
;Downloading :This state tracks add-on downloads and as such it may not be necessary for add-ons installed from local files for example. During this state numerous progress events will be sent to listeners to inform them of the overall progress of the download as well as individual points of interest.
;Downloading :This state is used to show that downloads are in progress for the add-on. Almost all add-ons consist of a single file to download. Once the file is downloaded the Checking state may be entered if additional information is required, otherwise the Downloaded state is entered.
;Downloaded :At this point all the main parts of the add-on's files are somewhere on the local computer to be installed. Almost all information about the add-on should be available at this point through an [[Extension Manager:API Rewrite:API#Addon|Addon]] object.
;Checking :In some cases the additional information about version compatibility and dependencies may be required. The Checking state is used for small lookup requests for these and then dependant on the result the AddonInstall may move back to the Downloading state or on to the Downloaded state.
;Checking :In some cases the install may be delayed to allow further work such as compatibility checking.
;Downloaded :At this point all the necessary parts of the add-on are available on the computer. It is here that the user may be asked if they want to proceed with the installation.
;Installing :Here the add-on is being installed by its provider. This may cover file extraction etc.
;Installing :Here the add-on is being installed by its provider. This may cover file extraction etc.
;Installed :Here the add-on has been installed and its Addon object will appear in AddonManager.getAddons. The add-on itself however may not be active until after an application restart.
;Installed :Here the add-on has been installed and its Addon object will appear in AddonManager.getAddons. The add-on itself however may not be active until after an application restart.


Once the install process for an AddonInstall is started with <code>startInstall</code> it will move through all of the states naturally sending out notifications at each transition and some progress events in between until either an error is encountered or the install is stopped by calling <code>stopInstall</code> or the install completes successfully.
Once the install process for an AddonInstall is started with <code>startInstall</code> it will move through all of the states naturally sending out notifications at each transition and some progress events in between until either an error is encountered or the install is stopped by calling <code>stopInstall</code> or the install completes successfully.
Certain types on installs may skip steps. Installing an add-on from the file system for example may jump straight to the Downloaded (or Checking) state since there is no need to download it.
canmove, Confirmed users
1,570

edits