| 544 | } |
| 545 | |
| 546 | void openFilesDialogAsync( std::function<void( const std::vector<std::filesystem::path>& )> callback, const FileParameters& params /*= {} */ ) |
| 547 | { |
| 548 | assert( callback ); |
| 549 | #ifndef __EMSCRIPTEN__ |
| 550 | callback( openFilesDialog( params ) ); |
| 551 | #else |
| 552 | sDialogFilesCallback = [callback] ( const std::vector<std::filesystem::path>& paths ) |
| 553 | { |
| 554 | if ( !paths.empty() ) |
| 555 | FileDialogSignals::instance().onOpenFiles( paths ); |
| 556 | callback( paths ); |
| 557 | }; |
| 558 | std::string accumFilter = webAccumFilter( params.filters ); |
| 559 | #pragma clang diagnostic push |
| 560 | #pragma clang diagnostic ignored "-Wdollar-in-identifier-extension" |
| 561 | EM_ASM( open_files_dialog_popup( UTF8ToString( $0 ), $1), accumFilter.c_str(), true); |
| 562 | #pragma clang diagnostic pop |
| 563 | #endif |
| 564 | } |
| 565 | |
| 566 | std::filesystem::path openFolderDialog( std::filesystem::path baseFolder ) |
| 567 | { |
no test coverage detected