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

Function runDialog

source/MRViewer/MRFileDialog.cpp:434–468  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

432}
433
434std::vector<std::filesystem::path> runDialog( const MR::FileDialog::Parameters& parameters )
435{
436 if ( MR::UI::TestEngine::wasFrameTriggered() )
437 {
438 auto staged = MR::UI::TestEngine::consumeStagedFileDialogPaths();
439 if ( auto ex = sValidateStagedFileDialogPaths( staged, parameters ); !ex )
440 {
441 MR::UI::TestEngine::appendStatusMessage( fmt::format(
442 "TestEngine-triggered file dialog: {}. "
443 "Call ui_stageFileDialogPaths(...) with the right path(s) before pressing the button.",
444 ex.error() ) );
445 return {};
446 }
447 return staged;
448 }
449
450#if defined( __EMSCRIPTEN__ )
451 (void)parameters;
452 return {};
453#elif defined( _WIN32 )
454 return windowsDialog( parameters );
455#elif defined( __APPLE__ )
456 return MR::detail::runCocoaFileDialog( parameters );
457#else
458#if !defined( MRVIEWER_NO_XDG_DESKTOP_PORTAL )
459 if ( MR::detail::isPortalFileDialogSupported() )
460 return MR::detail::runPortalFileDialog( parameters );
461#endif
462#if !defined( MRVIEWER_NO_GTK )
463 return gtkDialog( parameters );
464#endif
465 (void)parameters;
466 return {};
467#endif
468}
469
470}
471

Callers 5

openFileDialogFunction · 0.85
openFilesDialogFunction · 0.85
openFolderDialogFunction · 0.85
openFoldersDialogFunction · 0.85
saveFileDialogFunction · 0.85

Calls 9

wasFrameTriggeredFunction · 0.85
appendStatusMessageFunction · 0.85
windowsDialogFunction · 0.85
runPortalFileDialogFunction · 0.85
gtkDialogFunction · 0.85
errorMethod · 0.80

Tested by

no test coverage detected