Slicer  5.1
Slicer is a multi-platform, free and open source software package for visualization and medical image computing
List of all members | Public Types | Properties | Public Slots | Signals | Public Member Functions | Static Public Member Functions | Protected Slots | Protected Attributes
qSlicerExtensionsManagerModel Class Reference

Class querying and storing extensions data. More...

#include <Base/QTCore/qSlicerExtensionsManagerModel.h>

Inheritance diagram for qSlicerExtensionsManagerModel:
Inheritance graph
[legend]
Collaboration diagram for qSlicerExtensionsManagerModel:
Collaboration graph
[legend]

Public Types

typedef QVariantMap ExtensionMetadataType
 Extension metadata typedef. More...
 
enum  MatadataSource { MetadataAll = 0, MetadataLocal, MetadataServer }
 
typedef qSlicerExtensionsManagerModelPrivate Pimpl
 Pimpl typedef. More...
 
typedef qSlicerExtensionsManagerModel Self
 Self typedef. More...
 
enum  ServerAPI { Girder_v1 = 1, ServerAPI_Last }
 
typedef QObject Superclass
 Superclass typedef. More...
 

Properties

bool autoInstallDependencies
 Automatically install all dependencies (other extensions that the installed extension requires) when installing an extension. More...
 
bool autoUpdateCheck
 Download extensions metadata from the server at application startup to allow the application to display update available indicator. More...
 
bool autoUpdateInstall
 Automatically install any extension updates. More...
 
QStringList availableUpdateExtensions
 Names of extensions that have updates available on the server. More...
 
QStringList bookmarkedExtensions
 Names of bookmarked extensions. More...
 
QStringList enabledExtensions
 
QString extensionsSettingsFilePath
 
QStringList installedExtensions
 
int installedExtensionsCount
 
bool interactive
 
QStringList managedExtensions
 Names of extensions that are installed or bookmarked. More...
 
int managedExtensionsCount
 Number of extensions that are installed or bookmarked. More...
 
bool newExtensionEnabledByDefault
 
int numberOfInstalledExtensions
 
QString slicerArch
 
QString slicerOs
 
QString slicerRevision
 

Public Slots

void aboutToLoadExtensions ()
 
bool cancelExtensionScheduledForUninstall (const QString &extensionName)
 Cancel the uninstallation of extensionName Tell the application to keep extensionName installed. More...
 
bool cancelExtensionScheduledForUpdate (const QString &extensionName)
 Cancel the update of extensionName Tell the application to keep extensionName installed. More...
 
void checkForExtensionsUpdates ()
 
QStringList checkInstallPrerequisites () const
 
bool downloadAndInstallExtension (const QString &extensionId, bool installDependencies=true)
 Download and install extensionId The extensionId corresponds to the identifier used on the extension server itself. More...
 
bool downloadAndInstallExtensionByName (const QString &extensionId, bool installDependencies=true)
 Download and install extensionId The extensionId corresponds to the identifier used on the extension server itself. This method is used by the extensions.slicer.org extension installer. More...
 
bool exportExtensionList (QString &exportFilePath)
 
void identifyIncompatibleExtensions ()
 
bool scheduleExtensionForUninstall (const QString &extensionName)
 Schedule extensionName of uninstall Tell the application to uninstall extensionName when it will restart An extension scheduled for uninstall can be effectively uninstalled by calling uninstallScheduledExtensions() More...
 
bool scheduleExtensionForUpdate (const QString &extensionName)
 
void setAutoInstallDependencies (bool enable)
 
void setAutoUpdateCheck (bool enable)
 
void setAutoUpdateInstall (bool enable)
 
void setExtensionBookmarked (const QString &extensionName, bool value)
 Add/remove bookmark for an extension. Add/remove this extension from the list of bookmarked extensions in the application settings. More...
 
void setExtensionEnabled (const QString &extensionName, bool value)
 Enable or disable an extension. Tell the application to load (or skip the loading) of extensionName by adding (or removing) all associated module paths to the application settings. More...
 
void setInteractive (bool value)
 
bool uninstallScheduledExtensions (QStringList &uninstalledExtensions)
 
bool uninstallScheduledExtensions ()
 
bool updateExtensionsMetadataFromServer (bool force=false, bool waitForCompletion=false)
 
void updateModel ()
 Full update of the extensions from extension description files and settings. More...
 
bool updateScheduledExtensions (QStringList &updatedExtensions)
 
bool updateScheduledExtensions ()
 

Signals

void autoUpdateSettingsChanged ()
 Emitted when autoUpdateCheck, autoUpdateInstall, or autoInstallDependencies properties are changed. More...
 
void downloadFinished (QNetworkReply *reply)
 
void downloadStarted (QNetworkReply *reply)
 
void extensionBookmarkedChanged (const QString &extensionName, bool value)
 Emitted when bookmark is added to or removed from an extension. More...
 
void extensionCancelledScheduleForUninstall (const QString &extensionName)
 
void extensionCancelledScheduleForUpdate (const QString &extensionName)
 
void extensionEnabledChanged (const QString &extensionName, bool value)
 
void extensionIdentifedAsIncompatible (const QString &extensionName)
 
void extensionInstalled (const QString &extensionName)
 
void extensionMetadataUpdated (const QString &extensionName)
 Emitted when extension metadata (description, icon URL, etc. is updated) More...
 
void extensionScheduledForUninstall (const QString &extensionName)
 
void extensionScheduledForUpdate (const QString &extensionName)
 
void extensionsSettingsFilePathChanged (const QString &extensionsSettingsFilePath)
 
void extensionUninstalled (const QString &extensionName)
 
void extensionUpdateAvailable (const QString &extensionName)
 
void extensionUpdated (const QString &extensionName)
 
void extensionUpdatesAvailable (bool available)
 Emitted after updates are checked on the extensions server. More...
 
