mirror of
https://github.com/cookiengineer/audacity
synced 2025-06-17 00:20:06 +02:00
Fix: "\" in file name gives disk full error. Now we complain about a non-existent directory instead. (Bug 120).
This commit is contained in:
parent
91b1124a39
commit
6bdfb13b45
@ -2945,6 +2945,30 @@ void AudacityProject::WriteXML(XMLWriter &xmlFile)
|
||||
}
|
||||
}
|
||||
|
||||
// Lock all blocks in all tracks of the last saved version
|
||||
void AudacityProject::LockAllBlocks()
|
||||
{
|
||||
TrackListIterator iter(mLastSavedTracks);
|
||||
Track *t = iter.First();
|
||||
while (t) {
|
||||
if (t->GetKind() == Track::Wave)
|
||||
((WaveTrack *) t)->Lock();
|
||||
t = iter.Next();
|
||||
}
|
||||
}
|
||||
|
||||
// Unlock all blocks in all tracks of the last saved version
|
||||
void AudacityProject::UnlockAllBlocks()
|
||||
{
|
||||
TrackListIterator iter(mLastSavedTracks);
|
||||
Track *t = iter.First();
|
||||
while (t) {
|
||||
if (t->GetKind() == Track::Wave)
|
||||
((WaveTrack *) t)->Unlock();
|
||||
t = iter.Next();
|
||||
}
|
||||
}
|
||||
|
||||
bool AudacityProject::Save(bool overwrite /* = true */ ,
|
||||
bool fromSaveAs /* = false */,
|
||||
bool bWantSaveCompressed /*= false*/)
|
||||
@ -3025,6 +3049,16 @@ bool AudacityProject::Save(bool overwrite /* = true */ ,
|
||||
|
||||
mWantSaveCompressed = bWantSaveCompressed;
|
||||
bool success = false;
|
||||
|
||||
if( !wxDir::Exists( projPath ) ){
|
||||
wxMessageBox(wxString::Format(
|
||||
_("Could not save project. Path not found. Try creating \ndirectory \"%s\" before saving project with this name."),
|
||||
projPath.c_str()),
|
||||
_("Error saving project"),
|
||||
wxICON_ERROR, this);
|
||||
return false;
|
||||
}
|
||||
|
||||
if (bWantSaveCompressed)
|
||||
{
|
||||
//v Move this condition into SaveCompressedWaveTracks() if want to support other formats.
|
||||
@ -3041,30 +3075,15 @@ bool AudacityProject::Save(bool overwrite /* = true */ ,
|
||||
// (Otherwise the new project would be fine, but the old one would
|
||||
// be empty of all of its files.)
|
||||
|
||||
// Lock all blocks in all tracks of the last saved version
|
||||
if (mLastSavedTracks && !overwrite) {
|
||||
TrackListIterator iter(mLastSavedTracks);
|
||||
Track *t = iter.First();
|
||||
while (t) {
|
||||
if (t->GetKind() == Track::Wave)
|
||||
((WaveTrack *) t)->Lock();
|
||||
t = iter.Next();
|
||||
}
|
||||
}
|
||||
if (mLastSavedTracks && !overwrite)
|
||||
LockAllBlocks();
|
||||
|
||||
// This renames the project directory, and moves or copies
|
||||
// all of our block files over.
|
||||
success = mDirManager->SetProject(projPath, projName, !overwrite);
|
||||
|
||||
// Unlock all blocks in all tracks of the last saved version
|
||||
if (mLastSavedTracks && !overwrite) {
|
||||
TrackListIterator iter(mLastSavedTracks);
|
||||
Track *t = iter.First();
|
||||
while (t) {
|
||||
if (t->GetKind() == Track::Wave)
|
||||
((WaveTrack *) t)->Unlock();
|
||||
t = iter.Next();
|
||||
}
|
||||
}
|
||||
if (mLastSavedTracks && !overwrite)
|
||||
UnlockAllBlocks();
|
||||
}
|
||||
|
||||
if (!success) {
|
||||
|
@ -198,6 +198,8 @@ class AUDACITY_DLL_API AudacityProject: public wxFrame,
|
||||
|
||||
void AddImportedTracks(wxString fileName,
|
||||
Track **newTracks, int numTracks);
|
||||
void LockAllBlocks();
|
||||
void UnlockAllBlocks();
|
||||
bool Save(bool overwrite = true, bool fromSaveAs = false, bool bWantSaveCompressed = false);
|
||||
bool SaveAs(bool bWantSaveCompressed = false);
|
||||
#ifdef USE_LIBVORBIS
|
||||
|
Loading…
x
Reference in New Issue
Block a user