New events for timer recording automation
| 342 | |
| 343 | // New events for timer recording automation |
| 344 | void TimerRecordDialog::OnAutoSavePathButton_Click(wxCommandEvent& WXUNUSED(event)) |
| 345 | { |
| 346 | auto &projectFileIO = ProjectFileIO::Get(mProject); |
| 347 | |
| 348 | wxString fName = SelectFile(FileNames::Operation::Export, |
| 349 | XO("Save Timer Recording As"), |
| 350 | m_fnAutoSaveFile.GetPath(), |
| 351 | m_fnAutoSaveFile.GetFullName(), |
| 352 | wxT("aup3"), |
| 353 | { FileNames::AudacityProjects }, |
| 354 | wxFD_SAVE | wxRESIZE_BORDER, |
| 355 | this); |
| 356 | |
| 357 | if (fName.empty()) |
| 358 | return; |
| 359 | |
| 360 | // If project already exists then abort - we do not allow users to overwrite an existing project |
| 361 | // unless it is the current project. |
| 362 | if (wxFileExists(fName) && (projectFileIO.GetFileName() != fName)) { |
| 363 | AudacityMessageDialog m( |
| 364 | nullptr, |
| 365 | XO("The selected file name could not be used\nfor Timer Recording because it \ |
| 366 | would overwrite another project.\nPlease try again and select an original name."), |
| 367 | XO("Error Saving Timer Recording Project"), |
| 368 | wxOK|wxICON_ERROR ); |
| 369 | m.ShowModal(); |
| 370 | return; |
| 371 | } |
| 372 | |
| 373 | // Set this boolean to false so we now do a SaveAs at the end of the recording |
| 374 | // unless we're saving the current project. |
| 375 | m_bProjectAlreadySaved = projectFileIO.GetFileName() == fName? true : false; |
| 376 | |
| 377 | m_fnAutoSaveFile = fName; |
| 378 | m_fnAutoSaveFile.SetExt(wxT("aup3")); |
| 379 | this->UpdateTextBoxControls(); |
| 380 | } |
| 381 | |
| 382 | void TimerRecordDialog::OnAutoExportPathButton_Click(wxCommandEvent& WXUNUSED(event)) |
| 383 | { |
nothing calls this directly
no test coverage detected