MCPcopy Create free account
hub / github.com/MeshInspector/MeshLib / openFileDialogAsync

Function openFileDialogAsync

source/MRViewer/MRFileDialog.cpp:494–515  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

492}
493
494void openFileDialogAsync( std::function<void( const std::filesystem::path& )> callback, const FileParameters& params /*= {} */ )
495{
496 assert( callback );
497#ifndef __EMSCRIPTEN__
498 callback( openFileDialog( params ) );
499#else
500 sDialogFilesCallback = [callback] ( const std::vector<std::filesystem::path>& paths )
501 {
502 if ( !paths.empty() )
503 {
504 if ( !paths[0].empty() )
505 FileDialogSignals::instance().onOpenFile( paths[0] );
506 callback( paths[0] );
507 }
508 };
509 std::string accumFilter = webAccumFilter( params.filters );
510#pragma clang diagnostic push
511#pragma clang diagnostic ignored "-Wdollar-in-identifier-extension"
512 EM_ASM( open_files_dialog_popup( UTF8ToString( $0 ), $1), accumFilter.c_str(), false);
513#pragma clang diagnostic pop
514#endif
515}
516
517std::vector<std::filesystem::path> openFilesDialog( const FileParameters& params )
518{

Callers 1

drawDialogMethod · 0.85

Calls 5

openFileDialogFunction · 0.85
instanceFunction · 0.85
webAccumFilterFunction · 0.85
open_files_dialog_popupFunction · 0.85
emptyMethod · 0.45

Tested by

no test coverage detected