Slicer  5.3
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
qSlicerApplicationUpdateManager Class Reference

Class querying application updates on the download server. More...

#include <Base/QTCore/qSlicerApplicationUpdateManager.h>

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

Public Types

typedef qSlicerApplicationUpdateManagerPrivate Pimpl
 Pimpl typedef. More...
 
typedef qSlicerApplicationUpdateManager Self
 Self typedef. More...
 
typedef QObject Superclass
 Superclass typedef. More...
 

Properties

QUrl applicationDownloadPageUrl
 
bool autoUpdateCheck
 Periodically check for updates on the server. More...
 
bool isUpdateAvailable
 
QString latestReleaseVersion
 
QString slicerArch
 
QString slicerOs
 
QString slicerRevision
 

Public Slots

void checkForUpdate ()
 
void setAutoUpdateCheck (bool enable)
 Enable/disable automatic periodic update checks on the server. More...
 

Signals

void autoUpdateCheckChanged ()
 Emitted when autoUpdateCheck property is changed. More...
 
void updateAvailable (bool isAvailable)
 
void updateCheckCompleted (bool success)
 Emitted when availability update check is completed. More...
 
void slicerRequirementsChanged (const QString &revision, const QString &os, const QString &arch)
 

Public Member Functions

QUrl applicationDownloadPageUrl () const
 
bool autoUpdateCheck () const
 
bool checkForUpdate (bool force, bool waitForCompletion)
 Check for updates. Reads the last cached value if recently queries from the server. Emits updateAvailable(bool) signal if update has become available/unavailable. More...
 
bool isUpdateAvailable () const
 Return True if an updated version is available for the application Does not call checkForUpdate(). More...
 
QDateTime lastUpdateCheckTime () const
 
QString latestReleaseRevision () const
 Return latest application release version (e.g., 30893) More...
 
QString latestReleaseVersion () const
 Return latest application release version (e.g., 5.0.3) More...
 
 qSlicerApplicationUpdateManager (QObject *parent=nullptr)
 Constructor. More...
 
Q_INVOKABLE QUrl serverUrl () const
 Application update server URL used to perform API calls. More...
 
void setSlicerRequirements (const QString &revision, const QString &os, const QString &arch)
 Set Slicer revision, operating system and architecture. More...
 
QString slicerArch () const
 
QString slicerOs () const
 
QString slicerRevision () const
 
 ~qSlicerApplicationUpdateManager () override
 Destructor. More...
 

Static Public Member Functions

static bool isApplicationUpdateEnabled ()
 

Protected Slots

bool onReleaseInfoQueryFinished (const QUuid &requestId)
 
void refreshUpdateAvailable ()
 

Protected Attributes

QScopedPointer< qSlicerApplicationUpdateManagerPrivate > d_ptr
 

Detailed Description

Class querying application updates on the download server.

Automatic update check is enabled/disabled by ApplicationUpdates/Enabled application setting, enabled by default.

Application update feature can be excluded from the build by setting CMake variable Slicer_BUILD_APPLICATIONUPDATE_SUPPORT=OFF.

Definition at line 39 of file qSlicerApplicationUpdateManager.h.

Member Typedef Documentation

◆ Pimpl

typedef qSlicerApplicationUpdateManagerPrivate qSlicerApplicationUpdateManager::Pimpl

Pimpl typedef.

Definition at line 56 of file qSlicerApplicationUpdateManager.h.

◆ Self

Self typedef.

Definition at line 59 of file qSlicerApplicationUpdateManager.h.

◆ Superclass

Superclass typedef.

Definition at line 53 of file qSlicerApplicationUpdateManager.h.

Property Documentation

◆ applicationDownloadPageUrl

QUrl qSlicerApplicationUpdateManager::applicationDownloadPageUrl
read

Definition at line 49 of file qSlicerApplicationUpdateManager.h.

◆ autoUpdateCheck

bool qSlicerApplicationUpdateManager::autoUpdateCheck
readwrite

Periodically check for updates on the server.

Definition at line 46 of file qSlicerApplicationUpdateManager.h.

◆ isUpdateAvailable

bool qSlicerApplicationUpdateManager::isUpdateAvailable
read

Definition at line 47 of file qSlicerApplicationUpdateManager.h.

◆ latestReleaseVersion

QString qSlicerApplicationUpdateManager::latestReleaseVersion
read

Definition at line 48 of file qSlicerApplicationUpdateManager.h.

◆ slicerArch

QString qSlicerApplicationUpdateManager::slicerArch
read

Definition at line 44 of file qSlicerApplicationUpdateManager.h.

◆ slicerOs

QString qSlicerApplicationUpdateManager::slicerOs
read

Definition at line 43 of file qSlicerApplicationUpdateManager.h.