void installDownloadProgress (const QString &extensionName, qint64 received, qint64 total)
 
void interactiveChanged (bool interactive)
 
void messageLogged (const QString &text, ctkErrorLogLevel::LogLevels level) const
 
void modelUpdated ()
 
void newExtensionEnabledByDefaultChanged (bool value)
 
void slicerArchChanged (const QString &slicerArch)
 
void slicerOsChanged (const QString &slicerOs)
 
void slicerRequirementsChanged (const QString &revision, const QString &os, const QString &arch)
 
void slicerRevisionChanged (const QString &slicerRevision)
 
void slicerVersionChanged (const QString &slicerVersion)
 
void updateDownloadProgress (const QString &extensionName, qint64 received, qint64 total)
 
void updateExtensionsMetadataFromServerCompleted (bool success)
 Emitted when metadata download from the extensions server is completed. More...
 

Public Member Functions

QStringList activeTasks () const
 Number of operations in progress. More...
 
bool autoInstallDependencies () const
 
bool autoUpdateCheck () const
 
bool autoUpdateInstall () const
 
QStringList availableUpdateExtensions () const
 
QStringList bookmarkedExtensions () const
 Return names of all bookmarked extensions. More...
 
QStringList enabledExtensions () const
 Return names of all enabled extensions sorted in alphabetical order. More...
 
Q_INVOKABLE QString extensionDescription (const QString &extensionName) const
 
Q_INVOKABLE QString extensionDescriptionFile (const QString &extensionName) const
 
Q_INVOKABLE QString extensionInstallPath (const QString &extensionName) const
 
Q_INVOKABLE ExtensionMetadataType extensionMetadata (const QString &extensionName, int source=MetadataAll) const
 
Q_INVOKABLE QStringList extensionModulePaths (const QString &extensionName) const
 
Q_INVOKABLE QString extensionsInstallPath () const
 
Q_INVOKABLE QUrl extensionsListUrl () const
 Returns the URL of the extensions manager frontend for the current application version and operating system. More...
 
QString extensionsSettingsFilePath () const
 Set/Get extension settings file path. More...
 
Q_INVOKABLE bool extractExtensionArchive (const QString &extensionName, const QString &archiveFile, const QString &destinationPath)
 Extract archiveFile into destinationPath/extensionName directory. More...
 
Q_INVOKABLE QUrl frontendServerUrl () const
 Frontend server URL displaying extension manager web page. More...
 
QStringList installedExtensions () const
 Return names of all installed extensions sorted in alphabetical order. More...
 
int installedExtensionsCount () const
 Return the number of installed extensions. More...
 
Q_INVOKABLE bool installExtension (const QString &archiveFile, bool installDependencies=true)
 
Q_INVOKABLE bool installExtension (const QString &extensionName, ExtensionMetadataType extensionMetadata, const QString &archiveFile, bool installDependencies=true)
 
bool interactive () const
 
Q_INVOKABLE bool isExtensionBookmarked (const QString &extensionName) const
 Return True if the extensionName is bookmarked. Bookmarked extensions are included in the list of managed extensions list, even if not installed. More...
 
Q_INVOKABLE QStringList isExtensionCompatible (const QString &extensionName, const QString &slicerRevision, const QString &slicerOs, const QString &slicerArch) const
 Check if extensionName is compatible with the system identified by slicerRevision, slicerOs and slicerArch. More...
 
Q_INVOKABLE QStringList isExtensionCompatible (const QString &extensionName) const
 Check if extensionName is compatible. An extension is considered incompatible when the version of Slicer used to build the extension is different from the version of Slicer attempting to load the extension. More...
 
Q_INVOKABLE bool isExtensionEnabled (const QString &extensionName) const
 Return True if the extensionName is enabled. More...
 
Q_INVOKABLE bool isExtensionInstalled (const QString &extensionName) const
 Return True if the extensionName is installed. More...
 
bool isExtensionLoaded (const QString &extensionName) const
 Return True if the extensionName is loaded. More...
 
Q_INVOKABLE bool isExtensionScheduledForUninstall (const QString &extensionName) const
 Return True if the extensionName is scheduled to be uninstalled. More...
 
Q_INVOKABLE bool isExtensionScheduledForUpdate (const QString &extensionName) const
 
Q_INVOKABLE bool isExtensionUpdateAvailable (const QString &extensionName) const
 
QDateTime lastUpdateTimeExtensionsMetadataFromServer ()
 
QStringList managedExtensions () const
 Return names of all managed extensions, i.e., installed or bookmarked extensions. More...
 
int managedExtensionsCount () const
 Return the number of managed extensions. More...
 
Q_INVOKABLE const QStandardItemModel * model () const
 Return the item model used internally. More...
 
bool newExtensionEnabledByDefault () const
 
int numberOfInstalledExtensions () const
 Return the number of installed extensions. Deprecated, use installedExtensionsCount instead. More...
 
 qSlicerExtensionsManagerModel (QObject *parent=nullptr)
 Constructor. More...
 
QStringList scheduledForUninstallExtensions () const
 Return names of all extensions scheduled for uninstall. More...
 
QStringList scheduledForUpdateExtensions () const
 
int serverAPI () const
 
Q_INVOKABLE QUrl serverUrl () const
 Backend server URL used to perform API calls. More...
 
void setExtensionsSettingsFilePath (const QString &extensionsSettingsFilePath)
 
void setNewExtensionEnabledByDefault (bool value)
 
void setSlicerArch (const QString &arch)
 
void setSlicerOs (const QString &os)
 
void setSlicerRequirements (const QString &revision, const QString &os, const QString &arch)
 Convenience function setting Slicer revision, operating system and architecture. More...
 
void setSlicerRevision (const QString &revision)
 
void setSlicerVersion (const QString &version)
 
