Display slowness warning before opening a V2 file

This is somewhat invasive as aborting the XML file read requires us to
report things up the recursive parsing chain.

What we really need to do here is to ask the user how they want to use the
data from reverse geo lookup. But for now we only warn about the fact that
this can take a while.

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
This commit is contained in:
Dirk Hohndel 2015-02-25 10:05:37 +01:00
parent d15641a6fa
commit 0ed4356fc2
4 changed files with 68 additions and 25 deletions

View file

@ -1345,6 +1345,18 @@ void MainWindow::importTxtFiles(const QStringList fileNames)
refreshDisplay();
}
void MainWindow::showV2Dialog()
{
// here we need to ask the user if / how they want to do the reverse geo coding
// for now this is just a warning that things could take a long time
QMessageBox d(QMessageBox::Information,
tr("Welcom to Subsurface %1").arg(subsurface_version()),
tr("Importing data files from earlier versions of Subsurface can take a significant amount of time"),
QMessageBox::Ok,
this);
d.exec();
}
void MainWindow::loadFiles(const QStringList fileNames)
{
if (fileNames.isEmpty())
@ -1362,6 +1374,13 @@ void MainWindow::loadFiles(const QStringList fileNames)
set_filename(fileNamePtr.data(), true);
setTitle(MWTF_FILENAME);
} else {
if (!v2_question_shown && abort_read_of_old_file) {
v2_question_shown = true;
abort_read_of_old_file = false;
showV2Dialog();
i--; // so we re-try this file
continue;
}
failedParses.append(fileNames.at(i));
}
}