MCPcopy Create free account
hub / github.com/davidgiven/fluxengine / OnSaveFluxButton

Method OnSaveFluxButton

src/gui/imagerpanel.cc:272–302  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

270 }
271
272 void OnSaveFluxButton(wxCommandEvent&) override
273 {
274 try
275 {
276 auto filename =
277 wxFileSelector("Choose the name of the flux file to write",
278 /* default_path= */ wxEmptyString,
279 /* default_filename= */ "image.flux",
280 /* default_extension= */ wxEmptyString,
281 /* wildcard= */ wxEmptyString,
282 /* flags= */ wxFD_SAVE | wxFD_OVERWRITE_PROMPT);
283 if (filename.empty())
284 return;
285
286 globalConfig().setFluxSink(filename.ToStdString());
287
288 QueueJob(
289 [this]()
290 {
291 auto fluxSource =
292 FluxSource::createMemoryFluxSource(*_currentDisk);
293 auto fluxSinkFactory =
294 FluxSinkFactory::create(globalConfig()->flux_sink());
295 writeRawDiskCommand(*fluxSource, *fluxSinkFactory);
296 });
297 }
298 catch (const ErrorException& e)
299 {
300 wxMessageBox(e.message, "Error", wxOK | wxICON_ERROR);
301 }
302 }
303
304 void OnTrackSelection(TrackSelectionEvent& event)
305 {

Callers

nothing calls this directly

Calls 3

writeRawDiskCommandFunction · 0.85
setFluxSinkMethod · 0.80
emptyMethod · 0.45

Tested by

no test coverage detected