| 432 | } |
| 433 | |
| 434 | std::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 |
no test coverage detected