QString slicerArch () const
 Set/Get Slicer architecture. More...
 
QString slicerOs () const
 Set/Get Slicer operating system. More...
 
QString slicerRevision () const
 Set/Get Slicer revision. More...
 
QString slicerVersion () const
 
bool uninstallExtension (const QString &extensionName)
 Uninstall extensionName It is only allowed if the extension is not loaded already. If the extension is already loaded then use scheduleExtensionForUninstall instead. More...
 
 ~qSlicerExtensionsManagerModel () override
 Destructor. More...
 

Static Public Member Functions

static ExtensionMetadataType convertExtensionMetadata (const ExtensionMetadataType &extensionMetadata, int serverAPI)
 
static ExtensionMetadataType filterExtensionMetadata (const ExtensionMetadataType &extensionMetadata, int serverAPI)
 
static ExtensionMetadataType parseExtensionDescriptionFile (const QString &file)
 
static QStringList readArrayValues (QSettings &settings, const QString &arrayName, const QString fieldName)
 
static int serverAPIFromString (const QString &str)
 
static QString serverAPIToString (int serverAPI)
 
static QStringList serverKeysToIgnore (int serverAPI)
 
static QHash< QString, QString > serverToExtensionDescriptionKey (int serverAPI)
 
static void writeArrayValues (QSettings &settings, const QStringList &values, const QString &arrayName, const QString fieldName)
 
static bool writeExtensionDescriptionFile (const QString &file, const ExtensionMetadataType &metadata)
 

Protected Slots

bool onExtensionsMetadataFromServerQueryFinished (const QUuid &requestId)
 
void onInstallDownloadFinished (qSlicerExtensionDownloadTask *task)
 
void onInstallDownloadProgress (qSlicerExtensionDownloadTask *task, qint64 received, qint64 total)
 
void onUpdateDownloadFinished (qSlicerExtensionDownloadTask *task)
 
void onUpdateDownloadProgress (qSlicerExtensionDownloadTask *task, qint64 received, qint64 total)
 

Protected Attributes

QScopedPointer< qSlicerExtensionsManagerModelPrivate > d_ptr
 

Detailed Description

Class querying and storing extensions data.

The model maintains a list of "managed" extensions, i.e., extensions that are currently installed or that the user bookmarked.

Definition at line 47 of file qSlicerExtensionsManagerModel.h.

Member Typedef Documentation

◆ ExtensionMetadataType

Extension metadata typedef.

Definition at line 92 of file qSlicerExtensionsManagerModel.h.

◆ Pimpl

typedef qSlicerExtensionsManagerModelPrivate qSlicerExtensionsManagerModel::Pimpl

Pimpl typedef.

Definition at line 80 of file qSlicerExtensionsManagerModel.h.

◆ Self

Self typedef.

Definition at line 83 of file qSlicerExtensionsManagerModel.h.

◆ Superclass

Superclass typedef.

Definition at line 77 of file qSlicerExtensionsManagerModel.h.

Member Enumeration Documentation

◆ MatadataSource

Enumerator
MetadataAll 

return local metadata, and if any fields are not set locally then set it from the server

MetadataLocal 

return local metadata (stored in s4ext files in the extensions folder)

MetadataServer 

return metadata downloaded from the server

Definition at line 153 of file qSlicerExtensionsManagerModel.h.

◆ ServerAPI

Enumerator
Girder_v1 
ServerAPI_Last 

Definition at line 94 of file qSlicerExtensionsManagerModel.h.

Property Documentation

◆ autoInstallDependencies

bool qSlicerExtensionsManagerModel::autoInstallDependencies
readwrite

Automatically install all dependencies (other extensions that the installed extension requires) when installing an extension.

Definition at line 73 of file qSlicerExtensionsManagerModel.h.

◆ autoUpdateCheck

bool qSlicerExtensionsManagerModel::autoUpdateCheck
readwrite

Download extensions metadata from the server at application startup to allow the application to display update available indicator.

Definition at line 69 of file qSlicerExtensionsManagerModel.h.

◆ autoUpdateInstall

bool qSlicerExtensionsManagerModel::autoUpdateInstall
readwrite

Automatically install any extension updates.

Definition at line 71 of file qSlicerExtensionsManagerModel.h.

◆ availableUpdateExtensions

QStringList qSlicerExtensionsManagerModel::availableUpdateExtensions
read

Names of extensions that have updates available on the server.

Definition at line 61 of file qSlicerExtensionsManagerModel.h.

◆ bookmarkedExtensions

QStringList qSlicerExtensionsManagerModel::bookmarkedExtensions
read

Names of bookmarked extensions.

Definition at line 57 of file qSlicerExtensionsManagerModel.h.

◆ enabledExtensions

QStringList qSlicerExtensionsManagerModel::enabledExtensions
read

Definition at line 59 of file qSlicerExtensionsManagerModel.h.

◆ extensionsSettingsFilePath

QString qSlicerExtensionsManagerModel::extensionsSettingsFilePath
readwrite

Definition at line 64 of file qSlicerExtensionsManagerModel.h.

◆ installedExtensions

QStringList qSlicerExtensionsManagerModel::installedExtensions
read

Definition at line 58 of file qSlicerExtensionsManagerModel.h.

◆ installedExtensionsCount

int qSlicerExtensionsManagerModel::installedExtensionsCount
read

Definition at line 51 of file qSlicerExtensionsManagerModel.h.

◆ interactive

bool qSlicerExtensionsManagerModel::interactive
readwrite

Definition at line 63 of file qSlicerExtensionsManagerModel.h.

◆ managedExtensions

QStringList qSlicerExtensionsManagerModel::managedExtensions
read

Names of extensions that are installed or bookmarked.

Definition at line 55 of file qSlicerExtensionsManagerModel.h.

