mirror of
https://gitlab.com/pholy/OSCAR-code.git
synced 2025-04-06 11:10:44 +00:00
Fix double import progress window.
This commit is contained in:
parent
c5c6f779f7
commit
b96f22bcd9
@ -1064,35 +1064,17 @@ void MainWindow::importCPAPDataCards(const QList<ImportPath> & datacards)
|
||||
{
|
||||
bool newdata = false;
|
||||
|
||||
// QStringList goodlocations;
|
||||
|
||||
ProgressDialog * prog = new ProgressDialog(this);
|
||||
prog->setMessage(tr("Processing import list..."));
|
||||
prog->addAbortButton();
|
||||
prog->setWindowModality(Qt::ApplicationModal);
|
||||
|
||||
prog->open();
|
||||
|
||||
int c = -1;
|
||||
for (int i = 0; i < datacards.size(); i++) {
|
||||
QString dir = datacards[i].path;
|
||||
MachineLoader * loader = datacards[i].loader;
|
||||
if (!loader) continue;
|
||||
connect(loader, SIGNAL(updateMessage(QString)), prog, SLOT(setMessage(QString)));
|
||||
connect(loader, SIGNAL(setProgressMax(int)), prog, SLOT(setProgressMax(int)));
|
||||
connect(loader, SIGNAL(setProgressValue(int)), prog, SLOT(setProgressValue(int)));
|
||||
connect(prog, SIGNAL(abortClicked()), loader, SLOT(abortImport()));
|
||||
|
||||
QPixmap image = loader->getPixmap(loader->PeekInfo(dir).series);
|
||||
image = image.scaled(64,64);
|
||||
prog->setPixmap(image);
|
||||
|
||||
if (!dir.isEmpty()) {
|
||||
c = importCPAP(datacards[i], tr("Importing Data"));
|
||||
qDebug() << "Finished Importing data" << c;
|
||||
|
||||
if (c >= 0) {
|
||||
// goodlocations.push_back(dir);
|
||||
QDir d(dir.section("/",0,-1));
|
||||
(*p_profile)[STR_PREF_LastCPAPPath] = d.absolutePath();
|
||||
}
|
||||
@ -1101,19 +1083,12 @@ void MainWindow::importCPAPDataCards(const QList<ImportPath> & datacards)
|
||||
newdata = true;
|
||||
}
|
||||
}
|
||||
disconnect(prog, SIGNAL(abortClicked()), loader, SLOT(abortImport()));
|
||||
disconnect(loader, SIGNAL(setProgressMax(int)), prog, SLOT(setProgressMax(int)));
|
||||
disconnect(loader, SIGNAL(setProgressValue(int)), prog, SLOT(setProgressValue(int)));
|
||||
disconnect(loader, SIGNAL(updateMessage(QString)), prog, SLOT(setMessage(QString)));
|
||||
}
|
||||
|
||||
if (newdata) {
|
||||
finishCPAPImport();
|
||||
PopulatePurgeMenu();
|
||||
}
|
||||
|
||||
prog->close();
|
||||
prog->deleteLater();
|
||||
}
|
||||
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user