#pragma once #include #include #include "page.h" class QLabel; class QPushButton; class QTableWidget; // 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: explicit PluginsPage(AppCore* core, QWidget* parent = nullptr); QString navTitle() const override { return QStringLiteral("Plugins"); } QString navSubtitle() const override { return QStringLiteral("Gestionnaires de paquets et extensions"); } void refresh() override; 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; };