----------------------------------------------------
| 541 | } |
| 542 | //---------------------------------------------------- |
| 543 | void CodeDataLoggerDialog_t::SaveStrippedROM(int invert) |
| 544 | { |
| 545 | |
| 546 | //this is based off of iNesSave() |
| 547 | //todo: make this support NSF |
| 548 | // |
| 549 | if (!GameInfo) |
| 550 | return; |
| 551 | |
| 552 | if (GameInfo->type == GIT_NSF) |
| 553 | { |
| 554 | printf("Sorry, you're not allowed to save optimized NSFs yet. Please don't optimize individual banks, as there are still some issues with several NSFs to be fixed, and it is easier to fix those issues with as much of the bank data intact as possible."); |
| 555 | return; |
| 556 | } |
| 557 | |
| 558 | if (codecount == 0) |
| 559 | { |
| 560 | printf("Unable to Generate Stripped ROM. Get Something Logged and try again."); |
| 561 | return; |
| 562 | } |
| 563 | |
| 564 | int i, ret, useNativeFileDialogVal; |
| 565 | QString filename; |
| 566 | const char *romFile; |
| 567 | QFileDialog dialog(this, tr("Save Stripped File As...")); |
| 568 | |
| 569 | dialog.setFileMode(QFileDialog::AnyFile); |
| 570 | |
| 571 | if (GameInfo->type == GIT_NSF) |
| 572 | { |
| 573 | dialog.setNameFilter(tr("NSF Files (*.nsf *.NSF) ;; All files (*)")); |
| 574 | dialog.setDefaultSuffix(tr(".nsf")); |
| 575 | } |
| 576 | else |
| 577 | { |
| 578 | dialog.setNameFilter(tr("NES Files (*.nes *.NES) ;; All files (*)")); |
| 579 | dialog.setDefaultSuffix(tr(".nes")); |
| 580 | } |
| 581 | dialog.setViewMode(QFileDialog::List); |
| 582 | dialog.setFilter(QDir::AllEntries | QDir::AllDirs | QDir::Hidden); |
| 583 | dialog.setLabelText(QFileDialog::Accept, tr("Save")); |
| 584 | |
| 585 | romFile = getRomFile(); |
| 586 | |
| 587 | if (romFile != NULL) |
| 588 | { |
| 589 | std::string dir; |
| 590 | |
| 591 | parseFilepath(romFile, &dir); |
| 592 | |
| 593 | dialog.setDirectory(tr(dir.c_str())); |
| 594 | } |
| 595 | |
| 596 | // Check config option to use native file dialog or not |
| 597 | g_config->getOption("SDL.UseNativeFileDialog", &useNativeFileDialogVal); |
| 598 | |
| 599 | dialog.setOption(QFileDialog::DontUseNativeDialog, !useNativeFileDialogVal); |
| 600 |
nothing calls this directly
no test coverage detected