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

Function openFilesDialogAsync

source/MRViewer/MRFileDialog.cpp:546–564  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

544}
545
546void 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
566std::filesystem::path openFolderDialog( std::filesystem::path baseFolder )
567{

Callers 1

actionMethod · 0.85

Calls 5

openFilesDialogFunction · 0.85
instanceFunction · 0.85
webAccumFilterFunction · 0.85
open_files_dialog_popupFunction · 0.85
emptyMethod · 0.45

Tested by

no test coverage detected