21 #ifndef __qSlicerExtensionsManagerModel_h 22 #define __qSlicerExtensionsManagerModel_h 26 #include <QStringList> 30 #include <QVariantMap> 33 #include <ctkErrorLogModel.h> 36 #include "qSlicerBaseQTCoreExport.h" 40 class qSlicerExtensionsManagerModelPrivate;
41 class QStandardItemModel;
46 Q_PROPERTY(
int numberOfInstalledExtensions READ numberOfInstalledExtensions NOTIFY modelUpdated)
47 Q_PROPERTY(
int installedExtensionsCount READ installedExtensionsCount NOTIFY modelUpdated)
48 Q_PROPERTY(QStringList installedExtensions READ installedExtensions NOTIFY modelUpdated)
49 Q_PROPERTY(QStringList enabledExtensions READ enabledExtensions NOTIFY modelUpdated)
50 Q_PROPERTY(
bool newExtensionEnabledByDefault READ newExtensionEnabledByDefault WRITE setNewExtensionEnabledByDefault NOTIFY newExtensionEnabledByDefaultChanged)
51 Q_PROPERTY(QString extensionsSettingsFilePath READ extensionsSettingsFilePath WRITE setExtensionsSettingsFilePath NOTIFY extensionsSettingsFilePathChanged)
52 Q_PROPERTY(QString extensionsHistorySettingsFilePath READ extensionsHistorySettingsFilePath WRITE setExtensionsHistorySettingsFilePath NOTIFY extensionsHistorySettingsFilePathChanged)
53 Q_PROPERTY(QString slicerRevision READ slicerRevision WRITE setSlicerRevision NOTIFY slicerRevisionChanged)
54 Q_PROPERTY(QString slicerOs READ slicerOs WRITE setSlicerOs NOTIFY slicerOsChanged)
55 Q_PROPERTY(QString slicerArch READ slicerArch WRITE setSlicerArch NOTIFY slicerArchChanged)
56 Q_PROPERTY(QString slicerVersion READ slicerVersion WRITE setSlicerVersion NOTIFY slicerVersionChanged)
62 typedef qSlicerExtensionsManagerModelPrivate
Pimpl;
76 Q_INVOKABLE QUrl serverUrl()const;
77 Q_INVOKABLE QUrl serverUrlWithPackagePath()const;
78 Q_INVOKABLE QUrl serverUrlWithExtensionsStorePath()const;
80 Q_INVOKABLE QString extensionsInstallPath()const;
82 Q_INVOKABLE QString extensionInstallPath(const QString& extensionName) const;
84 Q_INVOKABLE QStringList extensionModulePaths(const QString& extensionName)const;
86 Q_INVOKABLE QString extensionDescriptionFile(const QString& extensionName) const;
88 void setNewExtensionEnabledByDefault(
bool value);
89 bool newExtensionEnabledByDefault()const;
95 Q_INVOKABLE
bool isExtensionInstalled(const QString& extensionName)const;
99 int installedExtensionsCount()const;
103 int numberOfInstalledExtensions()const;
107 QStringList installedExtensions()const;
111 Q_INVOKABLE
bool isExtensionEnabled(const QString& extensionName)const;
117 QStringList scheduledForUpdateExtensions() const;
125 Q_INVOKABLE
bool isExtensionUpdateAvailable(const QString& extensionName)const;
132 Q_INVOKABLE
bool isExtensionScheduledForUpdate(const QString& extensionName)const;
136 QStringList scheduledForUninstallExtensions() const;
140 Q_INVOKABLE
bool isExtensionScheduledForUninstall(const QString& extensionName)const;
144 QStringList enabledExtensions()const;
149 QString extensionsSettingsFilePath()const;
150 void setExtensionsSettingsFilePath(const QString& extensionsSettingsFilePath);
155 QString extensionsHistorySettingsFilePath()const;
156 void setExtensionsHistorySettingsFilePath(const QString& extensionsHistorySettingsFilePath);
163 QString slicerRevision()const;
164 void setSlicerRevision(const QString& revision);
169 QString slicerOs()const;
170 void setSlicerOs(const QString& os);
175 QString slicerArch()const;
176 void setSlicerArch(const QString& arch);
185 void setSlicerRequirements(const QString& revision, const QString& os, const QString& arch);
187 QString slicerVersion()const;
188 void setSlicerVersion(const QString&
version);
194 Q_INVOKABLE QStringList isExtensionCompatible(const QString& extensionName, const QString& slicerRevision,
195 const QString& slicerOs, const QString& slicerArch) const;
203 Q_INVOKABLE QStringList isExtensionCompatible(const QString& extensionName) const;
220 Q_INVOKABLE
bool installExtension(const QString &archiveFile);
229 Q_INVOKABLE
bool installExtension(const QString& extensionName,
231 const QString &archiveFile);
234 Q_INVOKABLE
bool extractExtensionArchive(const QString& extensionName,
235 const QString& archiveFile,
236 const QString &destinationPath);
239 Q_INVOKABLE const QStandardItemModel * model()const;
241 static QHash<QString, QString> serverToExtensionDescriptionKey();
243 static QStringList serverKeysToIgnore();
247 static QStringList readArrayValues(QSettings& settings,
248 const QString& arrayName, const QString fieldName);
250 static
void writeArrayValues(QSettings& settings, const QStringList& values,
251 const QString& arrayName, const QString fieldName);
253 static
bool writeExtensionDescriptionFile(const QString& file,
263 void setExtensionEnabled(const QString& extensionName,
bool value);
268 bool downloadAndInstallExtension(const QString& extensionId);
275 bool scheduleExtensionForUninstall(const QString& extensionName);
280 bool cancelExtensionScheduledForUninstall(const QString& extensionName);
287 void checkForUpdates(
bool installUpdates);
295 bool scheduleExtensionForUpdate(const QString& extensionName);
300 bool cancelExtensionScheduledForUpdate(const QString& extensionName);
310 bool updateScheduledExtensions(QStringList &updatedExtensions);
317 bool updateScheduledExtensions();
327 bool uninstallScheduledExtensions(QStringList &uninstalledExtensions);
334 bool uninstallScheduledExtensions();
336 void gatherExtensionsHistoryInformationOnStartup();
340 void identifyIncompatibleExtensions();
342 bool exportExtensionList(QString& exportFilePath);
344 QStringList checkInstallPrerequisites() const;
349 QStringList activeTasks() const;
353 void downloadStarted(QNetworkReply * reply);
355 void downloadFinished(QNetworkReply * reply);
357 void updateDownloadProgress(const QString& extensionName,
358 qint64 received, qint64 total);
362 void extensionUpdateAvailable(const QString& extensionName);
364 void extensionInstalled(const QString& extensionName);
366 void extensionUpdated(const QString& extensionName);
368 void extensionScheduledForUninstall(const QString& extensionName);
370 void extensionCancelledScheduleForUninstall(const QString& extensionName);
372 void extensionScheduledForUpdate(const QString& extensionName);
374 void extensionCancelledScheduleForUpdate(const QString& extensionName);
376 void extensionUninstalled(const QString& extensionName);
378 void extensionEnabledChanged(const QString& extensionName,
bool value);
380 void extensionIdentifedAsIncompatible(const QString& extensionName);
382 void newExtensionEnabledByDefaultChanged(
bool value);
384 void slicerRequirementsChanged(const QString& revision, const QString& os, const QString& arch);
385 void slicerArchChanged(const QString& slicerArch);
386 void slicerOsChanged(const QString& slicerOs);
387 void slicerRevisionChanged(const QString& slicerRevision);
389 void slicerVersionChanged(const QString& slicerVersion);
391 void messageLogged(const QString& text, ctkErrorLogLevel::LogLevels level) const;
393 void extensionHistoryGatheredOnStartup(const
QVariantMap&);
395 void installDownloadProgress(const QString& extensionName, qint64 received, qint64 total);
397 void extensionsSettingsFilePathChanged(const QString& extensionsSettingsFilePath);
399 void extensionsHistorySettingsFilePathChanged(const QString& extensionsHistorySettingsFilePath);
412 qint64 received, qint64 total);
414 void onUpdateCheckComplete(const QUuid& requestId,
416 void onUpdateCheckFailed(const QUuid& requestId);
419 QScopedPointer<qSlicerExtensionsManagerModelPrivate> d_ptr;
QObject Superclass
Superclass typedef.
qSlicerExtensionsManagerModelPrivate Pimpl
Pimpl typedef.