# HG changeset patch # User Chris Cannam # Date 1530277049 -3600 # Node ID 2160976df43670537aee1b20bc1c22d961c115de # Parent 05c53d02bf7ed61231bf12401cd74e034f147c48 Use progress dialog when importing audio data diff -r 05c53d02bf7e -r 2160976df436 main/MainWindow.cpp --- a/main/MainWindow.cpp Thu Jun 28 15:45:13 2018 +0100 +++ b/main/MainWindow.cpp Fri Jun 29 13:57:29 2018 +0100 @@ -2901,13 +2901,23 @@ format.setTimeUnits(CSVFormat::TimeAudioFrames); FileOpenStatus status = FileOpenSucceeded; + + ProgressDialog *dialog = new ProgressDialog(tr("Importing audio data..."), + true, 0, this, + Qt::ApplicationModal); WaveFileModel *model = qobject_cast (DataFileReaderFactory::loadCSV (path, format, - getMainModel() ? getMainModel()->getSampleRate() : rate)); - - if (!model || !model->isOK()) { + getMainModel() ? getMainModel()->getSampleRate() : rate, + dialog)); + + if (dialog->wasCancelled()) { + + delete model; + status = FileOpenCancelled; + + } else if (!model || !model->isOK()) { delete model; status = FileOpenFailed; @@ -2921,6 +2931,8 @@ false); } + delete dialog; + if (status == FileOpenFailed) { emit hideSplash(); QMessageBox::critical(this, tr("Failed to open file"), diff -r 05c53d02bf7e -r 2160976df436 repoint-lock.json --- a/repoint-lock.json Thu Jun 28 15:45:13 2018 +0100 +++ b/repoint-lock.json Fri Jun 29 13:57:29 2018 +0100 @@ -4,7 +4,7 @@ "pin": "da86fb0bccb3" }, "svcore": { - "pin": "8d4f09552ba4" + "pin": "f0c2b8b31609" }, "svgui": { "pin": "fcc1f45f7bd5"