| 440 | } |
| 441 | |
| 442 | void ExportFilePanel::OnFolderBrowse(wxCommandEvent &event) |
| 443 | { |
| 444 | FileNames::FileTypes fileTypes; |
| 445 | |
| 446 | for(auto [plugin, formatIndex] : ExportPluginRegistry::Get()) |
| 447 | { |
| 448 | const auto formatInfo = plugin->GetFormatInfo(formatIndex); |
| 449 | fileTypes.emplace_back(formatInfo.description, formatInfo.extensions); |
| 450 | } |
| 451 | wxFileDialog fd(this, _("Choose a location to save the exported files"), |
| 452 | mFolder->GetValue(), |
| 453 | mFullName->GetValue(), |
| 454 | FileNames::FormatWildcard(fileTypes), |
| 455 | wxFD_SAVE); |
| 456 | fd.SetFilterIndex(mFormat->GetSelection()); |
| 457 | |
| 458 | if(fd.ShowModal() == wxID_OK) |
| 459 | { |
| 460 | wxFileName filepath (fd.GetPath()); |
| 461 | mFolder->SetValue(filepath.GetPath()); |
| 462 | mFullName->SetValue(filepath.GetFullName()); |
| 463 | const auto selectedFormat = fd.GetFilterIndex(); |
| 464 | if(selectedFormat != mFormat->GetSelection()) |
| 465 | { |
| 466 | mFormat->SetSelection(selectedFormat); |
| 467 | ChangeFormat(selectedFormat); |
| 468 | } |
| 469 | } |
| 470 | } |
| 471 | |
| 472 | void ExportFilePanel::OnChannelsChange(wxCommandEvent& event) |
| 473 | { |
nothing calls this directly
no test coverage detected