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(QStringList installedExtensions READ installedExtensions NOTIFY modelUpdated)
48 Q_PROPERTY(QStringList enabledExtensions READ enabledExtensions NOTIFY modelUpdated)
49 Q_PROPERTY(
bool newExtensionEnabledByDefault READ newExtensionEnabledByDefault WRITE setNewExtensionEnabledByDefault NOTIFY newExtensionEnabledByDefaultChanged)
50 Q_PROPERTY(QString extensionsSettingsFilePath READ extensionsSettingsFilePath WRITE setExtensionsSettingsFilePath NOTIFY extensionsSettingsFilePathChanged)
51 Q_PROPERTY(QString extensionsHistorySettingsFilePath READ extensionsHistorySettingsFilePath WRITE setExtensionsHistorySettingsFilePath NOTIFY extensionsHistorySettingsFilePathChanged)
52 Q_PROPERTY(QString slicerRevision READ slicerRevision WRITE setSlicerRevision NOTIFY slicerRevisionChanged)
53 Q_PROPERTY(QString slicerOs READ slicerOs WRITE setSlicerOs NOTIFY slicerOsChanged)
54 Q_PROPERTY(QString slicerArch READ slicerArch WRITE setSlicerArch NOTIFY slicerArchChanged)
55 Q_PROPERTY(QString slicerVersion READ slicerVersion WRITE setSlicerVersion NOTIFY slicerVersionChanged)
61 typedef qSlicerExtensionsManagerModelPrivate
Pimpl;
75 Q_INVOKABLE QUrl serverUrl()const;
76 Q_INVOKABLE QUrl serverUrlWithPackagePath()const;
77 Q_INVOKABLE QUrl serverUrlWithExtensionsStorePath()const;
79 Q_INVOKABLE QString extensionsInstallPath()const;
81 Q_INVOKABLE QString extensionInstallPath(const QString& extensionName) const;
83 Q_INVOKABLE QStringList extensionModulePaths(const QString& extensionName)const;
85 Q_INVOKABLE QString extensionDescriptionFile(const QString& extensionName) const;
87 void setNewExtensionEnabledByDefault(
bool value);
88 bool newExtensionEnabledByDefault()const;
94 Q_INVOKABLE
bool isExtensionInstalled(const QString& extensionName)const;
98 int numberOfInstalledExtensions()const;
102 QStringList installedExtensions()const;
106 Q_INVOKABLE
bool isExtensionEnabled(const QString& extensionName)const;
112 QStringList scheduledForUpdateExtensions() const;
120 Q_INVOKABLE
bool isExtensionUpdateAvailable(const QString& extensionName)const;
127 Q_INVOKABLE
bool isExtensionScheduledForUpdate(const QString& extensionName)const;
131 QStringList scheduledForUninstallExtensions() const;
135 Q_INVOKABLE
bool isExtensionScheduledForUninstall(const QString& extensionName)const;
139 QStringList enabledExtensions()const;
144 QString extensionsSettingsFilePath()const;
145 void setExtensionsSettingsFilePath(const QString& extensionsSettingsFilePath);
150 QString extensionsHistorySettingsFilePath()const;
151 void setExtensionsHistorySettingsFilePath(const QString& extensionsHistorySettingsFilePath);
158 QString slicerRevision()const;
159 void setSlicerRevision(const QString& revision);
164 QString slicerOs()const;
165 void setSlicerOs(const QString& os);
170 QString slicerArch()const;
171 void setSlicerArch(const QString& arch);
180 void setSlicerRequirements(const QString& revision, const QString& os, const QString& arch);
182 QString slicerVersion()const;
183 void setSlicerVersion(const QString& version);
189 Q_INVOKABLE QStringList isExtensionCompatible(const QString& extensionName, const QString& slicerRevision,
190 const QString& slicerOs, const QString& slicerArch) const;
198 Q_INVOKABLE QStringList isExtensionCompatible(const QString& extensionName) const;
215 Q_INVOKABLE
bool installExtension(const QString &archiveFile);
224 Q_INVOKABLE
bool installExtension(const QString& extensionName,
226 const QString &archiveFile);
229 Q_INVOKABLE
bool extractExtensionArchive(const QString& extensionName,
230 const QString& archiveFile,
231 const QString &destinationPath);
234 Q_INVOKABLE const QStandardItemModel * model()const;
236 static QHash<QString, QString> serverToExtensionDescriptionKey();
238 static QStringList serverKeysToIgnore();
242 static QStringList readArrayValues(QSettings& settings,
243 const QString& arrayName, const QString fieldName);
245 static
void writeArrayValues(QSettings& settings, const QStringList& values,
246 const QString& arrayName, const QString fieldName);
248 static
bool writeExtensionDescriptionFile(const QString& file,
258 void setExtensionEnabled(const QString& extensionName,
bool value);
263 bool downloadAndInstallExtension(const QString& extensionId);
270 bool scheduleExtensionForUninstall(const QString& extensionName);
275 bool cancelExtensionScheduledForUninstall(const QString& extensionName);
282 void checkForUpdates(
bool installUpdates);
290 bool scheduleExtensionForUpdate(const QString& extensionName);
295 bool cancelExtensionScheduledForUpdate(const QString& extensionName);
305 bool updateScheduledExtensions(QStringList &updatedExtensions);
312 bool updateScheduledExtensions();
322 bool uninstallScheduledExtensions(QStringList &uninstalledExtensions);
329 bool uninstallScheduledExtensions();
331 void gatherExtensionsHistoryInformationOnStartup();
335 void identifyIncompatibleExtensions();
337 bool exportExtensionList(QString& exportFilePath);
339 QStringList checkInstallPrerequisites() const;
345 void downloadStarted(QNetworkReply * reply);
347 void downloadFinished(QNetworkReply * reply);
349 void updateDownloadProgress(const QString& extensionName,
350 qint64 received, qint64 total);
354 void extensionUpdateAvailable(const QString& extensionName);
356 void extensionInstalled(const QString& extensionName);
358 void extensionUpdated(const QString& extensionName);
360 void extensionScheduledForUninstall(const QString& extensionName);
362 void extensionCancelledScheduleForUninstall(const QString& extensionName);
364 void extensionScheduledForUpdate(const QString& extensionName);
366 void extensionCancelledScheduleForUpdate(const QString& extensionName);
368 void extensionUninstalled(const QString& extensionName);
370 void extensionEnabledChanged(const QString& extensionName,
bool value);
372 void extensionIdentifedAsIncompatible(const QString& extensionName);
374 void newExtensionEnabledByDefaultChanged(
bool value);
376 void slicerRequirementsChanged(const QString& revision, const QString& os, const QString& arch);
377 void slicerArchChanged(const QString& slicerArch);
378 void slicerOsChanged(const QString& slicerOs);
379 void slicerRevisionChanged(const QString& slicerRevision);
381 void slicerVersionChanged(const QString& slicerVersion);
383 void messageLogged(const QString& text, ctkErrorLogLevel::LogLevels level) const;
385 void extensionHistoryGatheredOnStartup(const
QVariantMap&);
387 void installDownloadProgress(const QString& extensionName, qint64 received, qint64 total);
389 void extensionsSettingsFilePathChanged(const QString& extensionsSettingsFilePath);
391 void extensionsHistorySettingsFilePathChanged(const QString& extensionsHistorySettingsFilePath);
404 qint64 received, qint64 total);
406 void onUpdateCheckComplete(const QUuid& requestId,
408 void onUpdateCheckFailed(const QUuid& requestId);
411 QScopedPointer<qSlicerExtensionsManagerModelPrivate> d_ptr;
QObject Superclass
Superclass typedef.
qSlicerExtensionsManagerModelPrivate Pimpl
Pimpl typedef.