#pragma once #include #include #include "page.h" class QLabel; class QPushButton; class QTableWidget; // 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 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: 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); // 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; QPushButton* m_toggleButton = nullptr; QPushButton* m_installButton = nullptr; std::string m_selectedId; QTableWidget* m_packageTable = nullptr; QLabel* m_packageHint = nullptr; QPushButton* m_browseButton = nullptr; QPushButton* m_removeButton = nullptr; QString m_selectedPackageId; };