| 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 | { |
nothing calls this directly
no test coverage detected