diff options
author | Dirk Hohndel <dirk@hohndel.org> | 2015-02-25 10:05:37 +0100 |
---|---|---|
committer | Dirk Hohndel <dirk@hohndel.org> | 2015-02-25 10:05:37 +0100 |
commit | 0ed4356fc28b9cf9474bbbfcdeb9bc49ff83b9ec (patch) | |
tree | 84d41603ad6daa8f12159da4692de8b1d31a35fa /qt-ui | |
parent | d15641a6facce67b48c5ae5e7bc56d2ed7492e67 (diff) | |
download | subsurface-0ed4356fc28b9cf9474bbbfcdeb9bc49ff83b9ec.tar.gz |
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>
Diffstat (limited to 'qt-ui')
-rw-r--r-- | qt-ui/mainwindow.cpp | 19 | ||||
-rw-r--r-- | qt-ui/mainwindow.h | 1 |
2 files changed, 20 insertions, 0 deletions
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)); } } diff --git a/qt-ui/mainwindow.h b/qt-ui/mainwindow.h index 85a63123b..5f4567f76 100644 --- a/qt-ui/mainwindow.h +++ b/qt-ui/mainwindow.h @@ -90,6 +90,7 @@ public: void printPlan(); void checkSurvey(QSettings *s); void setApplicationState(const QByteArray& state); + void showV2Dialog(); QUndoStack *undoStack; private slots: |