feat(plugins): add a plugin shop fed by a JSON catalogue
Installing a plugin meant compiling a shared library and dropping it in a directory by hand. The shop reads a catalogue (plugins/catalog.json, one entry per plugin with its description and download URL), lists what can be installed next to what already is, and installs an entry into ~/.local/share/PacManager/plugins — the directory the registry already scans — so a plugin becomes usable without root rights and without a restart. Installing runs third-party code in this process, so the shop only fetches what the user picked, checks the announced sha256 before writing anything, and a removal deletes only the files the shop wrote itself. 🤖 Generated with Codebuff Co-Authored-By: Codebuff <noreply@codebuff.com>
This commit is contained in:
1 parent
b26e907221
commit
5033c4e940
9 files changed
+872
-6
No files matched your search
+19
-4
@@ -10,10 +10,14 @@ class QLabel;
|
||||
class QPushButton;
|
||||
class QTableWidget;
|
||||
|
||||
// Plugins: the add-on store. Lists every plugin known to the application
|
||||
// (package-manager providers and generic addons, built-in and external), lets
|
||||
// the user enable/disable one, install the tool behind an unavailable provider
|
||||
// and rescan the plugin directories.
|
||||
// Plugins: what is installed, and the shop it can be installed from.
|
||||
//
|
||||
// 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.
|
||||
class PluginsPage : public Page {
|
||||
Q_OBJECT
|
||||
public:
|
||||
@@ -29,10 +33,21 @@ 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();
|
||||
|
||||
QTableWidget* m_table = nullptr;
|
||||
QLabel* m_description = nullptr;
|
||||
QPushButton* m_toggleButton = nullptr;
|
||||
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;
|
||||
};
|
||||
Reference in new issue
Block a user