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

Method onSaveSimulationDialog

source/Gui/FileTransferController.cpp:73–90  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

71}
72
73void FileTransferController::onSaveSimulationDialog()
74{
75 GenericFileDialog::get().showSaveFileDialog(
76 "Save simulation", "Simulation file (*.sim){.sim},.*", _referencePath, [&](std::filesystem::path const& path) {
77 auto firstFilename = ifd::FileDialog::Instance().GetResult();
78 auto firstFilenameCopy = firstFilename;
79 _referencePath = firstFilenameCopy.remove_filename().string();
80 printOverlayMessage("Saving ...");
81 _saveSimulationProcessor->executeTask(
82 [&, firstFilename = firstFilename](auto const& senderId) {
83 auto senderInfo = SenderInfo{.senderId = senderId, .wishResultData = false, .wishErrorInfo = true};
84 auto readData = SaveSimulationRequestData{firstFilename.string(), Viewport::get().getZoomFactor(), Viewport::get().getCenterInWorldPos()};
85 return _persisterFacade->scheduleSaveSimulation(senderInfo, readData);
86 },
87 [](auto const&) { },
88 [](auto const& criticalErrors) { GenericMessageDialog::get().information("Error", criticalErrors); });
89 });
90}
91
92void FileTransferController::init(PersisterFacade persisterFacade, SimulationFacade simulationFacade)
93{

Callers 1

processMenubarMethod · 0.80

Calls 7

printOverlayMessageFunction · 0.85
showSaveFileDialogMethod · 0.80
executeTaskMethod · 0.80
getZoomFactorMethod · 0.80
getCenterInWorldPosMethod · 0.80
informationMethod · 0.80

Tested by

no test coverage detected