MCPcopy Create free account
hub / github.com/audacity/audacity / OnDeletePreset

Method OnDeletePreset

modules/import-export/mod-ffmpeg/ExportFFmpegOptions.cpp:977–1001  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

975///
976///
977void 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///

Callers

nothing calls this directly

Calls 8

AudacityMessageBoxFunction · 0.85
DeletePresetMethod · 0.80
GetValueMethod · 0.45
emptyMethod · 0.45
SetValueMethod · 0.45
DeleteMethod · 0.45
beginMethod · 0.45
endMethod · 0.45

Tested by

no test coverage detected