Slicer 5.9
Slicer is a multi-platform, free and open source software package for visualization and medical image computing
All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Modules Pages
qSlicerApplicationUpdateManager.h
Go to the documentation of this file.
1/*==============================================================================
2
3 Program: 3D Slicer
4
5 Copyright (c) Kitware Inc.
6
7 See COPYRIGHT.txt
8 or http://www.slicer.org/copyright/copyright.txt for details.
9
10 Unless required by applicable law or agreed to in writing, software
11 distributed under the License is distributed on an "AS IS" BASIS,
12 WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 See the License for the specific language governing permissions and
14 limitations under the License.
15
16==============================================================================*/
17
18#ifndef __qSlicerApplicationUpdateManager_h
19#define __qSlicerApplicationUpdateManager_h
20
21// Qt includes
22#include <QObject>
23#include <QUrl>
24#include <QUuid>
25
26// QtGUI includes
27#include "qSlicerBaseQTCoreExport.h"
28
29class qSlicerApplicationUpdateManagerPrivate;
30
39class Q_SLICER_BASE_QTCORE_EXPORT qSlicerApplicationUpdateManager : public QObject
40{
41 Q_OBJECT
42 Q_PROPERTY(QString slicerRevision READ slicerRevision)
43 Q_PROPERTY(QString slicerOs READ slicerOs)
44 Q_PROPERTY(QString slicerArch READ slicerArch)
50
51public:
53 typedef QObject Superclass;
54
56 typedef qSlicerApplicationUpdateManagerPrivate Pimpl;
57
60
62 explicit qSlicerApplicationUpdateManager(QObject* parent = nullptr);
63
66
79 Q_INVOKABLE QUrl serverUrl()const;
80
81 bool autoUpdateCheck()const;
82
88 bool checkForUpdate(bool force, bool waitForCompletion);
89
92 QDateTime lastUpdateCheckTime() const;
93
96 bool isUpdateAvailable() const;
97
99 QString latestReleaseVersion() const;
100
102 QString latestReleaseRevision() const;
103
107
110 QString slicerRevision()const;
111
114 QString slicerOs()const;
115
118 QString slicerArch()const;
119
130 void setSlicerRequirements(const QString& revision, const QString& os, const QString& arch);
131
135
136public slots:
137
141
143 void setAutoUpdateCheck(bool enable);
144
145signals:
146
149 void updateAvailable(bool isAvailable);
150
152 void updateCheckCompleted(bool success);
153
156 void slicerRequirementsChanged(const QString& revision, const QString& os, const QString& arch);
158
161
162protected slots:
163
164 bool onReleaseInfoQueryFinished(const QUuid& requestId);
166
167protected:
168 QScopedPointer<qSlicerApplicationUpdateManagerPrivate> d_ptr;
169
170private:
171 Q_DECLARE_PRIVATE(qSlicerApplicationUpdateManager);
172 Q_DISABLE_COPY(qSlicerApplicationUpdateManager);
173};
174
175#endif
void setSlicerRequirements(const QString &revision, const QString &os, const QString &arch)
Set Slicer revision, operating system and architecture.
static bool isApplicationUpdateEnabled()
void setAutoUpdateCheck(bool enable)
Enable/disable automatic periodic update checks on the server.
bool onReleaseInfoQueryFinished(const QUuid &requestId)
QScopedPointer< qSlicerApplicationUpdateManagerPrivate > d_ptr
bool checkForUpdate(bool force, bool waitForCompletion)
Check for updates. Reads the last cached value if recently queries from the server....
QString latestReleaseRevision() const
Return latest application release version (e.g., 30893)
qSlicerApplicationUpdateManager(QObject *parent=nullptr)
Constructor.
void updateCheckCompleted(bool success)
Emitted when availability update check is completed.
void updateAvailable(bool isAvailable)
qSlicerApplicationUpdateManager Self
Self typedef.
QDateTime lastUpdateCheckTime() const
void autoUpdateCheckChanged()
Emitted when autoUpdateCheck property is changed.
bool autoUpdateCheck
Periodically check for updates on the server.
void slicerRequirementsChanged(const QString &revision, const QString &os, const QString &arch)
Q_INVOKABLE QUrl serverUrl() const
Application update server URL used to perform API calls.
qSlicerApplicationUpdateManagerPrivate Pimpl
Pimpl typedef.