◆ managedExtensionsCount

int qSlicerExtensionsManagerModel::managedExtensionsCount
read

Number of extensions that are installed or bookmarked.

Definition at line 53 of file qSlicerExtensionsManagerModel.h.

◆ newExtensionEnabledByDefault

bool qSlicerExtensionsManagerModel::newExtensionEnabledByDefault
readwrite

Definition at line 62 of file qSlicerExtensionsManagerModel.h.

◆ numberOfInstalledExtensions

int qSlicerExtensionsManagerModel::numberOfInstalledExtensions
read

Definition at line 50 of file qSlicerExtensionsManagerModel.h.

◆ slicerArch

QString qSlicerExtensionsManagerModel::slicerArch
readwrite

Definition at line 67 of file qSlicerExtensionsManagerModel.h.

◆ slicerOs

QString qSlicerExtensionsManagerModel::slicerOs
readwrite

Definition at line 66 of file qSlicerExtensionsManagerModel.h.

◆ slicerRevision

QString qSlicerExtensionsManagerModel::slicerRevision
readwrite

Definition at line 65 of file qSlicerExtensionsManagerModel.h.

Constructor & Destructor Documentation

◆ qSlicerExtensionsManagerModel()

qSlicerExtensionsManagerModel::qSlicerExtensionsManagerModel ( QObject *  parent = nullptr)
explicit

Constructor.

◆ ~qSlicerExtensionsManagerModel()

qSlicerExtensionsManagerModel::~qSlicerExtensionsManagerModel ( )
override

Destructor.

Member Function Documentation

◆ aboutToLoadExtensions

void qSlicerExtensionsManagerModel::aboutToLoadExtensions ( )
slot

Call this method when extensions are started to be loaded. It allows to the model to know which extensions are loaded, which is important because after application startup extensions cannot be immediately loaded or unloaded.

◆ activeTasks()

QStringList qSlicerExtensionsManagerModel::activeTasks ( ) const

Number of operations in progress.

◆ autoInstallDependencies()

bool qSlicerExtensionsManagerModel::autoInstallDependencies ( ) const

◆ autoUpdateCheck()

bool qSlicerExtensionsManagerModel::autoUpdateCheck ( ) const

◆ autoUpdateInstall()

bool qSlicerExtensionsManagerModel::autoUpdateInstall ( ) const

◆ autoUpdateSettingsChanged

void qSlicerExtensionsManagerModel::autoUpdateSettingsChanged ( )
signal

Emitted when autoUpdateCheck, autoUpdateInstall, or autoInstallDependencies properties are changed.

◆ availableUpdateExtensions()

QStringList qSlicerExtensionsManagerModel::availableUpdateExtensions ( ) const

Get list of extension names that has available updates.

See also
checkForUpdates

◆ bookmarkedExtensions()

QStringList qSlicerExtensionsManagerModel::bookmarkedExtensions ( ) const

Return names of all bookmarked extensions.

See also
setExtensionBookmarked, extensionBookmarkedChanged, bookmarkedExtensions

◆ cancelExtensionScheduledForUninstall

bool qSlicerExtensionsManagerModel::cancelExtensionScheduledForUninstall ( const QString &  extensionName)
slot

Cancel the uninstallation of extensionName Tell the application to keep extensionName installed.

See also
scheduleExtensionForUninstall

◆ cancelExtensionScheduledForUpdate

bool qSlicerExtensionsManagerModel::cancelExtensionScheduledForUpdate ( const QString &  extensionName)
slot

Cancel the update of extensionName Tell the application to keep extensionName installed.

See also
scheduleExtensionForUninstall

◆ checkForExtensionsUpdates

void qSlicerExtensionsManagerModel::checkForExtensionsUpdates ( )
slot

Compares current extensions versions with versions available on the server. Emits extensionMetadataUpdated(QString extensionName) and emit extensionUpdatesAvailable(bool found) signals. If Extensions/AutoUpdateInstall is enabled in application settings then this will also install the updated extensions.

◆ checkInstallPrerequisites

QStringList qSlicerExtensionsManagerModel::checkInstallPrerequisites ( ) const
slot

◆ convertExtensionMetadata()

static ExtensionMetadataType qSlicerExtensionsManagerModel::convertExtensionMetadata ( const ExtensionMetadataType extensionMetadata,
int  serverAPI 
)
static

Convert server keys to extensions manager model keys.

See also
serverToExtensionDescriptionKey()

◆ downloadAndInstallExtension

bool qSlicerExtensionsManagerModel::downloadAndInstallExtension ( const QString &  extensionId,
bool  installDependencies = true 
)
slot

Download and install extensionId The extensionId corresponds to the identifier used on the extension server itself.

See also
installExtension, scheduleExtensionForUninstall, uninstallScheduledExtensions

◆ downloadAndInstallExtensionByName

bool qSlicerExtensionsManagerModel::downloadAndInstallExtensionByName ( const QString &  extensionId,
bool  installDependencies = true 
)
slot

Download and install extensionId The extensionId corresponds to the identifier used on the extension server itself. This method is used by the extensions.slicer.org extension installer.

See also
installExtension, scheduleExtensionForUninstall, uninstallScheduledExtensions

◆ downloadFinished

void qSlicerExtensionsManagerModel::downloadFinished ( QNetworkReply *  reply)
signal

◆ downloadStarted

void qSlicerExtensionsManagerModel::downloadStarted ( QNetworkReply *  reply)
signal

◆ enabledExtensions()

QStringList qSlicerExtensionsManagerModel::enabledExtensions ( ) const

Return names of all enabled extensions sorted in alphabetical order.

See also
setExtensionEnabled, extensionEnabledChanged, isExtensionEnabled

◆ exportExtensionList

bool qSlicerExtensionsManagerModel::exportExtensionList ( QString &  exportFilePath)
slot

