mirror of
https://github.com/vcmi/vcmi.git
synced 2025-08-13 19:54:17 +02:00
Actually show extraction progress during mod installation
This commit is contained in:
@@ -591,7 +591,7 @@ void CModListView::downloadFile(QString file, QString url, QString description,
|
|||||||
this, SLOT(downloadFinished(QStringList,QStringList,QStringList)));
|
this, SLOT(downloadFinished(QStringList,QStringList,QStringList)));
|
||||||
|
|
||||||
connect(manager.get(), SIGNAL(extractionProgress(qint64,qint64)),
|
connect(manager.get(), SIGNAL(extractionProgress(qint64,qint64)),
|
||||||
this, SLOT(downloadProgress(qint64,qint64)));
|
this, SLOT(extractionProgress(qint64,qint64)));
|
||||||
|
|
||||||
connect(modModel, &CModListModel::dataChanged, filterModel, &QAbstractItemModel::dataChanged);
|
connect(modModel, &CModListModel::dataChanged, filterModel, &QAbstractItemModel::dataChanged);
|
||||||
|
|
||||||
@@ -613,6 +613,14 @@ void CModListView::downloadProgress(qint64 current, qint64 max)
|
|||||||
ui->progressBar->setValue(current / (1024 * 1024));
|
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)
|
void CModListView::downloadFinished(QStringList savedFiles, QStringList failedFiles, QStringList errors)
|
||||||
{
|
{
|
||||||
QString title = tr("Download failed");
|
QString title = tr("Download failed");
|
||||||
|
@@ -98,6 +98,7 @@ private slots:
|
|||||||
void dataChanged(const QModelIndex & topleft, const QModelIndex & bottomRight);
|
void dataChanged(const QModelIndex & topleft, const QModelIndex & bottomRight);
|
||||||
void modSelected(const QModelIndex & current, const QModelIndex & previous);
|
void modSelected(const QModelIndex & current, const QModelIndex & previous);
|
||||||
void downloadProgress(qint64 current, qint64 max);
|
void downloadProgress(qint64 current, qint64 max);
|
||||||
|
void extractionProgress(qint64 current, qint64 max);
|
||||||
void downloadFinished(QStringList savedFiles, QStringList failedFiles, QStringList errors);
|
void downloadFinished(QStringList savedFiles, QStringList failedFiles, QStringList errors);
|
||||||
void modelReset();
|
void modelReset();
|
||||||
void hideProgressBar();
|
void hideProgressBar();
|
||||||
|
Reference in New Issue
Block a user