| 214 | } |
| 215 | |
| 216 | void 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 | |
| 240 | void TrackMenuTable::OnMoveTrack(wxCommandEvent &event) |
| 241 | { |
nothing calls this directly
no test coverage detected