Merge branch 'feat/fwspacm-plugin-packages' into release-1.6.0
This commit is contained in:
29 files changed
+2107
-1047
No files matched your search
+22
-24
@@ -14,7 +14,7 @@
|
||||
|
||||
#include "app-logging.h"
|
||||
#include "log-manager.h"
|
||||
#include "plugin-shop.h"
|
||||
#include "plugin-package.h"
|
||||
#include "workers.h"
|
||||
|
||||
namespace {
|
||||
@@ -111,20 +111,20 @@ AppCore::AppCore(QObject* parent) : QObject(parent) {
|
||||
// Non-owning handle kept for sudo credentials and the database lock.
|
||||
m_pacman = dynamic_cast<PacmanManager*>(m_plugins->managerFor("pacman"));
|
||||
|
||||
// Plugin shop: the catalogue, the downloads and the bookkeeping of what it
|
||||
// installed. What it fetches lands in the directory the registry scans, so
|
||||
// a successful install only needs that registry reloaded.
|
||||
m_shop = new PluginShop(this);
|
||||
connect(m_shop, &PluginShop::catalogChanged, this, &AppCore::pluginCatalogChanged);
|
||||
connect(m_shop, &PluginShop::installFinished, this,
|
||||
// Plugin packages: a .fwspacm archive dropped on the window, and the
|
||||
// bookkeeping of what was installed from one. What a package carries lands
|
||||
// in the directory the registry scans, so a successful install only needs
|
||||
// that registry reloaded.
|
||||
m_packages = new PluginPackage(this);
|
||||
connect(m_packages, &PluginPackage::installFinished, this,
|
||||
[this](const QString& id, bool success, const QString& message) {
|
||||
if (success) reloadPlugins();
|
||||
emit shopInstallFinished(id, success, message);
|
||||
emit pluginPackageInstalled(id, success, message);
|
||||
});
|
||||
connect(m_shop, &PluginShop::removeFinished, this,
|
||||
connect(m_packages, &PluginPackage::removeFinished, this,
|
||||
[this](const QString& id, bool success, const QString& message) {
|
||||
if (success) reloadPlugins();
|
||||
emit shopInstallFinished(id, success, message);
|
||||
emit pluginPackageRemoved(id, success, message);
|
||||
});
|
||||
|
||||
m_history = new HistoryManager();
|
||||
@@ -524,6 +524,10 @@ bool AppCore::canInstallFile(const QString& path) const {
|
||||
return false;
|
||||
}
|
||||
|
||||
bool AppCore::isPluginPackage(const QString& path) const {
|
||||
return PluginPackage::isPackagePath(path);
|
||||
}
|
||||
|
||||
AppCore::StartResult AppCore::removePackages(const std::vector<PackageInfo>& packages,
|
||||
const QString& description) { Request request;
|
||||
request.action = QStringLiteral("cleanup");
|
||||
@@ -1084,26 +1088,20 @@ void AppCore::reloadPlugins() {
|
||||
emit statusMessage(QStringLiteral("Plugins rechargés."));
|
||||
}
|
||||
|
||||
void AppCore::loadPluginCatalog() {
|
||||
LogManager::instance().logEvent(QStringLiteral("plugin"),
|
||||
QStringLiteral("chargement du catalogue"));
|
||||
emit statusMessage(QStringLiteral("Chargement du catalogue de plugins..."));
|
||||
m_shop->refresh();
|
||||
}
|
||||
|
||||
void AppCore::installShopPlugin(const QString& id) {
|
||||
void AppCore::installPluginPackage(const QString& path) {
|
||||
LogManager::instance().logEvent(
|
||||
QStringLiteral("plugin"),
|
||||
QStringLiteral("installation depuis la boutique : %1").arg(id));
|
||||
emit statusMessage(QStringLiteral("Téléchargement du plugin %1...").arg(id));
|
||||
m_shop->install(id);
|
||||
QStringLiteral("installation du paquet : %1").arg(QFileInfo(path).fileName()));
|
||||
emit statusMessage(
|
||||
QStringLiteral("Installation du paquet %1...").arg(QFileInfo(path).fileName()));
|
||||
m_packages->install(path);
|
||||
}
|
||||
|
||||
void AppCore::removeShopPlugin(const QString& id) {
|
||||
void AppCore::removePluginPackage(const QString& id) {
|
||||
LogManager::instance().logEvent(
|
||||
QStringLiteral("plugin"),
|
||||
QStringLiteral("suppression depuis la boutique : %1").arg(id));
|
||||
m_shop->remove(id);
|
||||
QStringLiteral("suppression du paquet : %1").arg(id));
|
||||
m_packages->remove(id);
|
||||
}
|
||||
|
||||
void AppCore::clearHistory() {
|
||||
|
||||
Reference in new issue
Block a user