From 0ed4356fc28b9cf9474bbbfcdeb9bc49ff83b9ec Mon Sep 17 00:00:00 2001 From: Dirk Hohndel Date: Wed, 25 Feb 2015 10:05:37 +0100 Subject: 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 --- qt-ui/mainwindow.cpp | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) (limited to 'qt-ui/mainwindow.cpp') diff --git a/qt-ui/mainwindow.cpp b/qt-ui/mainwindow.cpp index 648ead174..7b204626c 100644 --- a/qt-ui/mainwindow.cpp +++ b/qt-ui/mainwindow.cpp @@ -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)); } } -- cgit v1.2.3-70-g09d2