mirror of
https://github.com/OpenMW/openmw.git
synced 2025-06-21 21:11:35 +00:00
Show progress dialog for setting content list
This commit is contained in:
parent
3955428f87
commit
157e8c763c
1 changed files with 10 additions and 2 deletions
|
@ -13,6 +13,7 @@
|
|||
#include <QDirIterator>
|
||||
#include <QFont>
|
||||
#include <QIODevice>
|
||||
#include <QProgressDialog>
|
||||
|
||||
#include <components/esm/format.hpp>
|
||||
#include <components/esm3/esmreader.hpp>
|
||||
|
@ -707,10 +708,14 @@ bool ContentSelectorModel::ContentModel::isLoadOrderError(const EsmFile* file) c
|
|||
|
||||
void ContentSelectorModel::ContentModel::setContentList(const QStringList& fileList)
|
||||
{
|
||||
QProgressDialog progressDialog("Setting content list", {}, 0, static_cast<int>(fileList.size()));
|
||||
progressDialog.setWindowModality(Qt::WindowModal);
|
||||
progressDialog.setValue(0);
|
||||
|
||||
int previousPosition = -1;
|
||||
for (const QString& filepath : fileList)
|
||||
for (qsizetype i = 0, n = fileList.size(); i < n; ++i)
|
||||
{
|
||||
const EsmFile* file = item(filepath);
|
||||
const EsmFile* file = item(fileList[i]);
|
||||
if (setCheckState(file, true))
|
||||
{
|
||||
// setCheckState already gracefully handles builtIn and fromAnotherConfigFile
|
||||
|
@ -725,7 +730,10 @@ void ContentSelectorModel::ContentModel::setContentList(const QStringList& fileL
|
|||
previousPosition = filePosition;
|
||||
}
|
||||
}
|
||||
|
||||
progressDialog.setValue(static_cast<int>(i + 1));
|
||||
}
|
||||
|
||||
refreshModel();
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue