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

Method OnSetName

src/tracks/ui/CommonTrackControls.cpp:216–238  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

214}
215
216void TrackMenuTable::OnSetName(wxCommandEvent &)
217{
218 auto &track = mpData->track;
219 AudacityProject *const proj = &mpData->project;
220 const wxString oldName = track.GetName();
221
222 SetTrackNameCommand Command;
223 Command.mName = oldName;
224 // Bug 1837 : We need an OK/Cancel result if we are to enter a blank string.
225 bool bResult = Command.PromptUser(*proj);
226 if (bResult)
227 {
228 wxString newName = Command.mName;
229 track.SetName(newName);
230
231 ProjectHistory::Get( *proj )
232 .PushState(
233 XO("Renamed '%s' to '%s'").Format( oldName, newName ),
234 XO("Name Change"));
235
236 mpData->result = RefreshCode::RefreshAll;
237 }
238}
239
240void TrackMenuTable::OnMoveTrack(wxCommandEvent &event)
241{

Callers

nothing calls this directly

Calls 5

GetFunction · 0.85
GetNameMethod · 0.45
PromptUserMethod · 0.45
SetNameMethod · 0.45
PushStateMethod · 0.45

Tested by

no test coverage detected