feat(plugins): replace the shop with drag-and-drop .fwspacm packages
The shop was a catalogue served over HTTP that the application fetched and listed, which put a network round trip between a user and a plugin that was almost always one file they already had. It also had to keep its catalogue URLs in step with every release, since an entry that pointed at a missing asset was indistinguishable from one that never worked. A plugin is now distributed as a .fwspacm package: a ZIP archive holding a plugin.json manifest and the shared library, which the user drops anywhere on the window. The file is the distribution, so there is no catalogue to publish, no network, and no catalogue URL setting to explain. The manifest tells the user what they are about to run, and its checksum is verified before anything is written, so a package whose library is not the one it declares never reaches the plugin directory. Qt exposes no public ZIP API, so the archive is read directly (central directory plus zlib for the deflated entries) rather than through a private header that could move between toolchains. The reader stays in the logic layer: app-core-test still links no QtWidgets, and a unit test builds its own archives to check both compression methods and every refusal path.
This commit is contained in:
29 files changed
+2105
-1046
No files matched your search
+19
-14
@@ -10,14 +10,15 @@ class QLabel;
|
||||
class QPushButton;
|
||||
class QTableWidget;
|
||||
|
||||
// Plugins: what is installed, and the shop it can be installed from.
|
||||
// Plugins: what is installed, and how to add more.
|
||||
//
|
||||
// The upper half lists every plugin known to the application (package-manager
|
||||
// providers and generic addons, built-in and external) and lets the user
|
||||
// enable/disable one, install the tool behind an unavailable provider and
|
||||
// rescan the plugin directories. The lower half is the shop: the catalogue the
|
||||
// core fetches (see PluginShop), with the entries that are not installed here
|
||||
// yet one click away from being downloaded into the per-user plugin directory.
|
||||
// rescan the plugin directories. The lower half is the drop zone: a .fwspacm
|
||||
// package dropped anywhere on the window is installed there (the window owns
|
||||
// the drop, see MainWindow::dropEvent), and what was installed from a package
|
||||
// can be removed again.
|
||||
class PluginsPage : public Page {
|
||||
Q_OBJECT
|
||||
public:
|
||||
@@ -33,11 +34,15 @@ public:
|
||||
private:
|
||||
void refreshTable();
|
||||
void onSelected(int row);
|
||||
// Shop half: the catalogue table, the source line above it and the
|
||||
// Installer/Désinstaller state of the selected entry.
|
||||
void refreshShopTable();
|
||||
void onShopSelected(int row);
|
||||
void updateShopHint();
|
||||
// Package half: the drop zone, and the list of what was installed from a
|
||||
// .fwspacm package with the button removing the selected one.
|
||||
void refreshPackageList();
|
||||
void onPackageSelected(int row);
|
||||
void updateDropHint();
|
||||
|
||||
// Opens a file dialog on the package format and installs what was picked,
|
||||
// for users who would rather click than drag the file onto the window.
|
||||
void browsePackage();
|
||||
|
||||
QTableWidget* m_table = nullptr;
|
||||
QLabel* m_description = nullptr;
|
||||
@@ -45,9 +50,9 @@ private:
|
||||
QPushButton* m_installButton = nullptr;
|
||||
std::string m_selectedId;
|
||||
|
||||
QLabel* m_shopHint = nullptr;
|
||||
QTableWidget* m_shopTable = nullptr;
|
||||
QPushButton* m_shopInstallButton = nullptr;
|
||||
QPushButton* m_shopRemoveButton = nullptr;
|
||||
QString m_shopSelectedId;
|
||||
QTableWidget* m_packageTable = nullptr;
|
||||
QLabel* m_packageHint = nullptr;
|
||||
QPushButton* m_browseButton = nullptr;
|
||||
QPushButton* m_removeButton = nullptr;
|
||||
QString m_selectedPackageId;
|
||||
};
|
||||
Reference in new issue
Block a user