feat(ui): stream search results and show real download progress
Search now publishes provider results in small batches as they arrive, so the first matches appear in the table while slower providers keep running. The bottom status-bar bar is now a determinate indicator: pacman output is streamed live and its (n/Total) package counter is parsed into a percentage that fills the bar during install/update, instead of an indeterminate spinner. Generated with Codebuff 🤖 Co-Authored-By: Codebuff <noreply@codebuff.com>
This commit is contained in:
8 files changed
+246
-112
No files matched your search
@@ -38,6 +38,9 @@ public:
|
||||
void run() override;
|
||||
signals:
|
||||
void finished(std::vector<PackageInfo> results);
|
||||
// Emitted as search results are accumulated, so a few packages can be
|
||||
// shown immediately while the remaining searches keep running.
|
||||
void chunk(std::vector<PackageInfo> results);
|
||||
private:
|
||||
std::vector<IPackageManager*> m_providers;
|
||||
std::string m_query;
|
||||
@@ -70,6 +73,9 @@ public:
|
||||
void run() override;
|
||||
signals:
|
||||
void progress(const QString& message);
|
||||
// Real download percentage (0-100) when the provider reports it, used to
|
||||
// fill the determinate progress bar in the status bar.
|
||||
void progressValue(int percent);
|
||||
void finished(bool success);
|
||||
private:
|
||||
std::vector<IPackageManager*> m_providers;
|
||||
@@ -91,7 +97,9 @@ private slots:
|
||||
void onUpdateAll();
|
||||
void onRefresh();
|
||||
void onSearchFinished(std::vector<PackageInfo> results);
|
||||
void onSearchChunk(std::vector<PackageInfo> results);
|
||||
void onListFinished(std::vector<PackageInfo> results);
|
||||
void onInstallProgress(int percent);
|
||||
void onPackageSelected(int row);
|
||||
void onNavChanged(int id);
|
||||
void onClearHistory();
|
||||
@@ -143,6 +151,8 @@ private:
|
||||
void performInstall(const std::string& package);
|
||||
void performRemove(const std::string& package);
|
||||
void populatePackageTable(const std::vector<PackageInfo>& results);
|
||||
void appendPackageRows(const std::vector<PackageInfo>& results);
|
||||
void addPackageRow(int row, const PackageInfo& pkg);
|
||||
void setBusy(bool busy);
|
||||
void reloadCurrentView();
|
||||
void loadInstalled();
|
||||
@@ -184,6 +194,9 @@ private:
|
||||
QPushButton* m_updateButton = nullptr;
|
||||
QPushButton* m_updateAllButton = nullptr;
|
||||
QProgressBar* m_progressBar = nullptr;
|
||||
// Small indeterminate bar anchored in the status bar, shown at the bottom
|
||||
// of the window while any install/search runs.
|
||||
QProgressBar* m_installProgressBar = nullptr;
|
||||
QTableWidget* m_packageTable = nullptr;
|
||||
QLabel* m_packageName = nullptr;
|
||||
QLabel* m_packageVersion = nullptr;
|
||||
|
||||
Reference in new issue
Block a user