comparison widgets/InteractiveFileFinder.cpp @ 672:ee99f5c0050c

Add CSVFile option
author Chris Cannam
date Wed, 09 Oct 2013 14:52:09 +0100
parents d632a1e87018
children 1a0dfcbffaf1
comparison
equal deleted inserted replaced
671:0aea4b9e4c3d 672:ee99f5c0050c
100 } 100 }
101 filter = tr("Image files (%1)\nAll files (*.*)").arg(fmts.join(" ")); 101 filter = tr("Image files (%1)\nAll files (*.*)").arg(fmts.join(" "));
102 } 102 }
103 break; 103 break;
104 104
105 case CSVFile:
106 settingsKey = "layerpath";
107 filter = tr("Comma-separated data files (*.csv)\nSpace-separated .lab files (*.lab)\nText files (*.txt)\nAll files (*.*)");
108 break;
109
105 case AnyFile: 110 case AnyFile:
106 settingsKey = "lastpath"; 111 settingsKey = "lastpath";
107 filter = tr("All supported files (*.sv %1 %2 %3)\nSonic Visualiser session files (*.sv)\nAudio files (%1)\nLayer files (%2)\nRDF files (%3)\nAll files (*.*)") 112 filter = tr("All supported files (*.sv %1 %2 %3)\nSonic Visualiser session files (*.sv)\nAudio files (%1)\nLayer files (%2)\nRDF files (%3)\nAll files (*.*)")
108 .arg(AudioFileReaderFactory::getKnownExtensions()) 113 .arg(AudioFileReaderFactory::getKnownExtensions())
109 .arg(DataFileReaderFactory::getKnownExtensions()) 114 .arg(DataFileReaderFactory::getKnownExtensions())
227 settingsKey = "saveimagepath"; 232 settingsKey = "saveimagepath";
228 title = tr("Select a file to export to"); 233 title = tr("Select a file to export to");
229 filter = tr("Portable Network Graphics files (*.png)\nAll files (*.*)"); 234 filter = tr("Portable Network Graphics files (*.png)\nAll files (*.*)");
230 break; 235 break;
231 236
237 case CSVFile:
238 settingsKey = "savelayerpath";
239 title = tr("Select a file to export to");
240 filter = tr("Comma-separated data files (*.csv)\nText files (*.txt)\nAll files (*.*)");
241 break;
242
232 case AnyFile: 243 case AnyFile:
233 std::cerr << "ERROR: Internal error: InteractiveFileFinder::getSaveFileName: AnyFile cannot be used here" << std::endl; 244 std::cerr << "ERROR: Internal error: InteractiveFileFinder::getSaveFileName: AnyFile cannot be used here" << std::endl;
234 abort(); 245 abort();
235 }; 246 };
236 247
266 dialog.setDefaultSuffix("sv"); 277 dialog.setDefaultSuffix("sv");
267 } else if (type == AudioFile) { 278 } else if (type == AudioFile) {
268 dialog.setDefaultSuffix("wav"); 279 dialog.setDefaultSuffix("wav");
269 } else if (type == ImageFile) { 280 } else if (type == ImageFile) {
270 dialog.setDefaultSuffix("png"); 281 dialog.setDefaultSuffix("png");
282 } else if (type == CSVFile) {
283 dialog.setDefaultSuffix("csv");
271 } 284 }
272 285
273 bool good = false; 286 bool good = false;
274 287
275 while (!good) { 288 while (!good) {
362 375
363 case ImageFile: 376 case ImageFile:
364 settingsKey = "imagepath"; 377 settingsKey = "imagepath";
365 break; 378 break;
366 379
380 case CSVFile:
381 settingsKey = "layerpath";
382 break;
383
367 case AnyFile: 384 case AnyFile:
368 settingsKey = "lastpath"; 385 settingsKey = "lastpath";
369 break; 386 break;
370 } 387 }
371 388