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:
parent
758eae6b3a
commit
4956ce3e68
@ -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;
|
||||
|
@ -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;
|
||||
}
|
||||
|
@ -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; }
|
||||
|
Loading…
x
Reference in New Issue
Block a user