#include <AddonInstaller.h>
|
bool | IsDownloading () const |
|
void | GetInstallList (ADDON::VECADDONS &addons) const |
|
bool | GetProgress (const std::string &addonID, unsigned int &percent) const |
|
bool | Cancel (const std::string &addonID) |
|
bool | InstallModal (const std::string &addonID, ADDON::AddonPtr &addon, bool promptForInstall=true) |
| Installs the addon while showing a modal progress dialog. More...
|
|
bool | InstallOrUpdate (const std::string &addonID, bool background=true, bool modal=false) |
| Install an addon if it is available in a repository. More...
|
|
bool | InstallFromZip (const std::string &path) |
| Install an addon from the given zip path. More...
|
|
void | Install (const std::string &addonId, const ADDON::AddonVersion &version, const std::string &repoId) |
|
bool | CheckDependencies (const ADDON::AddonPtr &addon, CAddonDatabase *database=NULL) |
| Check whether dependencies of an addon exist or are installable. Iterates through the addon's dependencies, checking they're installed or installable. Each dependency must also satisfies CheckDependencies in turn. More...
|
|
bool | CheckDependencies (const ADDON::AddonPtr &addon, std::pair< std::string, std::string > &failedDep, CAddonDatabase *database=NULL) |
| Check whether dependencies of an addon exist or are installable. Iterates through the addon's dependencies, checking they're installed or installable. Each dependency must also satisfies CheckDependencies in turn. More...
|
|
bool | HasJob (const std::string &ID) const |
| Check if an installation job for a given add-on is already queued up. More...
|
|
void | InstallUpdatesAndWait () |
|
void | InstallUpdates () |
|
void | OnJobComplete (unsigned int jobID, bool success, CJob *job) override |
| The callback used when a job completes. More...
|
|
void | OnJobProgress (unsigned int jobID, unsigned int progress, unsigned int total, const CJob *job) override |
| An optional callback function that a job may call while processing. More...
|
|
virtual | ~IJobCallback ()=default |
| Destructor for job call back objects. More...
|
|
§ JobMap
§ Cancel()
bool CAddonInstaller::Cancel |
( |
const std::string & |
addonID | ) |
|
§ CheckDependencies() [1/2]
Check whether dependencies of an addon exist or are installable. Iterates through the addon's dependencies, checking they're installed or installable. Each dependency must also satisfies CheckDependencies in turn.
- Parameters
-
addon | the addon to check |
database | the database instance to update. Defaults to NULL. |
- Returns
- true if dependencies are available, false otherwise.
§ CheckDependencies() [2/2]
Check whether dependencies of an addon exist or are installable. Iterates through the addon's dependencies, checking they're installed or installable. Each dependency must also satisfies CheckDependencies in turn.
- Parameters
-
addon | the addon to check |
failedDep | Dependency addon that isn't available |
database | the database instance to update. Defaults to NULL. |
- Returns
- true if dependencies are available, false otherwise.
§ GetInstallList()
§ GetInstance()
§ GetProgress()
bool CAddonInstaller::GetProgress |
( |
const std::string & |
addonID, |
|
|
unsigned int & |
percent |
|
) |
| const |
§ HasJob()
bool CAddonInstaller::HasJob |
( |
const std::string & |
ID | ) |
const |
Check if an installation job for a given add-on is already queued up.
- Parameters
-
- Returns
- true if a job exists, false otherwise
§ Install()
void CAddonInstaller::Install |
( |
const std::string & |
addonId, |
|
|
const ADDON::AddonVersion & |
version, |
|
|
const std::string & |
repoId |
|
) |
| |
Install an addon with a specific version and repository
§ InstallFromZip()
bool CAddonInstaller::InstallFromZip |
( |
const std::string & |
path | ) |
|
Install an addon from the given zip path.
- Parameters
-
path | the zip file to install from |
- Returns
- true if successful, false otherwise
- See also
- DoInstall
- Bug:
- some zip files return a single item (root folder) that we think is stored, so we don't use the zip:// protocol
§ InstallModal()
bool CAddonInstaller::InstallModal |
( |
const std::string & |
addonID, |
|
|
ADDON::AddonPtr & |
addon, |
|
|
bool |
promptForInstall = true |
|
) |
| |
Installs the addon while showing a modal progress dialog.
- Parameters
-
addonID | the addon ID of the item to install. |
addon | [out] the installed addon for later use. |
promptForInstall | Whether or not to prompt the user before installing the addon. |
- Returns
- true on successful install, false otherwise.
- See also
- Install
§ InstallOrUpdate()
bool CAddonInstaller::InstallOrUpdate |
( |
const std::string & |
addonID, |
|
|
bool |
background = true , |
|
|
bool |
modal = false |
|
) |
| |
Install an addon if it is available in a repository.
- Parameters
-
addonID | the addon ID of the item to install |
background | whether to install in the background or not. Defaults to true. |
modal | whether to show a modal dialog when not installing in background |
- Returns
- true on successful install, false on failure.
- See also
- DoInstall
§ InstallUpdates()
void CAddonInstaller::InstallUpdates |
( |
| ) |
|
§ InstallUpdatesAndWait()
void CAddonInstaller::InstallUpdatesAndWait |
( |
| ) |
|
Install update and block until all updates have installed.
§ IsDownloading()
bool CAddonInstaller::IsDownloading |
( |
| ) |
const |
§ OnJobComplete()
void CAddonInstaller::OnJobComplete |
( |
unsigned int |
jobID, |
|
|
bool |
success, |
|
|
CJob * |
job |
|
) |
| |
|
overridevirtual |
The callback used when a job completes.
OnJobComplete is called at the completion of the job's DoWork() function, and is used to return information to the caller on the result of the job. On returning form this function the CJobManager will destroy this job.
- Parameters
-
jobID | the unique id of the job (as retrieved from CJobManager::AddJob) |
success | the result from the DoWork call |
job | the job that has been processed. The job will be destroyed after this function returns |
- See also
- CJobManager and CJob
Implements IJobCallback.
§ OnJobProgress()
void CAddonInstaller::OnJobProgress |
( |
unsigned int |
jobID, |
|
|
unsigned int |
progress, |
|
|
unsigned int |
total, |
|
|
const CJob * |
job |
|
) |
| |
|
overridevirtual |
An optional callback function that a job may call while processing.
OnJobProgress may be called periodically by a job during it's DoWork() function. It is used by the job to report on progress.
- Parameters
-
jobID | the unique id of the job (as retrieved from CJobManager::AddJob) |
progress | the current progress of the job, out of total. |
total | the total amount of work to be processed. |
job | the job that has been processed. |
- See also
- CJobManager and CJob
Reimplemented from IJobCallback.
The documentation for this class was generated from the following files: