MCPcopy Create free account
hub / github.com/TASEmulators/fceux / saveCdlFileAs

Method saveCdlFileAs

src/drivers/Qt/CodeDataLogger.cpp:426–485  ·  view source on GitHub ↗

----------------------------------------------------

Source from the content-addressed store, hash-verified

424}
425//----------------------------------------------------
426void CodeDataLoggerDialog_t::saveCdlFileAs(void)
427{
428 int ret, useNativeFileDialogVal;
429 QString filename;
430 const char *romFile;
431 QFileDialog dialog(this, tr("Save CDL File As"));
432
433 dialog.setFileMode(QFileDialog::AnyFile);
434
435 dialog.setNameFilter(tr("CDL Files (*.cdl *.CDL) ;; All files (*)"));
436
437 dialog.setViewMode(QFileDialog::List);
438 dialog.setFilter(QDir::AllEntries | QDir::AllDirs | QDir::Hidden);
439 dialog.setLabelText(QFileDialog::Accept, tr("Save"));
440 dialog.setDefaultSuffix(tr(".cdl"));
441
442 romFile = getRomFile();
443
444 if (romFile != NULL)
445 {
446 std::string dir, base;
447
448 parseFilepath(romFile, &dir, &base);
449
450 base.append(".cdl");
451
452 dialog.setDirectory(tr(dir.c_str()));
453
454 dialog.selectFile(tr(base.c_str()));
455 }
456
457 // Check config option to use native file dialog or not
458 g_config->getOption("SDL.UseNativeFileDialog", &useNativeFileDialogVal);
459
460 dialog.setOption(QFileDialog::DontUseNativeDialog, !useNativeFileDialogVal);
461
462 ret = dialog.exec();
463
464 if (ret)
465 {
466 QStringList fileList;
467 fileList = dialog.selectedFiles();
468
469 if (fileList.size() > 0)
470 {
471 filename = fileList[0];
472 }
473 }
474
475 if (filename.isNull())
476 {
477 return;
478 }
479 //qDebug() << "selected file path : " << filename.toUtf8();
480
481 FCEU_WRAPPER_LOCK();
482 strcpy(loadedcdfile, filename.toStdString().c_str());
483 SaveCDLogFile();

Callers

nothing calls this directly

Calls 8

parseFilepathFunction · 0.85
getOptionMethod · 0.80
setOptionMethod · 0.80
execMethod · 0.80
getRomFileFunction · 0.70
SaveCDLogFileFunction · 0.70
trFunction · 0.50
sizeMethod · 0.45

Tested by

no test coverage detected