MCPcopy Create free account
hub / github.com/chrxh/alien / onOpenParameters

Method onOpenParameters

source/Gui/SimulationParametersMainWindow.cpp:449–465  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

447}
448
449void SimulationParametersMainWindow::onOpenParameters()
450{
451 GenericFileDialog::get().showOpenFileDialog(
452 "Open simulation parameters", "Simulation parameters (*.parameters){.parameters},.*", _fileDialogPath, [&](std::filesystem::path const& path) {
453 auto firstFilename = ifd::FileDialog::Instance().GetResult();
454 auto firstFilenameCopy = firstFilename;
455 _fileDialogPath = firstFilenameCopy.remove_filename().string();
456
457 SimulationParameters parameters;
458 if (!SerializerService::get().deserializeSimulationParametersFromFile(parameters, firstFilename.string())) {
459 GenericMessageDialog::get().information("Open simulation parameters", "The selected file could not be opened.");
460 } else {
461 _simulationFacade->setSimulationParameters(parameters);
462 _simulationFacade->setOriginalSimulationParameters(parameters);
463 }
464 });
465}
466
467void SimulationParametersMainWindow::onSaveParameters()
468{

Callers

nothing calls this directly

Tested by

no test coverage detected