| 585 | } |
| 586 | |
| 587 | void openFolderDialogAsync( std::function<void ( const std::filesystem::path& )> callback, std::filesystem::path baseFolder ) |
| 588 | { |
| 589 | assert( callback ); |
| 590 | #ifndef __EMSCRIPTEN__ |
| 591 | callback( openFolderDialog( std::move( baseFolder ) ) ); |
| 592 | #else |
| 593 | sDialogFilesCallback = [callback] ( const std::vector<std::filesystem::path>& paths ) |
| 594 | { |
| 595 | if ( !paths.empty() ) |
| 596 | { |
| 597 | if ( !paths[0].empty() ) |
| 598 | FileDialogSignals::instance().onSelectFolder( paths[0] ); |
| 599 | callback( paths[0] ); |
| 600 | } |
| 601 | }; |
| 602 | (void)baseFolder; |
| 603 | #pragma clang diagnostic push |
| 604 | #pragma clang diagnostic ignored "-Wdollar-in-identifier-extension" |
| 605 | EM_ASM( open_directory_dialog_popup()); |
| 606 | #pragma clang diagnostic pop |
| 607 | #endif |
| 608 | } |
| 609 | |
| 610 | std::vector<std::filesystem::path> openFoldersDialog( std::filesystem::path baseFolder ) |
| 611 | { |
no test coverage detected