◆ extensionBookmarkedChanged

void qSlicerExtensionsManagerModel::extensionBookmarkedChanged ( const QString &  extensionName,
bool  value 
)
signal

Emitted when bookmark is added to or removed from an extension.

◆ extensionCancelledScheduleForUninstall

void qSlicerExtensionsManagerModel::extensionCancelledScheduleForUninstall ( const QString &  extensionName)
signal

◆ extensionCancelledScheduleForUpdate

void qSlicerExtensionsManagerModel::extensionCancelledScheduleForUpdate ( const QString &  extensionName)
signal

◆ extensionDescription()

Q_INVOKABLE QString qSlicerExtensionsManagerModel::extensionDescription ( const QString &  extensionName) const

◆ extensionDescriptionFile()

Q_INVOKABLE QString qSlicerExtensionsManagerModel::extensionDescriptionFile ( const QString &  extensionName) const

◆ extensionEnabledChanged

void qSlicerExtensionsManagerModel::extensionEnabledChanged ( const QString &  extensionName,
bool  value 
)
signal

◆ extensionIdentifedAsIncompatible

void qSlicerExtensionsManagerModel::extensionIdentifedAsIncompatible ( const QString &  extensionName)
signal

◆ extensionInstalled

void qSlicerExtensionsManagerModel::extensionInstalled ( const QString &  extensionName)
signal

◆ extensionInstallPath()

Q_INVOKABLE QString qSlicerExtensionsManagerModel::extensionInstallPath ( const QString &  extensionName) const

◆ extensionMetadata()

Q_INVOKABLE ExtensionMetadataType qSlicerExtensionsManagerModel::extensionMetadata ( const QString &  extensionName,
int  source = MetadataAll 
) const

◆ extensionMetadataUpdated

void qSlicerExtensionsManagerModel::extensionMetadataUpdated ( const QString &  extensionName)
signal

Emitted when extension metadata (description, icon URL, etc. is updated)

◆ extensionModulePaths()

Q_INVOKABLE QStringList qSlicerExtensionsManagerModel::extensionModulePaths ( const QString &  extensionName) const

◆ extensionScheduledForUninstall

void qSlicerExtensionsManagerModel::extensionScheduledForUninstall ( const QString &  extensionName)
signal

◆ extensionScheduledForUpdate

void qSlicerExtensionsManagerModel::extensionScheduledForUpdate ( const QString &  extensionName)
signal

◆ extensionsInstallPath()

Q_INVOKABLE QString qSlicerExtensionsManagerModel::extensionsInstallPath ( ) const

◆ extensionsListUrl()

Q_INVOKABLE QUrl qSlicerExtensionsManagerModel::extensionsListUrl ( ) const

Returns the URL of the extensions manager frontend for the current application version and operating system.

◆ extensionsSettingsFilePath()

QString qSlicerExtensionsManagerModel::extensionsSettingsFilePath ( ) const

Set/Get extension settings file path.

Signal extensionsSettingsFilePathChanged() is emitted when a new path is set.

◆ extensionsSettingsFilePathChanged

void qSlicerExtensionsManagerModel::extensionsSettingsFilePathChanged ( const QString &  extensionsSettingsFilePath)
signal

◆ extensionUninstalled

void qSlicerExtensionsManagerModel::extensionUninstalled ( const QString &  extensionName)
signal

◆ extensionUpdateAvailable

void qSlicerExtensionsManagerModel::extensionUpdateAvailable ( const QString &  extensionName)
signal

◆ extensionUpdated

void qSlicerExtensionsManagerModel::extensionUpdated ( const QString &  extensionName)
signal

◆ extensionUpdatesAvailable

void qSlicerExtensionsManagerModel::extensionUpdatesAvailable ( bool  available)
signal

Emitted after updates are checked on the extensions server.

◆ extractExtensionArchive()

Q_INVOKABLE bool qSlicerExtensionsManagerModel::extractExtensionArchive ( const QString &  extensionName,
const QString &  archiveFile,
const QString &  destinationPath 
)

Extract archiveFile into destinationPath/extensionName directory.

◆ filterExtensionMetadata()

static ExtensionMetadataType qSlicerExtensionsManagerModel::filterExtensionMetadata ( const ExtensionMetadataType extensionMetadata,
int  serverAPI 
)
static

Remove server metadata fields that should be ignored.

See also
serverKeysToIgnore()

◆ frontendServerUrl()

Q_INVOKABLE QUrl qSlicerExtensionsManagerModel::frontendServerUrl ( ) const

Frontend server URL displaying extension manager web page.

If set, it returns the value associated with SLICER_EXTENSIONS_MANAGER_FRONTEND_SERVER_URL environment variable. Otherwise, it returns the extensions settings value Extensions/FrontendServerUrl.

See also
extensionsSettingsFilePath()

◆ identifyIncompatibleExtensions

void qSlicerExtensionsManagerModel::identifyIncompatibleExtensions ( )
slot

◆ installDownloadProgress

void qSlicerExtensionsManagerModel::installDownloadProgress ( const QString &  extensionName,
qint64  received,
qint64  total 
)
signal

◆ installedExtensions()

QStringList qSlicerExtensionsManagerModel::installedExtensions ( ) const

Return names of all installed extensions sorted in alphabetical order.

See also
installExtension, installedExtensionsCount, isExtensionInstalled, extensionInstalled

◆ installedExtensionsCount()

int qSlicerExtensionsManagerModel::installedExtensionsCount ( ) const

Return the number of installed extensions.

See also
installExtension, isExtensionInstalled, installedExtensions, extensionInstalled

◆ installExtension() [1/2]

Q_INVOKABLE bool qSlicerExtensionsManagerModel::installExtension ( const QString &  archiveFile,
bool  installDependencies = true 
)

