chore:完成ssinstall更新

This commit is contained in:
2025-06-17 22:21:53 +08:00
parent 8177556e5d
commit a9d9f035de
2 changed files with 126 additions and 17 deletions

View File

@@ -2,11 +2,16 @@
#include <QStyledItemDelegate>
#include <QHash>
#include <QQueue>
#include <QProcess>
#include <QElapsedTimer>
#include "downloadmanager.h"
struct DownloadInfo {
int progress = 0;
bool isDownloading = false;
bool isInstalled = false;
bool isInstalling = false; // 新增:标记是否正在安装
};
class AppDelegate : public QStyledItemDelegate {
@@ -20,7 +25,7 @@ public:
QSize sizeHint(const QStyleOptionViewItem &option, const QModelIndex &index) const override;
bool editorEvent(QEvent *event, QAbstractItemModel *model,
const QStyleOptionViewItem &option, const QModelIndex &index) override;
void startDownloadForAll(); // 新增:批量下载所有应用
void startDownloadForAll();
signals:
void updateDisplay(const QString &packageName);
@@ -29,4 +34,13 @@ private:
DownloadManager *m_downloadManager;
QHash<QString, DownloadInfo> m_downloads;
QAbstractItemModel *m_model = nullptr;
QQueue<QString> m_installQueue;
bool m_isInstalling = false;
QProcess *m_installProcess = nullptr;
QString m_installingPackage; // 当前正在安装的包名
QElapsedTimer m_spinnerTimer; // 用于转圈动画
void enqueueInstall(const QString &packageName);
void startNextInstall();
};