Loading...
Searching...
No Matches
score-plugin-packagemanager/PackageManager/Model.hpp
1#pragma once
2#include <score/plugins/settingsdelegate/SettingsDelegateModel.hpp>
3
4#include <QDir>
5#include <QItemSelectionModel>
6#include <QNetworkAccessManager>
7
8#include <PackageManager/PluginItemModel.hpp>
9
10#include <score_plugin_packagemanager_export.h>
11
12#include <functional>
13
14namespace PM
15{
16class BlacklistCommand;
17
18class SCORE_PLUGIN_PACKAGEMANAGER_EXPORT PluginSettingsModel
20{
21 W_OBJECT(PluginSettingsModel)
22
23public:
25 const UuidKey<score::SettingsDelegateFactory>& k, QSettings& set,
26 const score::ApplicationContext& ctx);
28
29 void refresh();
30 void requestInformation(QUrl url);
31
32 void installAddon(const Package& addon);
33 void installLibrary(const Package& addon);
34 void installSDK();
35
36 void handleAddonList(const QJsonObject&);
37 void handleAddon(const QJsonObject&);
38 void on_message(QNetworkReply* rep);
39 void firstTimeLibraryDownload();
41 void downloadDefaultLibrary();
42 void checkAll();
43
44 void show_progress() W_SIGNAL(show_progress);
45 void update_progress(double v) W_SIGNAL(update_progress, v);
46 void reset_progress() W_SIGNAL(reset_progress);
47 void set_info() W_SIGNAL(set_info);
48 void progress_from_bytes(qint64 received, qint64 total)
49 W_SIGNAL(progress_from_bytes, received, total);
50 void information(QString title, QString description)
51 E_SIGNAL(SCORE_PLUGIN_PACKAGEMANAGER_EXPORT, information, title, description);
52 void warning(QString title, QString description)
53 E_SIGNAL(SCORE_PLUGIN_PACKAGEMANAGER_EXPORT, warning, title, description);
54
55 void downloadPackage(
56 const Package& addon, const QString& installPath,
57 std::function<void(const QString& destination)> installed);
58 void on_packageInstallSuccess(const Package& addon, const QString& destination);
59 void on_packageInstallFailure(const Package& addon, const QString& error);
60
61 LocalPackagesModel localPlugins;
62 RemotePackagesModel remotePlugins;
63 QItemSelectionModel remoteSelection;
64
65 QNetworkAccessManager mgr;
66 int m_addonsToRetrieve = 0;
67 bool m_firstTimeCheck{false};
68};
69}
Definition score-plugin-packagemanager/PackageManager/Model.hpp:20
Definition PluginItemModel.hpp:98
Definition UuidKey.hpp:345
Definition SettingsDelegateModel.hpp:18
Definition PluginItemModel.hpp:91
Definition PluginItemModel.hpp:25
Used to access all the application-wide state and structures.
Definition ApplicationContext.hpp:25