Install extension from the specified archive file.

This attempts to install an extension given only the archive file containing the extension. The archive file is inspected in order to determine the extension name.

See also
installExtension(const QString&,ExtensionMetadataType,const QString&)

◆ installExtension() [2/2]

Q_INVOKABLE bool qSlicerExtensionsManagerModel::installExtension ( const QString &  extensionName,
ExtensionMetadataType  extensionMetadata,
const QString &  archiveFile,
bool  installDependencies = true 
)

Install extension.

This attempts to install an extension with the specified name and metadata from the specified archive file. If the metadata is empty, the metadata from the extension description contained in the archive is used.

See also
isExtensionScheduledForUninstall, extensionScheduledForUninstall

◆ interactive()

bool qSlicerExtensionsManagerModel::interactive ( ) const

If set to true (by default) then the user may be asked to confirm installation of additional dependencies. If set to false then no blocking popups are displayed and dependencies are installed automatically.

◆ interactiveChanged

void qSlicerExtensionsManagerModel::interactiveChanged ( bool  interactive)
signal

◆ isExtensionBookmarked()

Q_INVOKABLE bool qSlicerExtensionsManagerModel::isExtensionBookmarked ( const QString &  extensionName) const

Return True if the extensionName is bookmarked. Bookmarked extensions are included in the list of managed extensions list, even if not installed.

See also
setExtensionBookmarked, extensionBookmarkedChanged, bookmarkedExtensions

◆ isExtensionCompatible() [1/2]

Q_INVOKABLE QStringList qSlicerExtensionsManagerModel::isExtensionCompatible ( const QString &  extensionName,
const QString &  slicerRevision,
const QString &  slicerOs,
const QString &  slicerArch 
) const

Check if extensionName is compatible with the system identified by slicerRevision, slicerOs and slicerArch.

Returns
Return the reasons justifying the incompatibility or an empty list if the extension is compatible.

◆ isExtensionCompatible() [2/2]

Q_INVOKABLE QStringList qSlicerExtensionsManagerModel::isExtensionCompatible ( const QString &  extensionName) const

Check if extensionName is compatible. An extension is considered incompatible when the version of Slicer used to build the extension is different from the version of Slicer attempting to load the extension.

See also
isExtensionCompatible(const QString&, const QString&, const QString&)
setSlicerRevision, setSlicerOs, setSlicerArch, setSlicerRequirements

◆ isExtensionEnabled()

Q_INVOKABLE bool qSlicerExtensionsManagerModel::isExtensionEnabled ( const QString &  extensionName) const

Return True if the extensionName is enabled.

See also
setExtensionEnabled, extensionEnabledChanged, enabledExtensions

◆ isExtensionInstalled()

Q_INVOKABLE bool qSlicerExtensionsManagerModel::isExtensionInstalled ( const QString &  extensionName) const

Return True if the extensionName is installed.

See also
installExtension, installedExtensionsCount, installedExtensions, extensionInstalled

◆ isExtensionLoaded()

bool qSlicerExtensionsManagerModel::isExtensionLoaded ( const QString &  extensionName) const

Return True if the extensionName is loaded.

◆ isExtensionScheduledForUninstall()

Q_INVOKABLE bool qSlicerExtensionsManagerModel::isExtensionScheduledForUninstall ( const QString &  extensionName) const

Return True if the extensionName is scheduled to be uninstalled.

See also
uninstallScheduledExtensions();

◆ isExtensionScheduledForUpdate()

Q_INVOKABLE bool qSlicerExtensionsManagerModel::isExtensionScheduledForUpdate ( const QString &  extensionName) const

Test if extension is scheduled to be updated.

Returns
true if extensionName is scheduled to be updated.
See also
updateScheduledExtensions();

◆ isExtensionUpdateAvailable()

Q_INVOKABLE bool qSlicerExtensionsManagerModel::isExtensionUpdateAvailable ( const QString &  extensionName) const

Check if an update is known to be available for the specified extension.

Returns
true if a previous check for updates has determined that an update is available for the specified extension.
See also
checkForUpdates

◆ lastUpdateTimeExtensionsMetadataFromServer()

QDateTime qSlicerExtensionsManagerModel::lastUpdateTimeExtensionsMetadataFromServer ( )

Return time of last successful update of extensions metadata from the server. If there has not been any updates then it the object is set to null.

◆ managedExtensions()

QStringList qSlicerExtensionsManagerModel::managedExtensions ( ) const

Return names of all managed extensions, i.e., installed or bookmarked extensions.

◆ managedExtensionsCount()

int qSlicerExtensionsManagerModel::managedExtensionsCount ( ) const

Return the number of managed extensions.

See also
managedExtensionsCount, installedExtensionsCount, bookmarkedExtensionsCount

◆ messageLogged

void qSlicerExtensionsManagerModel::messageLogged ( const QString &  text,
ctkErrorLogLevel::LogLevels  level 
) const
signal

◆ model()

Q_INVOKABLE const QStandardItemModel* qSlicerExtensionsManagerModel::model ( ) const

Return the item model used internally.

◆ modelUpdated

void qSlicerExtensionsManagerModel::modelUpdated ( )
signal

◆ newExtensionEnabledByDefault()

bool qSlicerExtensionsManagerModel::newExtensionEnabledByDefault ( ) const

◆ newExtensionEnabledByDefaultChanged

void qSlicerExtensionsManagerModel::newExtensionEnabledByDefaultChanged ( bool  value)
signal

◆ numberOfInstalledExtensions()

int qSlicerExtensionsManagerModel::numberOfInstalledExtensions ( ) const

Return the number of installed extensions. Deprecated, use installedExtensionsCount instead.

See also
installExtension, isExtensionInstalled, installedExtensions, extensionInstalled

◆ onExtensionsMetadataFromServerQueryFinished

