mirror of
https://gitee.com/spark-store-project/spark-store
synced 2025-12-15 05:12:04 +08:00
完善下载页面按钮的功能
This commit is contained in:
@@ -26,8 +26,7 @@ class SpkDownloadEntry : public QWidget
|
||||
Invalid = -1,
|
||||
Waiting,
|
||||
Downloading,
|
||||
Paused,
|
||||
Failed,
|
||||
DownloadFailed,
|
||||
ToBeInstalled,
|
||||
Installing,
|
||||
Installed,
|
||||
@@ -35,9 +34,23 @@ class SpkDownloadEntry : public QWidget
|
||||
};
|
||||
|
||||
void SetTotalBytes(qint64 total);
|
||||
void SetBasicInfo(QString name, QPixmap icon);
|
||||
void SetBasicInfo(QString name, QPixmap icon, QString filePath);
|
||||
void SetStatus(DownloadEntryStatus status, QString msg = "");
|
||||
void Progress(qint64 bytes);
|
||||
QString GetTaskName() { return mAppName->text(); }
|
||||
QString GetFilePath() { return mFilePath; }
|
||||
|
||||
enum EntryAction
|
||||
{
|
||||
AbortDownload,
|
||||
RetryDownload,
|
||||
StartInstall,
|
||||
RemoveEntry
|
||||
};
|
||||
|
||||
private slots:
|
||||
void ActionButton();
|
||||
void DeleteButton();
|
||||
|
||||
private:
|
||||
QLabel *mIcon, *mMessage;
|
||||
@@ -54,4 +67,11 @@ class SpkDownloadEntry : public QWidget
|
||||
qint64 mTotalBytes, mDownloadedBytes;
|
||||
QTime mLastReportTime;
|
||||
QString mReadableTotalSize;
|
||||
|
||||
QString mFilePath;
|
||||
|
||||
DownloadEntryStatus mStatus;
|
||||
|
||||
signals:
|
||||
void Action(EntryAction);
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user