feat(ui): rebuild interface from scratch with dashboard page
Redesign the whole UI around a dashboard with stat cards, quick actions and recent activity, a header bar with contextual page titles, and a denser table-based package listing with an instant local filter on the installed page and a filterable history table. Register the std::vector<PackageInfo> metatype so worker results actually reach the UI thread instead of being dropped silently.
This commit is contained in:
1 parent
bd3b3e48b3
commit
9043632ba9
5 files changed
+840
-452
No files matched your search
+17
-23
@@ -68,41 +68,35 @@ PacManager
|
||||
## Graphical interface
|
||||
|
||||
The interface uses **Qt6** with a dark theme, a **navigation sidebar** and stacked pages:
|
||||
- Sidebar: Search, Installed, Updates, History, Logs
|
||||
- Search bar with package list on the left and details on the right
|
||||
- Contextual action buttons (install, remove, update)
|
||||
- Dedicated page for available updates
|
||||
- Action history shown as a table
|
||||
- Built-in pacman logs
|
||||
- Progress bar and status bar
|
||||
- 🏠 **Dashboard**: statistics cards, quick actions and recent activity
|
||||
- 🔍 **Search**: search bar, package table on the left and details on the right
|
||||
- 📦 **Installed**: list with **instant name filter** (local, no pacman re-run)
|
||||
- ⬆️ **Updates**: outdated packages detected by `pacman -Qu`, "Update all" button
|
||||
- 📋 **History**: filterable table (installs / removals / updates)
|
||||
- 📜 **Logs**: built-in `/var/log/pacman.log` viewer
|
||||
|
||||
### Interface overview
|
||||
```text
|
||||
┌──────────────────────────────────────────────────────────────────────────────────────┐
|
||||
│ File Tools Help │
|
||||
├───────────────┬──────────────────────────────────────────────────────────────────────┤
|
||||
│ 📦 PacManager │ Search packages │
|
||||
│ │ ┌──────────────────────────────────────────────────┐ ┌────────────┐ │
|
||||
│ 🔍 Search │ │ [?] Search for a package... │ │ Search │ │
|
||||
│ 📦 PacManager │ Search │
|
||||
│ │ Find and install packages │
|
||||
│ 🏠 Dashboard │ ┌──────────────────────────────────────────────────┐ ┌────────────┐ │
|
||||
│ 🔍 Search │ │ 🔍 Search for a package (e.g. firefox)... │ │ Search │ │
|
||||
│ 📦 Installed │ └──────────────────────────────────────────────────┘ └────────────┘ │
|
||||
│ ⬆️ Updates │ [+ Install] [- Remove] [^ Update] [^^ Update all] │
|
||||
│ 📋 History │ ┌───────────────────────────────┐ ┌─────────────────────────────┐ │
|
||||
│ 📜 Logs │ │ firefox 128.0 │ │ firefox │ │
|
||||
│ │ │ [✅ Installed] │ │ Version: 128.0 │ │
|
||||
│ │ ├───────────────────────────────┤ │ Repo: extra Size: 289MB │ │
|
||||
│ │ │ chromium 127.0.6533 │ ├─────────────────────────────┤ │
|
||||
│ │ ├───────────────────────────────┤ │ Fast and secure web browser │ │
|
||||
│ │ │ vlc 3.0.21 │ │ based on the Gecko engine │ │
|
||||
│ │ │ [⬆️ Update avail.] │ │ from Mozilla. │ │
|
||||
│ │ └───────────────────────────────┘ └─────────────────────────────┘ │
|
||||
│ 🔄 Refresh │ │
|
||||
│ 📋 History │ ┌ Name │ Version │ Repo │ Status ┐ ┌────────────────────┐ │
|
||||
│ 📜 Logs │ │ firefox │ 128.0 │ extra │ ✅ Installed │ │ firefox │ │
|
||||
│ │ │ vlc │ 3.0.21 │ extra │ ✅ Installed │ │ Version: 128.0 │ │
|
||||
│ │ │ ... │ │ │ │ │ [extra] [289 MB] │ │
|
||||
│ │ └────────────────────────────────────────────┘ ├────────────────────┤ │
|
||||
│ 🔄 Refresh │ │ Fast and secure │ │
|
||||
├───────────────┴──────────────────────────────────────────────────────────────────────┤
|
||||
│ Manager: pacman | Packages found: 6 | History entries: 12 │
|
||||
│ pacman 1.0.0 | Packages shown: 6 | History entries: 12 │
|
||||
└──────────────────────────────────────────────────────────────────────────────────────┘
|
||||
```
|
||||
|
||||
The **Installed** and **Updates** pages reuse the same list: the Updates page lists outdated
|
||||
packages detected by `pacman -Qu` and enables the "Update all" button.
|
||||
## Package manager
|
||||
|
||||
The `IPackageManager` interface (implemented by `PacmanManager`) defines:
|
||||
|
||||
@@ -68,41 +68,35 @@ PacManager
|
||||
## Interface graphique
|
||||
|
||||
L'interface utilise **Qt6** avec un thème sombre, une **sidebar de navigation** et des pages empilées :
|
||||
- Sidebar : Recherche, Installés, Mises à jour, Historique, Logs
|
||||
- Barre de recherche avec liste des paquets à gauche et détails à droite
|
||||
- Boutons d'action contextuels (installer, supprimer, mettre à jour)
|
||||
- Page dédiée aux mises à jour disponibles
|
||||
- Historique des actions sous forme de tableau
|
||||
- Logs pacman intégrés
|
||||
- Barre de progression et barre d'état
|
||||
- 🏠 **Tableau de bord** : cartes de statistiques, actions rapides et activité récente
|
||||
- 🔍 **Recherche** : barre de recherche, tableau de paquets à gauche et détails à droite
|
||||
- 📦 **Installés** : liste avec **filtre instantané** par nom (local, sans relancer pacman)
|
||||
- ⬆️ **Mises à jour** : paquets obsolètes détectés par `pacman -Qu`, bouton « Tout mettre à jour »
|
||||
- 📋 **Historique** : tableau filtrable (installations / suppressions / mises à jour)
|
||||
- 📜 **Logs** : journal `/var/log/pacman.log` intégré
|
||||
|
||||
### Aperçu de l'interface
|
||||
```text
|
||||
┌──────────────────────────────────────────────────────────────────────────────────────┐
|
||||
│ Fichier Outils Aide │
|
||||
├───────────────┬──────────────────────────────────────────────────────────────────────┤
|
||||
│ 📦 PacManager │ Recherche de paquets │
|
||||
│ │ ┌──────────────────────────────────────────────────┐ ┌────────────┐ │
|
||||
│ 🔍 Recherche │ │ [?] Rechercher un paquet... │ │ Rechercher │ │
|
||||
│ 📦 PacManager │ Recherche │
|
||||
│ │ Trouvez et installez des paquets │
|
||||
│ 🏠 Tableau │ ┌──────────────────────────────────────────────────┐ ┌────────────┐ │
|
||||
│ 🔍 Recherche │ │ 🔍 Rechercher un paquet (ex : firefox)... │ │ Rechercher │ │
|
||||
│ 📦 Installés │ └──────────────────────────────────────────────────┘ └────────────┘ │
|
||||
│ ⬆️ Mises à j. │ [+ Installer] [- Supprimer] [^ Mettre à jour] [^^ Tout mettre à j.] │
|
||||
│ 📋 Historique │ ┌───────────────────────────────┐ ┌─────────────────────────────┐ │
|
||||
│ 📜 Logs │ │ firefox 128.0 │ │ firefox │ │
|
||||
│ │ │ [✅ Installé] │ │ Version: 128.0 │ │
|
||||
│ │ ├───────────────────────────────┤ │ Dépôt: extra Taille: 289MB │ │
|
||||
│ │ │ chromium 127.0.6533 │ ├─────────────────────────────┤ │
|
||||
│ │ ├───────────────────────────────┤ │ Navigateur web rapide et │ │
|
||||
│ │ │ vlc 3.0.21 │ │ sécurisé basé sur Gecko. │ │
|
||||
│ │ │ [⬆️ MAJ dispo] │ │ │ │
|
||||
│ │ └───────────────────────────────┘ └─────────────────────────────┘ │
|
||||
│ 🔄 Rafraîchir │ │
|
||||
│ 📋 Historique │ ┌ Nom │ Version │ Dépôt │ Statut ┐ ┌────────────────────┐ │
|
||||
│ 📜 Logs │ │ firefox │ 128.0 │ extra │ ✅ Installé │ │ firefox │ │
|
||||
│ │ │ vlc │ 3.0.21 │ extra │ ✅ Installé │ │ Version : 128.0 │ │
|
||||
│ │ │ ... │ │ │ │ │ [extra] [289 Mo] │ │
|
||||
│ │ └────────────────────────────────────────────┘ ├────────────────────┤ │
|
||||
│ 🔄 Rafraîchir │ │ Navigateur web... │ │
|
||||
├───────────────┴──────────────────────────────────────────────────────────────────────┤
|
||||
│ Plugin: pacman | Paquets trouvés: 6 | Éléments en historique: 12 │
|
||||
│ pacman 1.0.0 | Paquets affichés : 6 | Actions enregistrées : 12 │
|
||||
└──────────────────────────────────────────────────────────────────────────────────────┘
|
||||
```
|
||||
|
||||
Les pages **Installés** et **Mises à jour** réutilisent la même liste : la page Mises à jour
|
||||
liste les paquets obsolètes détectés par `pacman -Qu` et active le bouton « Tout mettre à jour ».
|
||||
## Gestionnaire de paquets
|
||||
|
||||
L'interface `IPackageManager` (implémentée par `PacmanManager`) définit :
|
||||
|
||||
+63
-31
@@ -2,26 +2,27 @@
|
||||
|
||||
#include <QMainWindow>
|
||||
#include <QLineEdit>
|
||||
#include <QListWidget>
|
||||
#include <QPushButton>
|
||||
#include <QLabel>
|
||||
#include <QVBoxLayout>
|
||||
#include <QHBoxLayout>
|
||||
#include <QProgressBar>
|
||||
#include <QStatusBar>
|
||||
#include <QMenuBar>
|
||||
#include <QMenu>
|
||||
#include <QAction>
|
||||
#include <QComboBox>
|
||||
#include <QThread>
|
||||
|
||||
#include <string>
|
||||
#include <vector>
|
||||
|
||||
#include "package-manager.h"
|
||||
#include "pacman-manager.h"
|
||||
#include "history-manager.h"
|
||||
|
||||
class QStackedWidget;
|
||||
class QButtonGroup;
|
||||
class QTableWidget;
|
||||
class QTextEdit;
|
||||
class QListWidget;
|
||||
class QButtonGroup;
|
||||
class QFrame;
|
||||
|
||||
// Runs a package search off the UI thread.
|
||||
class SearchWorker : public QThread {
|
||||
@@ -85,62 +86,93 @@ private slots:
|
||||
void onNavChanged(int id);
|
||||
void onClearHistory();
|
||||
void onRefreshLogs();
|
||||
void onHistoryFilterChanged();
|
||||
void onInstalledFilterChanged(const QString& text);
|
||||
|
||||
private:
|
||||
enum BrowseMode { ModeSearch, ModeInstalled, ModeUpdates };
|
||||
|
||||
void setupUI();
|
||||
void setupSidebar();
|
||||
void setupHeader();
|
||||
void setupDashboardPage();
|
||||
void setupBrowsePage();
|
||||
void setupHistoryPage();
|
||||
void setupLogsPage();
|
||||
void setupMenuBar();
|
||||
void updatePackageInfo(const PackageInfo& pkg);
|
||||
void updatePageTitle();
|
||||
void updateStatusBar();
|
||||
void refreshDashboard();
|
||||
void refreshRecentActivity();
|
||||
void updatePackageInfo(const PackageInfo& pkg);
|
||||
void resetDetailsPanel();
|
||||
void setBrowseMode(BrowseMode mode);
|
||||
void performInstall(const std::string& package);
|
||||
void performRemove(const std::string& package);
|
||||
void populatePackageList(const std::vector<PackageInfo>& results);
|
||||
QListWidgetItem* makePackageRow(const PackageInfo& pkg);
|
||||
void populatePackageTable(const std::vector<PackageInfo>& results);
|
||||
void setBusy(bool busy);
|
||||
void reloadCurrentView();
|
||||
void loadInstalled();
|
||||
void loadUpdates();
|
||||
void refreshHistoryTable();
|
||||
void loadLogs();
|
||||
QFrame* makeCard();
|
||||
QFrame* makeStatCard(const QString& icon, const QString& title, QLabel** valueOut);
|
||||
|
||||
// Sidebar
|
||||
QButtonGroup* m_navGroup;
|
||||
QStackedWidget* m_pages;
|
||||
QPushButton* m_refreshButton;
|
||||
QFrame* m_sidebar = nullptr;
|
||||
QButtonGroup* m_navGroup = nullptr;
|
||||
QPushButton* m_refreshButton = nullptr;
|
||||
|
||||
// Header
|
||||
QWidget* m_headerWidget = nullptr;
|
||||
QLabel* m_headerTitle = nullptr;
|
||||
QLabel* m_headerSubtitle = nullptr;
|
||||
|
||||
// Pages
|
||||
QStackedWidget* m_pages = nullptr;
|
||||
|
||||
// Dashboard
|
||||
QLabel* m_statInstalled = nullptr;
|
||||
QLabel* m_statUpdates = nullptr;
|
||||
QLabel* m_statHistory = nullptr;
|
||||
QLabel* m_statManager = nullptr;
|
||||
QListWidget* m_recentList = nullptr;
|
||||
|
||||
// Browse page
|
||||
QWidget* m_searchRowWidget;
|
||||
QLabel* m_browseTitle;
|
||||
QLineEdit* m_searchBar;
|
||||
QPushButton* m_searchButton;
|
||||
QPushButton* m_installButton;
|
||||
QPushButton* m_removeButton;
|
||||
QPushButton* m_updateButton;
|
||||
QPushButton* m_updateAllButton;
|
||||
QProgressBar* m_progressBar;
|
||||
QListWidget* m_packageList;
|
||||
QLabel* m_packageName;
|
||||
QLabel* m_packageVersion;
|
||||
QLabel* m_packageRepo;
|
||||
QLabel* m_packageSize;
|
||||
QLabel* m_packageDescription;
|
||||
QWidget* m_searchRowWidget = nullptr;
|
||||
QLineEdit* m_searchBar = nullptr;
|
||||
QPushButton* m_searchButton = nullptr;
|
||||
QWidget* m_filterRowWidget = nullptr;
|
||||
QLineEdit* m_filterBar = nullptr;
|
||||
QLabel* m_resultCount = nullptr;
|
||||
QPushButton* m_installButton = nullptr;
|
||||
QPushButton* m_removeButton = nullptr;
|
||||
QPushButton* m_updateButton = nullptr;
|
||||
QPushButton* m_updateAllButton = nullptr;
|
||||
QProgressBar* m_progressBar = nullptr;
|
||||
QTableWidget* m_packageTable = nullptr;
|
||||
QLabel* m_packageName = nullptr;
|
||||
QLabel* m_packageVersion = nullptr;
|
||||
QLabel* m_packageRepo = nullptr;
|
||||
QLabel* m_packageSize = nullptr;
|
||||
QLabel* m_packageUpdateBadge = nullptr;
|
||||
QLabel* m_packageDescription = nullptr;
|
||||
|
||||
// History page
|
||||
QTableWidget* m_historyTable;
|
||||
QTableWidget* m_historyTable = nullptr;
|
||||
QComboBox* m_historyFilter = nullptr;
|
||||
QLabel* m_historyCount = nullptr;
|
||||
|
||||
// Logs page
|
||||
QTextEdit* m_logsText;
|
||||
QTextEdit* m_logsText = nullptr;
|
||||
|
||||
// Backend
|
||||
PacmanManager* m_pacman;
|
||||
HistoryManager* m_historyManager;
|
||||
PacmanManager* m_pacman = nullptr;
|
||||
HistoryManager* m_historyManager = nullptr;
|
||||
BrowseMode m_browseMode = ModeSearch;
|
||||
|
||||
std::vector<PackageInfo> m_currentResults;
|
||||
std::vector<PackageInfo> m_installedPackages;
|
||||
PackageInfo m_selectedPackage;
|
||||
};
|
||||
+741
-373
File diff suppressed because it is too large.
Load diff
+2
-2
@@ -9,8 +9,8 @@ int main(int argc, char* argv[]) {
|
||||
|
||||
MainWindow window;
|
||||
window.setWindowTitle("PacManager - Gestionnaire de Paquets");
|
||||
window.resize(1100, 720);
|
||||
window.setMinimumSize(880, 560);
|
||||
window.resize(1200, 760);
|
||||
window.setMinimumSize(960, 600);
|
||||
window.show();
|
||||
|
||||
return app.exec();
|
||||
|
||||
Reference in new issue
Block a user