From 1a4bcfadbceba3c6bc6e0c5b7354e7756f9794fb Mon Sep 17 00:00:00 2001 From: Ivan Savenko Date: Mon, 18 Dec 2023 00:34:00 +0200 Subject: [PATCH] Actually show extraction progress during mod installation --- launcher/modManager/cmodlistview_moc.cpp | 10 +++++++++- launcher/modManager/cmodlistview_moc.h | 1 + 2 files changed, 10 insertions(+), 1 deletion(-) diff --git a/launcher/modManager/cmodlistview_moc.cpp b/launcher/modManager/cmodlistview_moc.cpp index 9bfffda43..97913cc40 100644 --- a/launcher/modManager/cmodlistview_moc.cpp +++ b/launcher/modManager/cmodlistview_moc.cpp @@ -591,7 +591,7 @@ void CModListView::downloadFile(QString file, QString url, QString description, this, SLOT(downloadFinished(QStringList,QStringList,QStringList))); connect(manager.get(), SIGNAL(extractionProgress(qint64,qint64)), - this, SLOT(downloadProgress(qint64,qint64))); + this, SLOT(extractionProgress(qint64,qint64))); connect(modModel, &CModListModel::dataChanged, filterModel, &QAbstractItemModel::dataChanged); @@ -613,6 +613,14 @@ void CModListView::downloadProgress(qint64 current, qint64 max) ui->progressBar->setValue(current / (1024 * 1024)); } +void CModListView::extractionProgress(qint64 current, qint64 max) +{ + // display progress, in extracted files + ui->progressBar->setVisible(true); + ui->progressBar->setMaximum(max); + ui->progressBar->setValue(current); +} + void CModListView::downloadFinished(QStringList savedFiles, QStringList failedFiles, QStringList errors) { QString title = tr("Download failed"); diff --git a/launcher/modManager/cmodlistview_moc.h b/launcher/modManager/cmodlistview_moc.h index cadfb0a51..bf6d07f55 100644 --- a/launcher/modManager/cmodlistview_moc.h +++ b/launcher/modManager/cmodlistview_moc.h @@ -98,6 +98,7 @@ private slots: void dataChanged(const QModelIndex & topleft, const QModelIndex & bottomRight); void modSelected(const QModelIndex & current, const QModelIndex & previous); void downloadProgress(qint64 current, qint64 max); + void extractionProgress(qint64 current, qint64 max); void downloadFinished(QStringList savedFiles, QStringList failedFiles, QStringList errors); void modelReset(); void hideProgressBar();