| 473 | { |
| 474 | |
| 475 | std::filesystem::path openFileDialog( const FileParameters& params ) |
| 476 | { |
| 477 | FileDialog::Parameters parameters{ params }; |
| 478 | parameters.folderDialog = false; |
| 479 | parameters.multiselect = false; |
| 480 | parameters.saveDialog = false; |
| 481 | if ( parameters.filters.empty() ) |
| 482 | parameters.filters = { { "All files", "*.*" } }; |
| 483 | |
| 484 | const auto results = runDialog( parameters ); |
| 485 | if ( results.size() == 1 ) |
| 486 | { |
| 487 | if ( !results[0].empty() ) |
| 488 | FileDialogSignals::instance().onOpenFile( results[0] ); |
| 489 | return results[0]; |
| 490 | } |
| 491 | return {}; |
| 492 | } |
| 493 | |
| 494 | void openFileDialogAsync( std::function<void( const std::filesystem::path& )> callback, const FileParameters& params /*= {} */ ) |
| 495 | { |
no test coverage detected