◆ slicerRevision

QString qSlicerApplicationUpdateManager::slicerRevision
read

Definition at line 42 of file qSlicerApplicationUpdateManager.h.

Constructor & Destructor Documentation

◆ qSlicerApplicationUpdateManager()

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

Constructor.

◆ ~qSlicerApplicationUpdateManager()

qSlicerApplicationUpdateManager::~qSlicerApplicationUpdateManager ( )
override

Destructor.

Member Function Documentation

◆ applicationDownloadPageUrl()

QUrl qSlicerApplicationUpdateManager::applicationDownloadPageUrl ( ) const

Return URL string of the application download website (html page that can be displayed for the user).

◆ autoUpdateCheck()

bool qSlicerApplicationUpdateManager::autoUpdateCheck ( ) const

◆ autoUpdateCheckChanged

void qSlicerApplicationUpdateManager::autoUpdateCheckChanged ( )
signal

Emitted when autoUpdateCheck property is changed.

◆ checkForUpdate() [1/2]

bool qSlicerApplicationUpdateManager::checkForUpdate ( bool  force,
bool  waitForCompletion 
)

Check for updates. Reads the last cached value if recently queries from the server. Emits updateAvailable(bool) signal if update has become available/unavailable.

Parameters
forceset to true to force query from the server.
waitForCompletionset to true to wait for the server response
Returns
if waitForCompletion is enabled then this returns true if query was successful

◆ checkForUpdate [2/2]

void qSlicerApplicationUpdateManager::checkForUpdate ( )
slot

Checks for application update (server query is not forced, does not wait for completion)

See also
checkForUpdate(bool, bool)

◆ isApplicationUpdateEnabled()

static bool qSlicerApplicationUpdateManager::isApplicationUpdateEnabled ( )
static

Return true if application update is enabled in application settings (ApplicationUpdates/Enabled). Enabled by default.

◆ isUpdateAvailable()

bool qSlicerApplicationUpdateManager::isUpdateAvailable ( ) const

Return True if an updated version is available for the application Does not call checkForUpdate().

◆ lastUpdateCheckTime()

QDateTime qSlicerApplicationUpdateManager::lastUpdateCheckTime ( ) const

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.

◆ latestReleaseRevision()

QString qSlicerApplicationUpdateManager::latestReleaseRevision ( ) const

Return latest application release version (e.g., 30893)

◆ latestReleaseVersion()

QString qSlicerApplicationUpdateManager::latestReleaseVersion ( ) const

Return latest application release version (e.g., 5.0.3)

◆ onReleaseInfoQueryFinished

bool qSlicerApplicationUpdateManager::onReleaseInfoQueryFinished ( const QUuid &  requestId)
protectedslot

◆ refreshUpdateAvailable

void qSlicerApplicationUpdateManager::refreshUpdateAvailable ( )
protectedslot

◆ serverUrl()

Q_INVOKABLE QUrl qSlicerApplicationUpdateManager::serverUrl ( ) const

Application update server URL used to perform API calls.

If set, it returns the value from application settings value ApplicationUpdate/ServerUrl.

It is set to https://download.slicer.org by default.

For local testing during development:

◆ setAutoUpdateCheck

void qSlicerApplicationUpdateManager::setAutoUpdateCheck ( bool  enable)
slot

Enable/disable automatic periodic update checks on the server.

◆ setSlicerRequirements()

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

Set Slicer revision, operating system and architecture.

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

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

The updateAvailable(bool) signal is emitted with the update availability determined based on the new requirements.

◆ slicerArch()

QString qSlicerApplicationUpdateManager::slicerArch ( ) const

Get Slicer architecture.

See also
setSlicerRequirements

◆ slicerOs()

QString qSlicerApplicationUpdateManager::slicerOs ( ) const

Get Slicer operating system.

See also
setSlicerRequirements

◆ slicerRequirementsChanged

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

Emitted when Slicer application revision, operating system, or architecture is set.

◆ slicerRevision()

QString qSlicerApplicationUpdateManager::slicerRevision ( ) const

Get Slicer revision.

See also
setSlicerRequirements

◆ updateAvailable

void qSlicerApplicationUpdateManager::updateAvailable ( bool  isAvailable)
signal

Emitted when application update availability has changed or an update check has been completed.

◆ updateCheckCompleted

void qSlicerApplicationUpdateManager::updateCheckCompleted ( bool  success)
signal

Emitted when availability update check is completed.

Member Data Documentation

◆ d_ptr

QScopedPointer<qSlicerApplicationUpdateManagerPrivate> qSlicerApplicationUpdateManager::d_ptr
protected

Definition at line 168 of file qSlicerApplicationUpdateManager.h.


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