All the business logic now lives in AppCore (providers, workers, history, plugins, sudo and pacman-lock handling), freed from any widget so it runs headless and is testable on its own. The Qt window becomes a thin frame around one file per screen under pages/, wired through a common Page contract and a shared ui-kit. CMake gains the app-core-test target, which links Qt Core only to enforce the headless guarantee. 🤖 Generated with Codebuff Co-Authored-By: Codebuff <noreply@codebuff.com>
37 lines
999 B
C++
37 lines
999 B
C++
#pragma once
|
|
|
|
#include "page.h"
|
|
|
|
class QLabel;
|
|
class QListWidget;
|
|
class QListWidgetItem;
|
|
|
|
// Tableau de bord: the four figures of the system, the shortcuts to the pages
|
|
// used most often, and the last recorded actions.
|
|
class DashboardPage : public Page {
|
|
Q_OBJECT
|
|
public:
|
|
explicit DashboardPage(AppCore* core, QWidget* parent = nullptr);
|
|
|
|
QString navTitle() const override { return QStringLiteral("Tableau de bord"); }
|
|
QString navSubtitle() const override {
|
|
return QStringLiteral("Vue d'ensemble de votre système");
|
|
}
|
|
|
|
void refresh() override;
|
|
|
|
signals:
|
|
// A click on a recent action opens that package on the Installed screen.
|
|
void openPackage(const QString& name);
|
|
|
|
private:
|
|
void refreshRecentActivity();
|
|
void onActivityClicked(QListWidgetItem* item);
|
|
|
|
QLabel* m_statInstalled = nullptr;
|
|
QLabel* m_statUpdates = nullptr;
|
|
QLabel* m_statHistory = nullptr;
|
|
QLabel* m_statManager = nullptr;
|
|
QListWidget* m_recentList = nullptr;
|
|
};
|