Mercurial > hg > sonic-visualiser
diff main/MainWindow.cpp @ 1779:b660b2fa8411 streaming-csv-writer
Add Lucas's progress dialog change for CSV export
author | Chris Cannam |
---|---|
date | Mon, 16 Apr 2018 15:23:01 +0100 |
parents | 893f556cd5c9 |
children | 95248f6b9b1d |
line wrap: on
line diff
--- a/main/MainWindow.cpp Fri Apr 13 17:19:21 2018 +0100 +++ b/main/MainWindow.cpp Mon Apr 16 15:23:01 2018 +0100 @@ -58,6 +58,7 @@ #include "widgets/LabelCounterInputDialog.h" #include "widgets/ActivityLog.h" #include "widgets/UnitConverter.h" +#include "widgets/ProgressDialog.h" #include "audio/AudioCallbackPlaySource.h" #include "audio/AudioCallbackRecordTarget.h" #include "audio/PlaySpeedRangeMapper.h" @@ -2726,11 +2727,19 @@ if (!multiple) { if (asData) { - CSVFileWriter writer(path, model, + stop(); + ProgressDialog dialog { + QObject::tr("Exporting audio data..."), + true, + 0, + this, + Qt::ApplicationModal + }; + CSVFileWriter writer(path, model, &dialog, ((QFileInfo(path).suffix() == "csv") ? "," : "\t")); if (selectionToWrite) { - writer.writeSelection(selectionToWrite); + writer.writeSelection(*selectionToWrite); } else { writer.write(); }