pages/ was a flat row of eight screens, so a change to one meant scanning the whole folder to see what else was in it. The screens now sit in packages/ (browse, cleanup), overview/ (dashboard, history), system/ (logs, settings) and extensions/ (plugins), with the scaffolding they all build on — the Page base and the shared widgets — in base/.
59 lines
1.9 KiB
C++
59 lines
1.9 KiB
C++
#pragma once
|
|
|
|
#include <QString>
|
|
|
|
#include <string>
|
|
|
|
#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;
|
|
};
|