Mercurial > hg > svcore
comparison data/fileio/CSVFileReader.cpp @ 308:14e0f60435b8
* Make it possible to drop audio files, layer files, session files and images
onto SV panes.
Need to do a bit more work on where we expect the dropped file to go,
particularly in the case of audio files -- at the moment they're always
opened in new panes, but it may be better to by default replace whatever is
in the target pane.
author | Chris Cannam |
---|---|
date | Wed, 10 Oct 2007 15:18:02 +0000 |
parents | 7336fe3a7caa |
children | 21e79997e80f |
comparison
equal
deleted
inserted
replaced
307:b1a3f7bc035d | 308:14e0f60435b8 |
---|---|
18 #include "model/Model.h" | 18 #include "model/Model.h" |
19 #include "base/RealTime.h" | 19 #include "base/RealTime.h" |
20 #include "model/SparseOneDimensionalModel.h" | 20 #include "model/SparseOneDimensionalModel.h" |
21 #include "model/SparseTimeValueModel.h" | 21 #include "model/SparseTimeValueModel.h" |
22 #include "model/EditableDenseThreeDimensionalModel.h" | 22 #include "model/EditableDenseThreeDimensionalModel.h" |
23 #include "DataFileReaderFactory.h" | |
23 | 24 |
24 #include <QFile> | 25 #include <QFile> |
25 #include <QString> | 26 #include <QString> |
26 #include <QRegExp> | 27 #include <QRegExp> |
27 #include <QStringList> | 28 #include <QStringList> |
89 CSVFormatDialog *dialog = new CSVFormatDialog | 90 CSVFormatDialog *dialog = new CSVFormatDialog |
90 (0, m_file, m_mainModelSampleRate); | 91 (0, m_file, m_mainModelSampleRate); |
91 | 92 |
92 if (dialog->exec() == QDialog::Rejected) { | 93 if (dialog->exec() == QDialog::Rejected) { |
93 delete dialog; | 94 delete dialog; |
94 return 0; | 95 throw DataFileReaderFactory::ImportCancelled; |
95 } | 96 } |
96 | 97 |
97 CSVFormatDialog::ModelType modelType = dialog->getModelType(); | 98 CSVFormatDialog::ModelType modelType = dialog->getModelType(); |
98 CSVFormatDialog::TimingType timingType = dialog->getTimingType(); | 99 CSVFormatDialog::TimingType timingType = dialog->getTimingType(); |
99 CSVFormatDialog::TimeUnits timeUnits = dialog->getTimeUnits(); | 100 CSVFormatDialog::TimeUnits timeUnits = dialog->getTimeUnits(); |
302 | 303 |
303 (void)guessFormat(file); | 304 (void)guessFormat(file); |
304 | 305 |
305 QGridLayout *layout = new QGridLayout; | 306 QGridLayout *layout = new QGridLayout; |
306 | 307 |
307 layout->addWidget(new QLabel(tr("\nPlease select the correct data format for this file.\n")), | 308 layout->addWidget(new QLabel(tr("<b>Select Data Format</b><p>Please select the correct data format for this file.")), |
308 0, 0, 1, 4); | 309 0, 0, 1, 4); |
309 | 310 |
310 layout->addWidget(new QLabel(tr("Each row specifies:")), 1, 0); | 311 layout->addWidget(new QLabel(tr("Each row specifies:")), 1, 0); |
311 | 312 |
312 m_modelTypeCombo = new QComboBox; | 313 m_modelTypeCombo = new QComboBox; |