comparison widgets/InteractiveFileFinder.cpp @ 705:52e5f6fe31ad tonioni

Support non-SV file types (should have been committed earlier, omitted due to confusion)
author Chris Cannam
date Wed, 04 Dec 2013 19:38:12 +0000
parents 1a0dfcbffaf1
children d0fd7630d32f
comparison
equal deleted inserted replaced
703:cc6b21976261 705:52e5f6fe31ad
75 break; 75 break;
76 76
77 case LayerFileNoMidi: 77 case LayerFileNoMidi:
78 settingsKey = "layerpath"; 78 settingsKey = "layerpath";
79 filter = tr("All supported files (%1 %2)\nSonic Visualiser Layer XML files (*.svl)\nComma-separated data files (*.csv)\nSpace-separated .lab files (*.lab)\nRDF files (%2)\nText files (*.txt)\nAll files (*.*)") 79 filter = tr("All supported files (%1 %2)\nSonic Visualiser Layer XML files (*.svl)\nComma-separated data files (*.csv)\nSpace-separated .lab files (*.lab)\nRDF files (%2)\nText files (*.txt)\nAll files (*.*)")
80 .arg(DataFileReaderFactory::getKnownExtensions())
81 .arg(RDFImporter::getKnownExtensions());
82 break;
83
84 case LayerFileNonSV:
85 settingsKey = "layerpath";
86 filter = tr("All supported files (%1 %2)\nComma-separated data files (*.csv)\nSonic Visualiser Layer XML files (*.svl)\nSpace-separated .lab files (*.lab)\nRDF files (%2)\nMIDI files (*.mid)\nText files (*.txt)\nAll files (*.*)")
87 .arg(DataFileReaderFactory::getKnownExtensions())
88 .arg(RDFImporter::getKnownExtensions());
89 break;
90
91 case LayerFileNoMidiNonSV:
92 settingsKey = "layerpath";
93 filter = tr("All supported files (%1 %2)\nComma-separated data files (*.csv)\nSonic Visualiser Layer XML files (*.svl)\nSpace-separated .lab files (*.lab)\nRDF files (%2)\nText files (*.txt)\nAll files (*.*)")
80 .arg(DataFileReaderFactory::getKnownExtensions()) 94 .arg(DataFileReaderFactory::getKnownExtensions())
81 .arg(RDFImporter::getKnownExtensions()); 95 .arg(RDFImporter::getKnownExtensions());
82 break; 96 break;
83 97
84 case SessionOrAudioFile: 98 case SessionOrAudioFile:
222 settingsKey = "savelayerpath"; 236 settingsKey = "savelayerpath";
223 title = tr("Select a file to export to"); 237 title = tr("Select a file to export to");
224 filter = tr("Sonic Visualiser Layer XML files (*.svl)\nComma-separated data files (*.csv)\nRDF/Turtle files (%1)\nText files (*.txt)\nAll files (*.*)").arg(RDFExporter::getSupportedExtensions()); 238 filter = tr("Sonic Visualiser Layer XML files (*.svl)\nComma-separated data files (*.csv)\nRDF/Turtle files (%1)\nText files (*.txt)\nAll files (*.*)").arg(RDFExporter::getSupportedExtensions());
225 break; 239 break;
226 240
241 case LayerFileNonSV:
242 settingsKey = "savelayerpath";
243 title = tr("Select a file to export to");
244 filter = tr("Comma-separated data files (*.csv)\nSonic Visualiser Layer XML files (*.svl)\nRDF/Turtle files (%1)\nMIDI files (*.mid)\nText files (*.txt)\nAll files (*.*)").arg(RDFExporter::getSupportedExtensions());
245 break;
246
247 case LayerFileNoMidiNonSV:
248 settingsKey = "savelayerpath";
249 title = tr("Select a file to export to");
250 filter = tr("Comma-separated data files (*.csv)\nSonic Visualiser Layer XML files (*.svl)\nRDF/Turtle files (%1)\nText files (*.txt)\nAll files (*.*)").arg(RDFExporter::getSupportedExtensions());
251 break;
252
227 case SessionOrAudioFile: 253 case SessionOrAudioFile:
228 cerr << "ERROR: Internal error: InteractiveFileFinder::getSaveFileName: SessionOrAudioFile cannot be used here" << endl; 254 cerr << "ERROR: Internal error: InteractiveFileFinder::getSaveFileName: SessionOrAudioFile cannot be used here" << endl;
229 abort(); 255 abort();
230 256
231 case ImageFile: 257 case ImageFile:
297 323
298 QFileInfo fi(path); 324 QFileInfo fi(path);
299 325
300 cerr << "type = " << type << ", suffix = " << fi.suffix() << endl; 326 cerr << "type = " << type << ", suffix = " << fi.suffix() << endl;
301 327
302 if ((type == LayerFile || type == LayerFileNoMidi) 328 if ((type == LayerFile || type == LayerFileNoMidi ||
329 type == LayerFileNonSV || type == LayerFileNoMidiNonSV)
303 && fi.suffix() == "") { 330 && fi.suffix() == "") {
304 QString expectedExtension; 331 QString expectedExtension;
305 QString selectedFilter = dialog.selectedNameFilter(); 332 QString selectedFilter = dialog.selectedNameFilter();
306 if (selectedFilter.contains(".svl")) { 333 if (selectedFilter.contains(".svl")) {
307 expectedExtension = "svl"; 334 expectedExtension = "svl";
367 394
368 case LayerFileNoMidi: 395 case LayerFileNoMidi:
369 settingsKey = "layerpath"; 396 settingsKey = "layerpath";
370 break; 397 break;
371 398
399 case LayerFileNonSV:
400 settingsKey = "layerpath";
401 break;
402
403 case LayerFileNoMidiNonSV:
404 settingsKey = "layerpath";
405 break;
406
372 case SessionOrAudioFile: 407 case SessionOrAudioFile:
373 settingsKey = "lastpath"; 408 settingsKey = "lastpath";
374 break; 409 break;
375 410
376 case ImageFile: 411 case ImageFile: