1
0
mirror of https://github.com/cookiengineer/audacity synced 2025-06-23 07:40:05 +02:00

Changes as per James's advice, allow Timer Recording to be used when project is empty if user has disabled warnings in prefs. Also resolved a further message whitespace issue.

This commit is contained in:
tip2tail 2016-03-31 22:26:26 +01:00
parent 758eae6b3a
commit 4956ce3e68
3 changed files with 15 additions and 7 deletions

View File

@ -6336,9 +6336,8 @@ void AudacityProject::OnTimerRecord()
// to Timer Recording. This decision has been taken as the safest approach
// preventing issues surrounding "dirty" projects when Automatic Save/Export
// is used in Timer Recording.
if (GetUndoManager()->UnsavedChanges()) {
wxMessageBox(_("Timer Recording cannot be used while you have unsaved changes.\n\n\
Please save or close this project and try again."),
if ((GetUndoManager()->UnsavedChanges()) && (ProjectHasTracks() || mEmptyCanBeDirty)) {
wxMessageBox(_("Timer Recording cannot be used while you have unsaved changes.\n\nPlease save or close this project and try again."),
_("Timer Recording"),
wxICON_INFORMATION | wxOK);
return;

View File

@ -2168,10 +2168,8 @@ void AudacityProject::OnCloseWindow(wxCloseEvent & event)
gAudioIO->StopStream();
}
// These two lines test for an 'empty' project.
// of course it could still have a history at this stage.
TrackListIterator iter2(mTracks);
bool bHasTracks = (iter2.First() != NULL);
// MY: Use routine here so other processes can make same check
bool bHasTracks = ProjectHasTracks();
// We may not bother to prompt the user to save, if the
// project is now empty.
@ -5247,3 +5245,12 @@ bool AudacityProject::SaveFromTimerRecording(wxFileName fnFile) {
return bSuccess;
}
// MY: Does the project have any tracks?
bool AudacityProject::ProjectHasTracks() {
// These two lines test for an 'empty' project.
// of course it could still have a history at this stage.
TrackListIterator iter2(mTracks);
bool bHasTracks = (iter2.First() != NULL);
return bHasTracks;
}

View File

@ -281,6 +281,8 @@ class AUDACITY_DLL_API AudacityProject final : public wxFrame,
int GetOpenProjectCount();
bool IsProjectSaved();
bool ProjectHasTracks();
#include "Menus.h"
CommandManager *GetCommandManager() { return &mCommandManager; }