bool qSlicerExtensionsManagerModel::onExtensionsMetadataFromServerQueryFinished ( const QUuid &  requestId)
protectedslot

◆ onInstallDownloadFinished

void qSlicerExtensionsManagerModel::onInstallDownloadFinished ( qSlicerExtensionDownloadTask task)
protectedslot

◆ onInstallDownloadProgress

void qSlicerExtensionsManagerModel::onInstallDownloadProgress ( qSlicerExtensionDownloadTask task,
qint64  received,
qint64  total 
)
protectedslot

◆ onUpdateDownloadFinished

void qSlicerExtensionsManagerModel::onUpdateDownloadFinished ( qSlicerExtensionDownloadTask task)
protectedslot

◆ onUpdateDownloadProgress

void qSlicerExtensionsManagerModel::onUpdateDownloadProgress ( qSlicerExtensionDownloadTask task,
qint64  received,
qint64  total 
)
protectedslot

◆ parseExtensionDescriptionFile()

static ExtensionMetadataType qSlicerExtensionsManagerModel::parseExtensionDescriptionFile ( const QString &  file)
static

◆ readArrayValues()

static QStringList qSlicerExtensionsManagerModel::readArrayValues ( QSettings &  settings,
const QString &  arrayName,
const QString  fieldName 
)
static

◆ scheduledForUninstallExtensions()

QStringList qSlicerExtensionsManagerModel::scheduledForUninstallExtensions ( ) const

Return names of all extensions scheduled for uninstall.

See also
scheduleExtensionForUninstall, isExtensionScheduledForUninstall, extensionScheduledForUninstall

◆ scheduledForUpdateExtensions()

QStringList qSlicerExtensionsManagerModel::scheduledForUpdateExtensions ( ) const

Get the names of all extensions scheduled for update.

See also
scheduleExtensionForUpdate, isExtensionScheduledForUpdate, extensionScheduledForUpdate

◆ scheduleExtensionForUninstall

bool qSlicerExtensionsManagerModel::scheduleExtensionForUninstall ( const QString &  extensionName)
slot

Schedule extensionName of uninstall Tell the application to uninstall extensionName when it will restart An extension scheduled for uninstall can be effectively uninstalled by calling uninstallScheduledExtensions()

See also
isExtensionScheduledForUninstall, uninstallScheduledExtensions

◆ scheduleExtensionForUpdate

bool qSlicerExtensionsManagerModel::scheduleExtensionForUpdate ( const QString &  extensionName)
slot

Schedule extensionName to be updated (reinstalled).

This records extensionName in the list of extensions scheduled to be updated (which is done by reinstalling the extension at next startup).

See also
isExtensionScheduledForUpdate, updateScheduledExtensions

◆ serverAPI()

int qSlicerExtensionsManagerModel::serverAPI ( ) const

Return current serverAPI.

See also
serverAPIFromString()

◆ serverAPIFromString()

static int qSlicerExtensionsManagerModel::serverAPIFromString ( const QString &  str)
static

Return ServerAPI from the string str.

See also
serverAPIToString()

◆ serverAPIToString()

static QString qSlicerExtensionsManagerModel::serverAPIToString ( int  serverAPI)
static

Return a string representation of the serverAPI.

See also
serverAPIFromString()

◆ serverKeysToIgnore()

static QStringList qSlicerExtensionsManagerModel::serverKeysToIgnore ( int  serverAPI)
static

Server metadata fields that should not be copied to the extensions manager model.

See also
filterExtensionMetadata()

◆ serverToExtensionDescriptionKey()

static QHash<QString, QString> qSlicerExtensionsManagerModel::serverToExtensionDescriptionKey ( int  serverAPI)
static

Conversion map to get extensions manager model keys from metadata returned by the extensions server

See also
convertExtensionMetadata()

◆ serverUrl()

Q_INVOKABLE QUrl qSlicerExtensionsManagerModel::serverUrl ( ) const

Backend server URL used to perform API calls.

If set, it returns the value associated with SLICER_EXTENSIONS_MANAGER_SERVER_URL environment variable. Otherwise, it returns the extensions settings value Extensions/ServerUrl.

See also
extensionsSettingsFilePath()

◆ setAutoInstallDependencies

void qSlicerExtensionsManagerModel::setAutoInstallDependencies ( bool  enable)
slot

◆ setAutoUpdateCheck

void qSlicerExtensionsManagerModel::setAutoUpdateCheck ( bool  enable)
slot

◆ setAutoUpdateInstall

void qSlicerExtensionsManagerModel::setAutoUpdateInstall ( bool  enable)
slot

◆ setExtensionBookmarked

void qSlicerExtensionsManagerModel::setExtensionBookmarked ( const QString &  extensionName,
bool  value 
)
slot

Add/remove bookmark for an extension. Add/remove this extension from the list of bookmarked extensions in the application settings.

◆ setExtensionEnabled

void qSlicerExtensionsManagerModel::setExtensionEnabled ( const QString &  extensionName,
bool  value 
)
slot

Enable or disable an extension. Tell the application to load (or skip the loading) of extensionName by adding (or removing) all associated module paths to the application settings.

◆ setExtensionsSettingsFilePath()

void qSlicerExtensionsManagerModel::setExtensionsSettingsFilePath ( const QString &  extensionsSettingsFilePath)

◆ setInteractive

void qSlicerExtensionsManagerModel::setInteractive ( bool  value)
slot

◆ setNewExtensionEnabledByDefault()

void qSlicerExtensionsManagerModel::setNewExtensionEnabledByDefault ( bool  value)

◆ setSlicerArch()

void qSlicerExtensionsManagerModel::setSlicerArch ( const QString &  arch)

◆ setSlicerOs()

void qSlicerExtensionsManagerModel::setSlicerOs ( const QString &  os)

