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

Function saveFileDialog

source/MRViewer/MRFileDialog.cpp:627–646  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

625}
626
627std::filesystem::path saveFileDialog( const FileParameters& params /*= {} */ )
628{
629 FileDialog::Parameters parameters{ params };
630 parameters.folderDialog = false;
631 parameters.multiselect = false;
632 parameters.saveDialog = true;
633 if ( parameters.filters.empty() )
634 parameters.filters = { { "All files", "*.*" } };
635
636 const auto results = runDialog( parameters );
637 if ( results.size() == 1 && !results[0].empty() )
638 {
639 spdlog::info( "Save dialog returned: {}", MR::utf8string( results[0] ) );
640 FileDialog::setLastUsedDir( results[0].parent_path() );
641 FileDialogSignals::instance().onSaveFile( results[0] );
642 return results[0];
643 }
644 spdlog::info( "Save dialog canceled" );
645 return {};
646}
647
648void saveFileDialogAsync( std::function<void( const std::filesystem::path& )> callback, const FileParameters& params /*= {} */ )
649{

Callers 5

actionMethod · 0.85
drawDialogMethod · 0.85
saveChangesPopupFunction · 0.85
saveFileDialogAsyncFunction · 0.85

Calls 6

runDialogFunction · 0.85
utf8stringFunction · 0.85
setLastUsedDirFunction · 0.85
instanceFunction · 0.85
emptyMethod · 0.45
sizeMethod · 0.45

Tested by

no test coverage detected