| 975 | /// |
| 976 | /// |
| 977 | void ExportFFmpegOptions::OnDeletePreset(wxCommandEvent& WXUNUSED(event)) |
| 978 | { |
| 979 | wxComboBox *preset = dynamic_cast<wxComboBox*>(FindWindowById(FEPresetID,this)); |
| 980 | wxString presetname = preset->GetValue(); |
| 981 | if (presetname.empty()) |
| 982 | { |
| 983 | AudacityMessageBox( XO("You can't delete a preset without name") ); |
| 984 | return; |
| 985 | } |
| 986 | |
| 987 | auto query = XO("Delete preset '%s'?").Format( presetname ); |
| 988 | int action = AudacityMessageBox( |
| 989 | query, |
| 990 | XO("Confirm Deletion"), |
| 991 | wxYES_NO | wxCENTRE); |
| 992 | if (action == wxNO) return; |
| 993 | |
| 994 | mPresets->DeletePreset(presetname); |
| 995 | long index = preset->FindString(presetname); |
| 996 | preset->SetValue(wxEmptyString); |
| 997 | preset->Delete(index); |
| 998 | mPresetNames.erase( |
| 999 | std::find( mPresetNames.begin(), mPresetNames.end(), presetname ) |
| 1000 | ); |
| 1001 | } |
| 1002 | |
| 1003 | /// |
| 1004 | /// |
nothing calls this directly
no test coverage detected