◆ setSlicerRequirements()

void qSlicerExtensionsManagerModel::setSlicerRequirements ( const QString &  revision,
const QString &  os,
const QString &  arch 
)

Convenience function setting Slicer revision, operating system and architecture.

Signal slicerRevisionChanged(), slicerArchChanged() and slicerArchChanged() are emitted only if the corresponding value is updated.

The, signal slicerRequirementsChanged() is emitted only once it at least one of the three properties has been updated.

◆ setSlicerRevision()

void qSlicerExtensionsManagerModel::setSlicerRevision ( const QString &  revision)

◆ setSlicerVersion()

void qSlicerExtensionsManagerModel::setSlicerVersion ( const QString &  version)

◆ slicerArch()

QString qSlicerExtensionsManagerModel::slicerArch ( ) const

Set/Get Slicer architecture.

Signal slicerArchChanged() is emitted when a new architecture is set.

◆ slicerArchChanged

void qSlicerExtensionsManagerModel::slicerArchChanged ( const QString &  slicerArch)
signal

◆ slicerOs()

QString qSlicerExtensionsManagerModel::slicerOs ( ) const

Set/Get Slicer operating system.

Signal slicerOsChanged() is emitted when a new operating system is set.

◆ slicerOsChanged

void qSlicerExtensionsManagerModel::slicerOsChanged ( const QString &  slicerOs)
signal

◆ slicerRequirementsChanged

void qSlicerExtensionsManagerModel::slicerRequirementsChanged ( const QString &  revision,
const QString &  os,
const QString &  arch 
)
signal

◆ slicerRevision()

QString qSlicerExtensionsManagerModel::slicerRevision ( ) const

Set/Get Slicer revision.

Signal slicerRevisionChanged() is emitted when a revision is set.

◆ slicerRevisionChanged

void qSlicerExtensionsManagerModel::slicerRevisionChanged ( const QString &  slicerRevision)
signal

◆ slicerVersion()

QString qSlicerExtensionsManagerModel::slicerVersion ( ) const

◆ slicerVersionChanged

void qSlicerExtensionsManagerModel::slicerVersionChanged ( const QString &  slicerVersion)
signal

◆ uninstallExtension()

bool qSlicerExtensionsManagerModel::uninstallExtension ( const QString &  extensionName)

Uninstall extensionName It is only allowed if the extension is not loaded already. If the extension is already loaded then use scheduleExtensionForUninstall instead.

Note
The directory containing the extension will be deleted.
See also
installExtension

◆ uninstallScheduledExtensions [1/2]

bool qSlicerExtensionsManagerModel::uninstallScheduledExtensions ( QStringList &  uninstalledExtensions)
slot

Uninstall extensions scheduled for uninstall.

Parameters
uninstalledExtensionsQStringList which received the list of extensions which are successfully uninstalled.
Returns
true if all scheduled extensions are successfully uninstalled.
See also
scheduleExtensionForUninstall, isExtensionScheduledForUninstall,

◆ uninstallScheduledExtensions [2/2]

bool qSlicerExtensionsManagerModel::uninstallScheduledExtensions ( )
slot

Uninstall extensions scheduled for uninstall.

Returns
true if all scheduled extensions are successfully uninstalled.
See also
scheduleExtensionForUninstall, isExtensionScheduledForUninstall,

◆ updateDownloadProgress

void qSlicerExtensionsManagerModel::updateDownloadProgress ( const QString &  extensionName,
qint64  received,
qint64  total 
)
signal

◆ updateExtensionsMetadataFromServer

bool qSlicerExtensionsManagerModel::updateExtensionsMetadataFromServer ( bool  force = false,
bool  waitForCompletion = false 
)
slot

Request updating the extension metadata that is stored on the extensions server. Only queries the extensions server if update is due (sufficient time is elapsed since the last update), or force is set to true. The last query result is saved and if the server is not contacted then this cached information is used. Set waitForCompletion to true to make sure all metadata is up-to-date when the method returns. Returns false if waitForCompletion is set to true and metadata cannot be retrieved.

◆ updateExtensionsMetadataFromServerCompleted

void qSlicerExtensionsManagerModel::updateExtensionsMetadataFromServerCompleted ( bool  success)
signal

Emitted when metadata download from the extensions server is completed.

◆ updateModel

void qSlicerExtensionsManagerModel::updateModel ( )
slot

Full update of the extensions from extension description files and settings.

◆ updateScheduledExtensions [1/2]

bool qSlicerExtensionsManagerModel::updateScheduledExtensions ( QStringList &  updatedExtensions)
slot

Update extensions scheduled for update.

Parameters
updatedExtensionsQStringList which received the list of extensions which are successfully updated.
Returns
true if all scheduled extensions are successfully updated.
See also
scheduleExtensionForUpdate, isExtensionScheduledForUpdate

◆ updateScheduledExtensions [2/2]

bool qSlicerExtensionsManagerModel::updateScheduledExtensions ( )
slot

Update extensions scheduled for update.

Returns
true if all scheduled extensions are successfully updated.
See also
scheduleExtensionForUpdate, isExtensionScheduledForUpdate

◆ writeArrayValues()

static void qSlicerExtensionsManagerModel::writeArrayValues ( QSettings &  settings,
const QStringList &  values,
const QString &  arrayName,
const QString  fieldName 
)
static

◆ writeExtensionDescriptionFile()

static bool qSlicerExtensionsManagerModel::writeExtensionDescriptionFile ( const QString &  file,
const ExtensionMetadataType metadata 
)
static

Member Data Documentation

◆ d_ptr

QScopedPointer<qSlicerExtensionsManagerModelPrivate> qSlicerExtensionsManagerModel::d_ptr
protected

Definition at line 553 of file qSlicerExtensionsManagerModel.h.


The documentation for this class was generated from the following file: